A template tag for writing elegant parameterized SQL queries using ES2015 tagged template literals. Current stable version is 1.0.1, with a maintenance-only release cadence. It outputs a structured object with the SQL query string and its values, directly compatible with pg, mysql, mysql2, and sequelize (via sequelize-sql-tag). Key differentiators: lightweight, zero dependencies, framework-agnostic, but does not provide escaping safety. Last released in 2018.
npm install sql-tagNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Create a parameterized SQL query with a template tag and use it with pg.
Always use parameterized queries via the sql tag; never interpolate raw strings into the template literal.
Consider using a more actively maintained library like squel or knex.
Run 'npm install sql-tag' and ensure import path is correct.
Use 'import sql from 'sql-tag'' or 'const sql = require('sql-tag')'.No dependency data recorded yet.