Registry / database / tabel
library3.0.1jsnpmunverified

A simple ORM for PostgreSQL built over knex.js that works with plain JavaScript objects and arrays. v3.0.1 (latest) is the current stable version, with v2 maintained via `tabel@2`. It differentiates from other ORMs by its minimal abstraction, direct use of objects/arrays, and optional Redis/mysql support. Active development includes async scoper and dynamic query chains. Breaking changes in v3 include the replacement of `autoId` with `uuid` flag.

npm install tabel
INSTALL
IMPORT
SIG · TABEL
T
tabel
databasejavascriptv3.0.1
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

orm
✓ const orm = require('tabel');
✗ import orm from 'tabel';
CJS only, no ESM support
Model
✓ const { Model } = require('tabel');
✗ const Model = require('tabel').Model;
Model is a named export
scoperAsync
✓ const { scoperAsync } = require('tabel');
✗ import { scoperAsync } from 'tabel';
CJS only, scoperAsync added in v3

Connect to PostgreSQL via knex, define a model, and perform a create + find operation.

const tabel = require('tabel'); const knex = require('knex')({ client: 'pg', connection: process.env.DB_URL || 'postgres://localhost/mydb' }); const orm = tabel(knex); const user = orm.define('users', { id: { type: 'uuid', auto: true }, name: { type: 'string' } }); async function main() { await user.create({ name: 'Alice' }); const users = await user.find({}); console.log(users); } main().catch(console.error);
Debug
Known issues
breaking`autoId` flag replaced with `uuid` in v3
fix
Change column definition from `autoId: true` to `uuid: true`.
affects: >=3.0.0
deprecatedv3 is the active major version; v2 is only for existing users
fix
Upgrade to v3 via `npm install tabel@3` and update module imports accordingly.
affects: =2.x
gotchaNo ESM (ES module) support; package uses CommonJS only
fix
Use `require()` instead of `import`.
affects: >=1.0.0
gotchaRequires knex as a peer dependency; not bundled
fix
Install knex separately: `npm install knex`.
affects: >=1.0.0
Errors
Common errors & fixes
Module not found: Can't resolve 'tabel'
Tabel is CJS-only; using `import` in an ESM project
fix
Use `const tabel = require('tabel');` or configure bundler for CJS.
TypeError: tabel is not a function
Imported 'tabel' but forgot to call it with knex instance
fix
Ensure you call `tabel(knex);` to initialize the ORM.
Error: knex: Unknown client: pg
Missing PostgreSQL driver (pg) or knex client configuration
fix
Install pg: `npm install pg` and configure knex properly.
Upgrade
Version history
3.0.1latest on npm
Audit
Dependencies
knexrequiredcore query builder dependency
Agent activity
16 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
packagetabel ↗
tabel — npm install tabel · libregistry