diff --git a/src/ast/mod.rs b/src/ast/mod.rs index b89abda9..8067ca72 100644 --- a/src/ast/mod.rs +++ b/src/ast/mod.rs @@ -71,6 +71,16 @@ where /// Identifier name, in the originally quoted form (e.g. `"id"`) pub type Ident = String; +/// A name of a table, view, custom type, etc., possibly multi-part, i.e. db.schema.obj +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct ObjectName(pub Vec); + +impl fmt::Display for ObjectName { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + write!(f, "{}", display_separated(&self.0, ".")) + } +} + /// An SQL expression of any type. /// /// The parser does not distinguish between expressions of different types @@ -593,16 +603,6 @@ impl fmt::Display for Statement { } } -/// A name of a table, view, custom type, etc., possibly multi-part, i.e. db.schema.obj -#[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct ObjectName(pub Vec); - -impl fmt::Display for ObjectName { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "{}", display_separated(&self.0, ".")) - } -} - /// SQL assignment `foo = expr` as used in SQLUpdate #[derive(Debug, Clone, PartialEq, Eq, Hash)] pub struct Assignment {