MCPcopy Create free account
hub / github.com/bytebase/bytebase / wrapSQLIdentifier

Function wrapSQLIdentifier

frontend/src/utils/v1/sql.ts:150–170  ·  view source on GitHub ↗
(id: string, engine: Engine)

Source from the content-addressed store, hash-verified

148};
149
150const wrapSQLIdentifier = (id: string, engine: Engine) => {
151 if (engine === Engine.MSSQL) {
152 return `[${id}]`;
153 }
154 if (
155 [
156 Engine.POSTGRES,
157 Engine.SQLITE,
158 Engine.SNOWFLAKE,
159 Engine.ORACLE,
160 Engine.REDSHIFT,
161 Engine.COCKROACHDB,
162 Engine.CASSANDRA,
163 Engine.TRINO,
164 ].includes(engine)
165 ) {
166 return `"${id}"`;
167 }
168
169 return "`" + id + "`";
170};
171
172const generateSchemaAndTableNameInSQL = (
173 engine: Engine,

Calls

no outgoing calls

Tested by

no test coverage detected