MCPcopy
hub / github.com/chartdb/chartdb / quoteIfNeeded

Function quoteIfNeeded

src/lib/data/sql-export/export-sql-script.ts:114–120  ·  view source on GitHub ↗
(name: string)

Source from the content-addressed store, hash-verified

112
113 // Only add quotes if needed and not already quoted
114 const quoteIfNeeded = (name: string) => {
115 if (isAlreadyQuoted(name)) {
116 return name;
117 }
118 const needsQuoting = /[^a-zA-Z0-9_]/.test(name) || isDBMLFlow;
119 return needsQuoting ? `"${name}"` : name;
120 };
121
122 if (table.schema) {
123 const quotedSchema = quoteIfNeeded(table.schema);

Callers 1

getQuotedTableNameFunction · 0.85

Calls 1

isAlreadyQuotedFunction · 0.85

Tested by

no test coverage detected