dbTabla is a high-level abstract interface for generating and executing SQL queries compatible with MySQL, SQLite3, and PostgreSQL. It provides a unified JavaScript API for CRUD operations, model management, and structural metadata inspection across different SQL engines. The current stable version is 2.2.10, released on npm with a monthly release cadence. Key differentiators: fluent insertion syntax, support for both positional and object-based query building, built-in SQL injection prevention via `__escapeString`, and model loading from directories. Requires Node >=18.0.0 and manual implementation of driver-specific methods (query, escape, schema introspection), making it an abstraction layer rather than an ORM.
npm install dbtablaNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to extend the Connect class with a MySQL adapter, instantiate it, and perform an insert operation using the fluent API.
Use import statements. If you must use CommonJS, downgrade to v1.x or use dynamic import().
Replace import { connect } with import { Connect }.Always pass defined values. Use conditional checks before calling insert().
Ensure your __keysInTable implementation uses the exact property name 'colums' (no 'n').
Upgrade Node.js to version 18 or later.
Use import or convert your project to ESM (add 'type':'module' to package.json, or use .mjs extension).
Ensure you subclass Connect and provide the required methods (query, __escapeString, __keysInTable).
Add __keysInTable method to your subclass that returns a promise with the correct schema object.
Run 'npm install mysql' if using MySQL adapter.