json-sql-builder2 v1.0.24 is a query builder that translates JSON data structures into SQL queries. It supports multiple SQL dialects including MySQL, MariaDB, PostgreSQL, SQLite, Oracle, and Microsoft SQL Server. Its key differentiator is the ability to define queries entirely in JSON, making dynamic query construction easier and more readable compared to traditional string concatenation. It automatically manages parameterized queries to prevent SQL injection. The library is actively maintained with frequent releases.
npm install json-sql-builder2No compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a SQLBuilder instance for MySQL, builds a SELECT query with aggregation and WHERE clause using JSON, and logs the generated SQL and parameterized values.
Use require('json-sql-builder2') instead.Use $where without empty logical operators, or ensure arrays have at least one condition.
Use backtick-quoted keys or set the 'quoteIdentifiers' option to true.
Use $json operator or stringify manually before passing.
Use new SQLBuilder('PostgreSQL') with exact casing.Run: npm install json-sql-builder2
Use: var sql = new SQLBuilder('MySQL'); then sql.$select(...);Pass a JavaScript object, not JSON.parse().
No dependency data recorded yet.