Skip to main content

write_quoted_ident

Function write_quoted_ident 

Source
pub fn write_quoted_ident(buf: &mut impl Write, name: &str)
Expand description

Writes a SQL identifier enclosed in double quotes.

Any embedded " characters are doubled to prevent identifier-injection (CWE-89). Both PostgreSQL and SQLite accept "..." as a delimited identifier and treat "" as an escaped double-quote character inside such an identifier.

Fast path: identifiers with no embedded " are written with three calls (open quote, name, close quote). Only identifiers containing a " take the character-by-character escaping path.