Comparison
MasterRecord vs TypeORM
TypeORM models entities with decorators and metadata reflection. MasterRecord uses plain builder methods — no decorators, no experimental flags — with a lambda query language and code-first migrations.
At a glance
Feature by feature
| Feature | MasterRecord | TypeORM |
|---|---|---|
| Entity definition | Builder methods | Decorators + metadata |
| Decorators required | ||
| experimentalDecorators | ||
| Query style | Lambda + $$ params | Repository + QueryBuilder |
| Migrations | Code-first diffing | Generate + run |
| Active Record + Data Mapper | AR + EF styles | AR + Data Mapper |
| Databases | SQLite, MySQL, Postgres | Many |
| Pure ESM | CJS/ESM with config |
Show me the code
The same task, side by side
MasterRecord
MasterRecord
class User {
id(db) { db.integer().primary().auto(); }
name(db) { db.string(); }
Posts(db) { db.hasMany('Post'); }
}
const users = await db.User.where((u) => u.name.like($$), 'A%').toList();TypeORM
TypeORM
@Entity()
class User {
@PrimaryGeneratedColumn() id: number;
@Column() name: string;
@OneToMany(() => Post, (p) => p.user) posts: Post[];
}
const users = await repo.find({ where: { name: Like('A%') } });The verdict
Which should you choose?
Choose MasterRecord if you prefer decorator-free, plain-class models with code-first migrations and a lambda query language.
Choose TypeORM if you want decorator-based entities and the Data Mapper pattern with a broad database matrix.