#[non_exhaustive]pub enum IdentCasing {
FoldUnquoted,
FoldUnquotedUpper,
FoldAll,
FoldNone,
}Expand description
How a dialect folds identifiers for case-insensitive comparison.
SQL unquoted identifiers are case-insensitive, so grad(Temp*Temp, temp)
must match — otherwise it silently differentiates to 0. The exact rule is
per-dialect (F1):
IdentCasing::FoldUnquoted— unquoted identifiers fold to lowercase; quoted identifiers keep their case. (DataFusion, Postgres, the generic dialect.)IdentCasing::FoldUnquotedUpper— the same rule with the opposite target case: unquoted identifiers fold to uppercase. (Snowflake, Oracle.)IdentCasing::FoldAll— all identifiers fold, quoted included, so case never distinguishes two columns. (DuckDB, Spark, MySQL.)IdentCasing::FoldNone— no identifier folds;xandXare simply different columns. (ClickHouse.)
The two unquoted-only policies are not interchangeable, and the difference is
visible rather than cosmetic: X matches "X" under FoldUnquotedUpper and
"x" under FoldUnquoted. Applying the wrong one to Snowflake does not just
miss — it can match the other column and return a confidently wrong
nonzero derivative.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
FoldUnquoted
Fold unquoted identifiers to lowercase (DataFusion / Postgres / generic).
FoldUnquotedUpper
Fold unquoted identifiers to uppercase (Snowflake / Oracle).
FoldAll
Fold every identifier, quoted included (DuckDB / Spark / MySQL).
FoldNone
Fold nothing; identifiers are compared as written (ClickHouse).
Implementations§
Source§impl IdentCasing
impl IdentCasing
Sourcepub fn fold(self, id: &Ident) -> String
pub fn fold(self, id: &Ident) -> String
The comparison key for a single identifier under this policy.
Only equality of the returned keys is meaningful — which case they fold to is arbitrary, so long as an unquoted identifier and a quoted one land on the same key exactly when the engine would resolve them to the same column.
Trait Implementations§
Source§impl Clone for IdentCasing
impl Clone for IdentCasing
Source§fn clone(&self) -> IdentCasing
fn clone(&self) -> IdentCasing
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more