mysql-qb (version 0.9.0) is a MySQL query builder for Node.js that simplifies constructing SELECT (with joins), INSERT, UPDATE, and DELETE queries programmatically without raw SQL. It can be used as a standalone builder to generate SQL strings suitable for the mysql driver, or as an executor that manages connections and returns Promises. The package is pre-1.0 and updated frequently, targeting Node.js 4.1.2 to 6.3, and is not stable. Its key differentiator is offering both building and executing with Promise-based async flows, contrasting with the callback-oriented mysql driver. No TypeScript support is provided.
npm install mysql-qbNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates both builder mode (generates SQL string) and executor mode (creates connection and returns Promise) for a SELECT query.
Pin to exact version in package.json and upgrade cautiously.
Use Node.js 6.3 or lower, or consider a maintained alternative like knex.
Ensure the connection is active or pass config object instead of connection.
Migrate to an actively maintained query builder like knex.
Always use .then() and .catch() on exec() calls, never mix with callbacks.
Run 'npm install mysql-qb@0.9.0 --save' and ensure Node version is 4.1.2–6.3.
Use 'var qb = require('mysql-qb');' then call qb.select(...).Start MySQL server, or provide correct host, port, user, and password in config.
Move connection.end() after the exec() promise resolves.