pub struct ColRef {
pub qualifier: Option<Ident>,
pub name: Ident,
}Expand description
A column reference: an optional qualifier and a name, taken straight off the
AST. Stores sqlparser Idents (which keep quote-style) and compares
with dialect-aware folding, never raw-string equality.
Fields§
§qualifier: Option<Ident>The qualifier (a in a.x), if the reference was compound.
name: IdentThe column name (x in a.x, or in a bare x).
Implementations§
Source§impl ColRef
impl ColRef
Sourcepub fn bare(name: impl Into<String>) -> Self
pub fn bare(name: impl Into<String>) -> Self
Build a bare (unqualified) column reference by name.
Sourcepub fn from_expr(e: &Expr) -> Option<ColRef>
pub fn from_expr(e: &Expr) -> Option<ColRef>
Read a ColRef from a column-reference expression
(Identifier/CompoundIdentifier, seeing through a Nested wrapper).
Returns None for any expression that is not a column reference.
Sourcepub fn from_wrt_arg(func: &str, e: &Expr) -> Result<ColRef>
pub fn from_wrt_arg(func: &str, e: &Expr) -> Result<ColRef>
Parse the wrt argument of a marker: it must be a bare column
(Identifier/CompoundIdentifier), never an expression (F: the design
rejects grad(x*y, x+y)).
Sourcepub fn classify(&self, wrt: &ColRef, casing: IdentCasing) -> Match
pub fn classify(&self, wrt: &ColRef, casing: IdentCasing) -> Match
Classify an occurrence self against the differentiation variable
wrt under a folding policy — the whole of the ambiguity guard (F2).
The guard fires (returns Match::Ambiguous) only on an uncertain
occurrence of the wrt base name; a non-matching name is always
Match::Not, and a fully-qualified unambiguous match (e.g. a.x
against a.x) is Match::Is with no error.