SQL generation using ES6 tagged template strings. Provides safe parameterization and escaping for mysql, mysql2, and postgres drivers. Current version 1.1.0 is stable with no recent updates. Key differentiators: native template literal syntax, automatic value interpolation, built-in helpers for WHERE, SET, VALUES, raw/identifier escaping, and spread arrays. Lightweight with zero dependencies. Comparable to sql-template-strings but with a more concise API and fewer features.
npm install sqltagNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows ESM import, parameter interpolation, helpers (values, spread), and usage with mysql2.
For mysql/mysql2, pass the tag result directly: connection.query(SQL`...`); For pg, same.
Use import syntax or dynamic import: const SQL = (await import('sqltag')).default;Consider alternatives like sql-template-strings or @databases/sql for active maintenance.
Only use SQL.raw() with trusted strings; never with user input.
Use default import: import SQL from 'sqltag';
Use import SQL from 'sqltag'; or const SQL = require('sqltag').default;No dependency data recorded yet.