Comparison

MasterRecord vs Active Record

Active Record set the standard for productive ORMs. MasterRecord brings the same code-first models, migrations, and associations to Node — plus a lambda-based query language and a choice of Active-Record or Entity-Framework styles.

At a glance

Feature by feature

FeatureMasterRecordActive Record
LanguageJavaScriptRuby
Model definitionCode-first builder methodsSchema + model class
Migrations
AssociationsbelongsTo / hasMany / hasOne / throughbelongs_to / has_many / through
Query styleLambda + $$ paramsChainable + hash conditions
Save stylesActive Record + Entity FrameworkActive Record
DatabasesSQLite, MySQL, PostgresSQLite, MySQL, Postgres, +
Callbacks/hooksbeforeSave / afterSave / etc.before_save / after_save / etc.
Transformers.set() / .get()serialize / attribute
Show me the code

The same task, side by side

MasterRecord
MasterRecord
class Post {
  id(db)    { db.integer().primary().auto(); }
  title(db) { db.string(); }
  User(db)  { db.belongsTo('User'); }
}

const posts = await db.Post
  .where((p) => p.title.like($$), 'Hello%')
  .toList();
Active Record
Active Record
class Post < ApplicationRecord
  belongs_to :user
end

posts = Post.where("title LIKE ?", "Hello%").to_a
The verdict

Which should you choose?

Choose MasterRecord if you're building on Node and want Active-Record ergonomics with a typed-friendly lambda query language.

Choose Active Record if you're in Rails — Active Record is the native, deeply-integrated choice.