A SQL query builder that normalizes parameter placeholders across different database dialects (MySQL, MSSQL, Oracle, PostgreSQL, SQLite, ODBC, Informix). It wraps the KnSQL class to use a unified '?' placeholder syntax while automatically adapting to each database's native parameter style. Version 1.0.27, requires Node >=20, ships TypeScript types. Key differentiator: it allows writing queries with a single placeholder format and then executes them against multiple database backends without rewriting. Dependencies on config and will-util modules for configuration.
npm install will-sqlNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to create a KnSQL query with named placeholders, set parameter values, obtain a DB connector, execute the query, and close the connection.
Upgrade Node.js to version 20 or later.
Install the required database driver explicitly (e.g., npm install mysql for MySQL).
Keep will-util version in sync with will-sql requirements.
Always use try/finally or wrap in connection pool management.
Create config/default.json with an appropriate DB alias entry.
Run: npm install will-util
Add a configuration object with key 'MYSQL' (or your alias) to config/default.json.
Use named import: import { KnSQL } from 'will-sql'Ensure the database is running and the connection URL in config/default.json is correct.