Skip to main content

quote_identifiers

Function quote_identifiers 

Source
pub fn quote_identifiers(
    expression: Expression,
    dialect: Option<DialectType>,
) -> Expression
Expand description

Quote identifiers that need quoting based on dialect rules.

Walks the entire AST recursively and sets quoted = true on any Identifier that:

  • contains special characters (anything not [a-zA-Z0-9_])
  • starts with a digit
  • is a SQL reserved word for the given dialect

The function takes ownership of the expression, mutates a clone, and returns the modified version.