MCPcopy
hub / github.com/BuilderIO/agent-native / isValidIdentifier

Function isValidIdentifier

packages/core/src/scripts/db/patch.ts:102–104  ·  view source on GitHub ↗

Only unquoted [A-Za-z_][A-Za-z0-9_]* identifiers are allowed — no spaces, * no quoting, no dotted names. This is deliberately strict: it stops the * agent from sneaking SQL into the table/column slots.

(s: string)

Source from the content-addressed store, hash-verified

100 * no quoting, no dotted names. This is deliberately strict: it stops the
101 * agent from sneaking SQL into the table/column slots. */
102function isValidIdentifier(s: string): boolean {
103 return /^[A-Za-z_][A-Za-z0-9_]*$/.test(s);
104}
105
106/** Reject WHERE clauses that could chain statements or hide DDL. This isn't
107 * a full SQL parser — just a keyword/character denylist to keep the surface

Callers 1

dbPatchFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected