An ESM template tag function for building parameterized PostgreSQL queries compatible with node-postgres (pg). Version 0.1.2 is stable, but the package is in maintenance mode with no active development. It provides nesting, reusable query fragments, and a .join helper, which differentiates it from raw string interpolation or other query builders by safely separating SQL text from values.
npm install pg-template-tagNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic usage: import, build a parameterized query with template literal, and execute via node-postgres.
Use SQL.join or clone fragments if you need independent parameter positions.
Switch to import syntax or use dynamic import.
Consider alternatives like slonik, squel, or raw pg parameterization.
Use import SQL from 'pg-template-tag' or enable ESM in your project.
Use import SQL from 'pg-template-tag' (no braces).
Ensure default import: import SQL from 'pg-template-tag'.