Drizzle Orm
GitHub RepoImpressions64
View on GitHub
@githubprojectsPost Author

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, offset. There's no ORM-specific jargon to learn.

How to Try It

The fastest way to get started is with a fresh project:

npm install drizzle-orm
npm install -D drizzle-kit

Then define your schema and connect to your database. For a full example, check out the official docs or clone the GitHub repo.

If you want to see a real project, the repo has examples for PostgreSQL with Express, SQLite with better-sqlite3, and MySQL with mysql2.

Final Thoughts

Drizzle isn't trying to replace SQL or abstract it away. It's trying to make SQL feel at home in TypeScript. If you're tired of ORMs that do too much or raw SQL that does too little, this might be your sweet spot.

Is it the right choice for every project? Probably not. But for TypeScript backend work where you want control without the ceremony, Drizzle is refreshingly pragmatic. No magic, just typed SQL that reads like SQL.


Found this interesting? Follow @githubprojects on Twitter for more dev tools and insights.

Back to Projects
Last updated: June 1, 2026 at 05:30 AM