MCPcopy Create free account
hub / github.com/TanStack/db / quoteIdentifier

Function quoteIdentifier

packages/electric-db-collection/src/sql-compiler.ts:86–92  ·  view source on GitHub ↗

* Quote PostgreSQL identifiers to handle mixed case column names correctly. * Electric/Postgres requires quotes for case-sensitive identifiers. * @param name - The identifier to quote * @param encodeColumnName - Optional function to encode the column name before quoting (e.g., camelCase to snake_

(
  name: string,
  encodeColumnName?: ColumnEncoder,
)

Source from the content-addressed store, hash-verified

84 * @returns The quoted identifier
85 */
86function quoteIdentifier(
87 name: string,
88 encodeColumnName?: ColumnEncoder,
89): string {
90 const columnName = encodeColumnName ? encodeColumnName(name) : name
91 return `"${columnName}"`
92}
93
94/**
95 * Compiles the expression to a SQL string and mutates the params array with the values.

Callers 1

compileBasicExpressionFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected