SQL identifier escaping. Quote a SQL identifier (collection / column name) by doubling any internal double-quotes and wrapping the result in double-quotes — the SQL standard rule that PostgreSQL applies under `standard_conforming_strings=on`.
(name: &str)
| 7 | /// the SQL standard rule that PostgreSQL applies under |
| 8 | /// `standard_conforming_strings=on`. |
| 9 | pub(crate) fn quote_identifier(name: &str) -> String { |
| 10 | let escaped = name.replace('"', "\"\""); |
| 11 | format!("\"{escaped}\"") |
| 12 | } |
| 13 | |
| 14 | #[cfg(test)] |
| 15 | mod tests { |
no test coverage detected