Query builder for MySQL databases in Node.js, providing a fluent interface for constructing SQL queries including SELECT, INSERT, UPDATE, DELETE, JOIN, WHERE conditions, ORDER BY, GROUP BY, LIMIT, and OFFSET. Current stable version is 1.6.1, last updated in 2018. Connects using the mysql module and protects against SQL injection. Key differentiators: simple API, supports chaining, and provides query model methods like add, getFirst, getLast, getAll, findById, findFields. However, the package appears unmaintained with no recent updates, and relies on outdated Node.js engine requirements (>= 6.0.0).
npm install mysql-qbuilderNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates setup with environment variables, connection, query building with select, from, where, orderBy, limit, and execution via prepare().getResult().
Use Node.js 10+ for compatibility; consider using a maintained query builder like knex.
Audit dependencies or switch to a maintained alternative. Use npm audit to check for issues.
Use the exact option keys as shown in the documentation: hostname, username, password, database.
Use .prepare().getResult().then(...) or await qBuilder.prepare().getResult() instead of calling getResult() directly.
Ensure clauses are called in the correct order (e.g., select before from, where before orderBy).
Update to version >=1.5.1 or if using older version, call .getResult() directly without .prepare().
Call qBuilder.setOptions({...}) with appropriate connection details before connecting.Verify hostname, username, password, and database in setOptions. Ensure MySQL server is running.
Use const qBuilder = require('mysql-qbuilder') and ensure the module is installed.