Skip to content

basalt / search-postgres/src / assertValidTableName

Function: assertValidTableName() ​

> assertValidTableName(table): string

Defined in: search-postgres/src/index.ts:74

Validate a table name before it is string-interpolated into DDL/DML. The table name is a configuration-time identifier (never request input), but a developer wiring it from an external value would otherwise have a SQL injection. Accepts a bare identifier or a schema.table pair, each part a valid identifier. Returns the (unchanged) name so it can be used inline.

Parameters ​

table ​

string

Returns ​

string

Released under the MIT License.