1. Simpler syntax (converts objects to SQL queries under the hood)

notion image

2. Abstraction that lets you flip the database you are using. Unified API irrespective of the DB

notion image

3. Type safety/Auto completion

notion image

4. Automatic migrations

In case of a simple Postgres app, itโ€™s very hard to keep track of all the commands that were ran that led to the current schema of the table.

notion image

CREATE TABLE users (
    id SERIAL PRIMARY KEY,
    name VARCHAR(100),
    email VARCHAR(100) UNIQUE NOT NULL
);

ALTER TABLE users
ADD COLUMN phone_number VARCHAR(15);

As your app grows, you will have a lot of these CREATE and ALTER commands.

ORMs (or more specifically Prisma) maintains all of these for you.

For example - https://github.com/abhishekraut01/DailyCode/blob/main/Databases/Design_Darabase_basic/prisma/migrations/20251023220841_init/migration.sql