Immutable MySQL query builder that produces parameterized queries compatible with mysqljs/mysql. Current stable version 4.1.0 (2023-10-09), releases are infrequent but stable. Unlike Knex, it is lightweight and allows raw SQL literals within clauses, with automatic parameter extraction via template literals. Ships TypeScript definitions. The library is designed for composability: base queries can be extended with conditional clauses without mutation.
npm install sql-concatNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows basic SELECT query building with WHERE clauses and parameterized values using the immutable builder.
Use Node >=6.
Always pass raw values (not pre-escaped) to the builder methods.
Always chain or reassign: query = query.where(...)
Pass a subquery builder directly (no .build()) when using .join() or .from().
Use ES import: import q from 'sql-concat'
Run npm install sql-concat and ensure your project is set up for ESM (e.g., "type": "module" in package.json).
Call .build() on the builder to get { sql, values }.Use tagged template literal: q`query string`
No dependency data recorded yet.