MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / quote_identifier

Function quote_identifier

nodedb-client/src/sql_escape/identifier.rs:9–12  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

7/// the SQL standard rule that PostgreSQL applies under
8/// `standard_conforming_strings=on`.
9pub(crate) fn quote_identifier(name: &str) -> String {
10 let escaped = name.replace('"', "\"\"");
11 format!("\"{escaped}\"")
12}
13
14#[cfg(test)]
15mod tests {

Callers 9

build_vector_search_sqlFunction · 0.85
document_get_implMethod · 0.85
document_put_implMethod · 0.85
document_delete_implMethod · 0.85
text_search_implMethod · 0.85
vector_insert_implMethod · 0.85
vector_delete_implMethod · 0.85

Calls 1

replaceMethod · 0.80

Tested by

no test coverage detected