sql-filter-builder is a lightweight, type-safe SQL filter/query builder for Node.js and TypeScript (current version: 1.0.15). It provides a simple API to dynamically build parameterized SQL queries with filters, orders, and aggregations, preventing SQL injection. Built with zero dependencies and full TypeScript support, it works with any SQL stack (Sequelize, Postgres, MySQL, SQLite). Its release cadence is low; the package has only a few versions. Key differentiators include its minimal footprint, no runtime dependencies, and an expressive API similar to ORM query builders.
npm install sql-filter-builderNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Builds a parameterized SQL query with a single equality filter and outputs the SQL string and bound values.
Use Operator.Eq from the package instead of comparing with raw strings.
Always provide a filters array (empty array allowed) in the params object.
Use the second returned object (values) as replacements for your query interface (e.g., Sequelize's replacements option).
Run 'npm install sql-filter-builder' and ensure your import path is correct.
Ensure each filter in the array includes key (string), operator (Operator enum), and value.
Use 'import { Operator } from 'sql-filter-builder'' instead of require or wrong import path.No dependency data recorded yet.