assertSafeTable
assertSafeTable(
table,purpose,example):string
Defined in: packages/pipeline/src/helpers/postgres-table.ts:25
Refuses a table name that is not safe to interpolate into SQL text.
A table name cannot be a query parameter, so a Postgres store writes it into
the statement. Only table or schema.table made of unquoted identifiers
(letters, digits and _, not starting with a digit) passes.
Parameters
Section titled “Parameters”string
Table name from the store options, optionally schema-qualified.
purpose
Section titled “purpose”string
What the table holds, for the error message (e.g. 'audit').
example
Section titled “example”string
A valid table name for the error message (e.g. 'audit_log').
Returns
Section titled “Returns”string
table, unchanged.
Throws
Section titled “Throws”Error when table is not a safe identifier.