Skip to main content

escape_identifier

Function escape_identifier 

Source
pub fn escape_identifier(identifier: &str) -> String
Expand description

Escapes a SQL identifier (table name, column name, etc.).

This is a convenience function that returns the escaped identifier as a String. For more efficient formatting, use SqlIdentifier directly in format strings.

ยงExample

use hyperdb_api_core::protocol::escape::escape_identifier;

assert_eq!(escape_identifier("table"), "table");
assert_eq!(escape_identifier("Segment"), "\"Segment\"");