Complex SQL query builder library (v1.0.5) using ES6 tagged template literals. Enables building parameterized SQL queries with automatic placeholder substitution for PostgreSQL ($1, $2) and MySQL (?, ?). Ships as CommonJS with Node >=14 support. Key differentiator: supports nested template parts, raw values, custom join strings, and prepared statement naming. Lighter than knex but less feature-rich; focused on dynamic query composition for pg, mysql, mysql2, and sequelize.
npm install sql-template-builderNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Simple parameterized SELECT query using pg pool and sql-template-builder.
Use template literal backticks: sql`SELECT ${col}`.Only pass trusted strings to sql.raw(). For dynamic identifiers, prefer sql`${identifier}` (safely quoted).Use .setName() on the final query only; do not rely on placeholder order across multiple .setName() calls.
Replace CI with GitHub Actions; ignore badge.
Upgrade Node.js to >=14.0.0.
Use `const sql = require('sql-template-builder')` (CommonJS) instead of destructured import.Call .setName() only on the final query after all parts have been composed.