FaasJS
Home
  • Guide
  • Documents
  • Templates
  • Changelog
  • Ecosystem

    • Docker Images
  • Github
  • Contributing
  • Sponsor
  • Security
Home
  • Guide
  • Documents
  • Templates
  • Changelog
  • Ecosystem

    • Docker Images
  • Github
  • Contributing
  • Sponsor
  • Security

Documents / @faasjs/pg / escapeIdentifier

Function: escapeIdentifier()

escapeIdentifier(identifier): string

Escapes a SQL identifier, preserving trusted RawSql fragments.

Dotted identifiers are escaped segment by segment, * and COUNT(*) are preserved for query-builder output, and non-string values throw before SQL is generated.

Parameters

identifier

string | RawSql

Table name, column name, dotted identifier, or trusted raw fragment.

Returns

string

Escaped identifier string ready to be embedded into SQL text.