MCPcopy Index your code
hub / github.com/simstudioai/sim / sanitizeSingleIdentifier

Function sanitizeSingleIdentifier

apps/sim/app/api/tools/postgresql/utils.ts:123–133  ·  view source on GitHub ↗
(identifier: string)

Source from the content-addressed store, hash-verified

121}
122
123function sanitizeSingleIdentifier(identifier: string): string {
124 const cleaned = identifier.replace(/"/g, '')
125
126 if (!/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(cleaned)) {
127 throw new Error(
128 `Invalid identifier: ${identifier}. Identifiers must start with a letter or underscore and contain only letters, numbers, and underscores.`
129 )
130 }
131
132 return `"${cleaned}"`
133}
134
135export async function executeInsert(
136 sql: any,

Callers 1

sanitizeIdentifierFunction · 0.70

Calls 2

testMethod · 0.80
replaceMethod · 0.65

Tested by

no test coverage detected