Skip to content
kapil verma edited this page Jul 1, 2019 · 8 revisions

title: Home

tabel ORM

V2.6.14

tabel is an Object-Relational-Mapper for PostgreSQL, built over knex.js. tabel is an evolutionary leap in ORM architecture. I studied the activerecord-pattern by digging into the implementations of Eloquent, and rails' ActiveRecord, and some digging into TypeORM was done later just to compare it with tabel (PS: TypeORM is a datamapper-pattern ORM).

tabel is different from other ORMs in 8 ways.

  1. tabel doesn't require definition of column-types of each table in your schema. That particular abstraction breaks down as soon as you select extra columns in your result-set via joins or functions.
  2. With tabel, you focus on scoping down to the exact table you need to fetch, process, mutate, or cache data. And then you perform your desired operation.
  3. tabel enables the developer to think in terms of more than one orm object per project. For example; suppose a project's whole schema has 100 tables, with 4 modules, moduleOne with 10 tables, moduleTwo with 20 tables, moduleThree with 30 tables, and moduleFour with 40 tables, and no relations between tables across modules, you can work out your codebase with 4 different orm objects, one-per-module.
  4. In the setup described in #3, you have 4 different orm objects, one-per-module, and you can architect each module in such a way that a module never tries to reach for another module's orm object, and inter module interactions happen only through public-APIs of modules. You end-up with a brilliantly written, storage-agnostic domain-model in node.js this way.
  5. The setup described in #3 and further refined in #4 will last even as your db-size reaches TBs because each module can end-up having a separate db altogether. tabel is the first ORM that brings this sort of feature on the table, and does this only for node.js & postgres.
  6. Separate read/write databases connected via master-slave setup happens again very smoothly in a codebase which uses tabel ORM. Just define 2 different orm objects(for read & write DBs), and replace the orm object which is used for operations listed in mutating-data.
  7. tabel brings map and reduce functionalities to the developer's fingertips via the features detailed in processing-data, and this way, stand on it's own when being applied to cassandra-esque data-models in postgresql.
  8. tabel does away with model classes and focuses on providing you functions using which you can work with your database with plain JS objects and arrays. Hence, you can bring in libraries like lodash and ramda to fully leverage the freedom provided by tabel in node.js.

Hence, tabel is bound to change the way you think when working with relational databases.

Installation

  • Install tabel in your project via npm:
$ npm install --save tabel

Next > Philosophy

Clone this wiki locally