squel is a flexible and powerful SQL query string builder for JavaScript, supporting SELECT, UPDATE, INSERT, and DELETE queries with method chaining. It works in Node.js and browsers, supports parameterized queries for safe value escaping, and can be customized for any SQL command. Version 5.12.5 is the latest stable release. It is lightweight (~7 KB min+gzip) and actively maintained on GitHub, though the maintainer suggests considering more actively developed alternatives like Knex. Squel includes support for MySQL-specific commands and auto-quoting of field names. It ships TypeScript types and runs on Node >= 0.12.0.
npm install safe-squelNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Builds a SELECT query and a parameterized query using method chaining.
Pass { autoQuoteFieldNames: true } to squel.select() or the constructor.Use squel.str() inside the where clause with ? placeholders: .where('col = ?', squel.str('RANGE(?, ?)', a, b)).Migrate to Knex or another actively maintained query builder.
Pass the squel instance directly, e.g., .from(squel.select().from('students'), 's').Use .order('col', true, 'DESC') or .order('col', null, 'DESC') properly.Add 'import squel from "squel"' (ESM) or 'const squel = require("squel")' (CJS) at the top of your file.Use 'import squel from "squel"' (default import) or 'const squel = require("squel")' (CommonJS).Run 'npm install squel' to install it.
Pass a positive integer to .limit() (e.g., .limit(10)).
No dependency data recorded yet.