ORM
Object-Relational Mapper
ELI5 — The Vibe Check
An ORM is like a translator between your code and your database. Instead of writing scary SQL, you just write normal code like User.findAll() and the ORM quietly converts it into SQL behind the scenes. It's the universal adapter between code-world and database-world.
Real Talk
An ORM is a library that maps database tables to programming language objects, allowing developers to interact with the database using their language's syntax instead of raw SQL. Popular ORMs include Prisma, Sequelize, TypeORM, SQLAlchemy, and ActiveRecord.
Show Me The Code
// Without ORM (raw SQL)
db.query('SELECT * FROM users WHERE id = ?', [1]);
// With ORM (Prisma)
const user = await prisma.user.findUnique({ where: { id: 1 } });
When You'll Hear This
"We're using Prisma as our ORM." / "The ORM handles all the SQL generation automatically."
Related Terms
Active Record
Active Record is an ORM pattern where each database row becomes an object that knows how to save itself.
Migration
A migration is a versioned script that modifies your database schema — adding a column, creating a table, changing a type.
Model
A model is the trained AI — the finished product.
Query Builder
A query builder lets you build database queries by chaining methods instead of writing raw SQL. It's like assembling a sentence with Lego blocks — `.
Schema
A database schema is the blueprint of your database — which tables exist, what columns they have, what types they are, and how they relate to each other.