A hackable, ActiveRecord-like ORM for nodejs
There are currently a hand full of nodejs ORMs available - but there is no one with a nice syntax similar to ActiveRecord (Ruby).
OpenRecord has a nice syntax, a ton of features, over 1300 unit tests and could be extended easily!
- SQLite3, MySQL, Postgres, REST and LDAP (+ ActiveDirectory) support
- Runs on Node v4 up to v6
- Async schema definition: You could even change your model definition temporarily
- Optional Fibers support
- Automatic field definition loading (SQL): You don't need to define your database fields twice! OpenRerecord will automatically load your schema definition
- Relations (hasMany, hasOne, belongsTo with through, polymorph, cross-store)
- Nested Cascade delete
- Nested Eager Loading
- Nested Creates
- Nested Updates
- Nested Joins
- Scopes: Makro like methods
- Before and After Hooks: For validation, find, create, update, destroy and some more...
- Chaining: Everything is chainable!
- Migrations: SQL Migrations are build in
- Plugin support: In fact 99% of OpenRecord is a plugin
- Build-In SQL plugins:
- stampable: automatically set
- paranoid: Soft delete of records
- nested set: Build trees easily
- sorted list: Don't worry about lists
- ... with more than 1300 tests
var OpenRecord = ;
var sqlite =
Synchronous (via fibers)
Cross store relations
var sqlite =
If you've found a bug please report it via the issues page. Please make sure to add a unit test with the bug report!
Before submit pull request make sure all tests still passed.