Skip to content

Function: assertValidSqlIdentifier() ​

ts
function assertValidSqlIdentifier(identifier, fieldName): void;

Defined in: sqlite/src/ddl/internal/open-sqlite-connection.ts:20

Validates that identifier matches ^[A-Za-z_][A-Za-z0-9_]*$.

Throws an actionable error if identifier is empty or contains unsafe characters.

Parameters ​

ParameterTypeDescription
identifierstringCandidate SQL table or column identifier.
fieldNamestringDiagnostic field label included in thrown errors.

Returns ​

void

Returns nothing when identifier is valid.

Released under the MIT License.