Move ObjectName closer to Ident in mod.rs

This commit is contained in:
Nickolay Ponomarev 2019-07-07 02:23:10 +03:00
parent ac8ba107e3
commit 64e7be0c68

View file

@ -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<Ident>);
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<Ident>);
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 {