A minimal, dependency-free JavaScript/TypeScript library for assembling complex SQL queries using template literals. Version 1.0.3, MIT licensed. It returns an object compatible with popular database clients (pg, mysql, mysql2, sequelize, oracledb) by providing multiple query string representations (?, $1, :1 placeholders). Inspired by classNames, it uses tagged template functions (qb.t) for safe value interpolation. Ships TypeScript types, supports Deno, and has zero dependencies. Experimental helper functions (qb.set, qb.values, qb.in) for SET, VALUES, and IN clauses.
npm install sql-string-qbNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Builds a parameterized SQL query using tagged template literal for safe value interpolation, returns an object with multiple placeholder formats.
Always wrap interpolated values in qb.t`...` to use parameterized queries.
Avoid qb.unescaped with user-supplied values; manually escape or use only for trusted data.
Pin version if using experimental helpers; check for updates on breaking changes.
Use ESM: import qb from 'sql-string-qb'
Run: npm install sql-string-qb
No dependency data recorded yet.