Build SQL queries from JSON objects with a MongoDB-like syntax. Current version 1.0.26 is in active development with support for ANSI-SQL, MySQL, and PostgreSQL dialects. The library generates parameterized SQL strings and value arrays, supporting SELECT, INSERT, UPDATE, DELETE, CREATE, JOINs, subqueries, and PostgreSQL JSON helpers. Key differentiator: enables dynamic query construction from JSON configurations, similar to Mongo query language.
npm install json-sql-builderNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates building a SELECT query with column aliases, aggregation, WHERE conditions, and GROUP BY using the MySQL dialect.
Ensure all operators like $select, $from, $where, $sum, $in, $gte, $column are written with a preceding $.
Use require('json-sql-builder') instead of import.Update your query format to match the new CREATE INDEX syntax documented in the release notes.
Review the documentation for CREATE VIEW usage; CREATE TABLE may not be supported.
Use the correct dialect (e.g., 'postgresql') or refer to the docs for dialect-specific placeholder syntax.
Use const SQLBuilder = require('json-sql-builder'); and create an instance.Prefix all operators with $, e.g., $select, $from, $where.
No dependency data recorded yet.