db/sql_identifier.ts view source
(name: string): string import {assert_valid_sql_identifier} from '@fuzdev/fuz_app/db/sql_identifier.js'; Assert that a string is a valid SQL identifier.
Use this before interpolating table or column names into DDL queries
where parameterized placeholders ($1) are not supported.
name
the identifier to validate
stringreturns
string the validated identifier
throws
Error- if the identifier contains characters outside `[a-zA-Z0-9_]` or starts with a digit