Search

Search pages, services, tech stack, and blog posts

schema.ts
Drizzle ORM
query.sql
Drizzle ORM

Drizzle ORM DatabaseTypeScript ORM that stays out of your way

Drizzle is our preferred ORM for TypeScript backends — it's SQL-first, generates correct queries, has zero runtime overhead, and never surprises you. Pairs perfectly with Postgres, MySQL, and SQLite.

Drizzle ORM is an SQL-first TypeScript ORM that compiles to exactly the SQL you'd write yourself — no magic, no hidden queries, no N+1 surprises. It provides full type inference from your schema definition, including selects, inserts, joins, and aggregations. Drizzle supports PostgreSQL, MySQL, and SQLite (including serverless variants like Neon, PlanetScale, Turso, and Cloudflare D1). Drizzle Kit handles schema migrations by generating SQL diffs you review before applying. It's the ideal ORM for developers who think in SQL and want type safety without abstraction overhead.

Quick start

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

# Create your schema in src/db/schema.ts
# Then generate and run migrations
npx drizzle-kit generate
npx drizzle-kit migrate

# Open Drizzle Studio
npx drizzle-kit studio

Read the full documentation at orm.drizzle.team/docs/overview

SQL-first schema

Define your schema in TypeScript — Drizzle generates the SQL you'd write yourself, no magic.

Full type inference

Select, insert, update, and join types inferred automatically — no manual type annotations.

Zero overhead queries

Drizzle compiles to raw SQL with no N+1 risk — what you write is exactly what hits the database.

Migration tooling

Drizzle Kit generates SQL migrations from your schema diff — review before applying, no surprises.

Edge-compatible

Works with Neon, Turso, Cloudflare D1, and PlanetScale — edge runtimes included.

Multi-database support

PostgreSQL, MySQL, SQLite, and their serverless variants — switch drivers without rewriting queries.

Why it's hard

Learning curve for SQL-first approach

Developers used to Prisma's schema-first model may find Drizzle's SQL-like API unfamiliar initially. The benefit is predictable query generation — what you write is what executes.

Ecosystem maturity

Drizzle's ecosystem (Studio, plugins, community packages) is younger than Prisma's. The core ORM is production-ready, but some auxiliary tooling is still evolving.

Relational query API complexity

Drizzle's relational query API (with) is powerful but can be tricky for deeply nested relations. For complex joins, the SQL-like query builder is often clearer.

Best practices

Define schemas in TypeScript files

Keep your Drizzle schemas in src/db/schema/ with one file per table — clear separation makes Drizzle Kit migrations predictable.

Use Drizzle Kit for migrations

drizzle-kit generate creates SQL migration files from your schema diff — always review the generated SQL before applying.

Prefer the SQL-like API for complex queries

Drizzle's select().from().where().join() API maps directly to SQL and gives you full control over the generated query.

Use $inferSelect and $inferInsert

Drizzle's inference utilities generate TypeScript types from your schema — no need to manually define types for your models.

Frequently asked questions



Want to build with Drizzle ORM?

Talk to our engineering team about your Drizzle ORM architecture. We'll respond within 24 hours.

1 spot available in May 2026Apr 2026 fully booked

We limit intake each month so every project gets the focus it deserves.