Skip to main content

identifier_needs_quotes

Function identifier_needs_quotes 

Source
pub fn identifier_needs_quotes(name: &str) -> bool
Expand description

True when name must be backtick-quoted to round-trip as a Cypher name.

The DDL / canonical identifier-quoting policy: a name is bare only when it has the plain identifier shape (relate_model::identifier::has_plain_identifier_shape) and lookup_keyword does not classify it as a keyword.

Keyword names need quotes even in positions that accept them bare (a property key after ., a label or relationship type per ADR-0169) because the same spelling is a keyword in the positions that call TokenType::is_ident_like — a variable, alias, map key, or the ON (n.prop) property name of CREATE INDEX — so the unquoted form would not parse everywhere. Quoting every keyword keeps one rendered statement runnable in every position instead of deciding per site.