Drizzle ORM: Lightweight SQL with TypeScript Zen
If you've ever wrestled with an ORM that feels like it's fighting you every step of the way, you're not alone. Most ORMs either hide too much SQL (making debugging painful) or expose so little that you're basically writing raw queries anyway.
Drizzle ORM tries a different approach. It's a TypeScript-first SQL toolkit that lets you write queries using pure SQL-like syntax, but with full type safety and zero magic. No hidden queries, no implicit joins you didn't ask for. What you write is what runs against your database.
What It Does
Drizzle is a lightweight ORM (or maybe "query builder with ORM features" is more accurate) for TypeScript and JavaScript. It supports PostgreSQL, MySQL, and SQLite out of the box. You define your schema once using TypeScript, and Drizzle infers types for everything — from migration files to runtime query results.
Instead of complex model classes or decorators, you define tables as plain TypeScript objects. A typical schema looks like this:
import { pgTable, serial, text } from 'drizzle-orm/pg-core'; export const users = pgTable('users', { id: serial('id').primaryKey(), name: text('name'),
});
Then you query with an SQL-like chain:
const result = await db.select().from(users).where(eq(users.name, 'Alice'));
No .find(), no .where() magic strings. It's SQL written in TypeScript.
Why It's Cool
Type safety without runtime overhead. Drizzle maps your database schema to TypeScript types at build time. When you query, the results are typed automatically. No as User casting needed.
No magic, no hidden queries. Every query you write is explicit. If you write a join, you see the join. If you write a subquery, it's right there. This makes debugging and performance tuning straightforward.
Migrations that make sense. Drizzle Kit (the CLI companion) generates SQL migration files from your schema changes. No internal state, no hidden migration tables — just plain SQL files you can review, modify, and commit.
Small footprint. The core package is around 7KB gzipped. No bloated dependencies, no runtime reflection. It works with Node.js, Deno, and Bun.
SQL-like fluency. If you know SQL, you already know Drizzle. The API mirrors SQL syntax: select, from, where, join, groupBy, orderBy, limit,