MCPcopy Create free account
hub / github.com/MaterializeInc/materialize / quote_identifier

Function quote_identifier

src/sql-server-util/src/lib.rs:948–953  ·  view source on GitHub ↗

Quotes the provided string using '[]' to match SQL Server `QUOTENAME` function. This form of quotes is unaffected by the SQL Server setting `SET QUOTED_IDENTIFIER`. See: - -

(ident: &str)

Source from the content-addressed store, hash-verified

946/// - <https://learn.microsoft.com/en-us/sql/t-sql/functions/quotename-transact-sql?view=sql-server-ver17>
947/// - <https://learn.microsoft.com/en-us/sql/t-sql/statements/set-quoted-identifier-transact-sql?view=sql-server-ver17>
948pub fn quote_identifier(ident: &str) -> String {
949 let mut quoted = ident.replace(']', "]]");
950 quoted.insert(0, '[');
951 quoted.push(']');
952 quoted
953}
954
955pub trait SqlServerCdcMetrics {
956 /// Called before the table lock is aquired

Callers 2

snapshotFunction · 0.70
build_snapshot_queryFunction · 0.50

Calls 3

replaceMethod · 0.45
insertMethod · 0.45
pushMethod · 0.45

Tested by 1

snapshotFunction · 0.56