Generate SQL queries and Express REST routes from JavaScript objects. Version 1.6.1 provides sqlFind, sqlCreate, sqlUpdate, sqlDelete, sqlPopulate helpers for PostgreSQL (pg) with support for joins, sorting, pagination, OR/AND searches, wildcards, and debug mode. Also includes createSqlRestRoutesServerless for serverless Next.js/Vercel endpoints and Express route generation. Differentiator: minimal configuration, wraps raw SQL generation with option-based filtering, and supports serverless deployment out of the box.
npm install sql-wizardNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows sqlCreate, sqlFind with OR search, and debug mode for generating SQL queries.
Move these parameters to the fourth argument (options) of sqlFind and similar functions.
Add more specific conditions or use `any: false` for AND behavior.
Use ILIKE or LOWER() in custom queries if case-insensitive search is needed.
Use ES module imports (import { sql } from 'sql-wizard') instead of require.Use: import { sql } from 'sql-wizard';
const { sqlFind } = sql;Set DATABASE_URL environment variable to a valid PostgreSQL connection string, e.g., postgres://user:pass@host:5432/db
Use { limit: 10 } (number) instead of { limit: '10' }.