Promise-based wrapper for mysqljs (node-mysql) providing convenience methods like query(), select(), insert(), update(), delete(), queryFile(), selectFile(), selectWhere(), insertMultiple(), insertIgnore(), insertUpdate(), and a middleware layer. Currently at version 5.0.0. It supports external SQL files, named bind parameters (like PDO), automatic LIMIT 1 result unwrapping, EJS-based SQL templates, and JS-to-SQL transforms. Unlike raw mysqljs, it is promise-based and includes retry logic for connections.
npm install mysql-chassisNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to import, create a connection, wait for success, and run a simple query using promises.
Check CHANGELOG for specific API changes; upgrade Node.js to >=10.
Use .then()/.catch() or async/await instead of callbacks.
Always explicitly provide password (even empty string) for clarity.
Ensure the sqlPath directory exists or set it explicitly with absolute path.
Use const MySQL = require('mysql-chassis').default;Set sqlPath to an existing directory containing .sql files (e.g., sqlPath: path.join(__dirname, 'sql'))
Verify DB_HOST, DB_USER, DB_PASS environment variables or constructor options