dabs is a MySQL query builder that wraps MySQL2 to provide a fluent API for constructing SQL queries (SELECT, INSERT, UPDATE, DELETE) with support for joins, aggregations, parameterized placeholders, and computed fields. Current version 0.0.32 is pre-1.0 with no fixed release cadence. Differentiates with a chainable syntax using field references via table aliases, automatic identifier quoting, and inline parameter binding via db._() placeholders. However, it is very early-stage, lacks comprehensive documentation, and may have breaking changes. Alternative libraries like knex or squel are more mature.
npm install dabsNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Connects to MySQL using a URL, builds a SELECT query with a parameterized WHERE clause, executes with bound parameters, and logs the result.
Pin exact version in package.json and review changelog after updates.
Use require('dabs') or use dynamic import() in ESM projects.Use await or .then().
Ensure placeholder names match exactly between db._('name') and exec({name: ...}).Always use table column methods (u.name) rather than raw strings for proper quoting and aliasing.
Run 'npm install dabs' and use 'const dabs = require('dabs');'Use await dabs.connect(...) or handle promise with .then(db => ...)
Verify placeholder name in query matches key in bind object.