DBQB v1.0.50 is a lightweight, TypeScript-first MySQL query builder for Node.js that generates parameterized SQL queries (SELECT, INSERT, UPDATE, DELETE, COUNT) using a simple JSON syntax. It supports complex WHERE/Having conditions including operators (>, <, BETWEEN, LIKE, IN, IS NULL), OR/AND nesting via Symbol('OR'), and raw string conditions. Unlike full ORMs like Sequelize or Knex, DBQB focuses solely on query generation without executing queries — you provide getTables/getFields callbacks. Released weekly on npm with TypeScript definitions. Current stable version: 1.0.50. Peer dependency: sequelize ^6.28.0 (only for type compatibility, not runtime).
npm install dbqbNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes DBQB with table/field introspection callbacks and generates a simple SELECT query.
Always provide both callback functions when instantiating DBQB.
Define the symbols once: const OR = Symbol('OR'); const AND = Symbol('AND'); and reuse them.Use a plain object literal for 'set', e.g., set: { nick: 'new' }.Upgrade to v1.0.0+ and await all query methods.
Ensure your callback returns objects matching the IFieldItem interface exactly.
Change to: import DBQB from 'dbqb'
Install sequelize: npm install sequelize. Ensure tsconfig.json has 'moduleResolution': 'node' and 'esModuleInterop': true.
Use a constant: const OR = Symbol('OR'); then use [OR]: {...}