drizzle
Use when working with Drizzle ORM — schema definition, queries, migrations, or database integration. Also use when choosing between Drizzle and Prisma, or setting up Drizzle with Neon, Supabase, PlanetScale, or Turso.
| Model | Source |
|---|---|
| sonnet | pack: orm |
Full Reference
┏━ 🔧 drizzle ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Use when working with Drizzle ORM — schema def… ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Drizzle ORM
Section titled “Drizzle ORM”Drizzle is a headless TypeScript ORM — ~31KB, zero binary deps. SQL-familiar API means if you know SQL, you know Drizzle. Two query styles: SQL-like Select API and relational Query API. Best choice for serverless and edge deployments.
Quick Reference
Section titled “Quick Reference”| Item | Value |
|---|---|
| Install (ORM) | npm i drizzle-orm |
| Install (CLI) | npm i -D drizzle-kit |
| Config file | drizzle.config.ts |
| Push schema | npx drizzle-kit push |
| Generate migration | npx drizzle-kit generate |
| Apply migration | npx drizzle-kit migrate |
| Studio UI | npx drizzle-kit studio |
| Introspect existing DB | npx drizzle-kit introspect |
| Key env var | DATABASE_URL |
Reference Index
Section titled “Reference Index”| I want to… | File |
|---|---|
| Connect to Neon, Supabase, Turso, SQLite, or PlanetScale | reference/setup.md |
| Define tables, columns, indexes, enums, and Zod validation | reference/schema.md |
| Define one-to-many, one-to-one, or many-to-many relations | reference/relations.md |
| Run queries — findMany, findFirst, insert, update, delete, joins | reference/queries.md |
| Generate and apply migrations, push to dev, use Drizzle Studio | reference/migrations.md |
| Use transactions and savepoints | reference/transactions.md |
| Compare Drizzle vs Prisma and pick the right ORM | reference/drizzle-vs-prisma.md |
Usage: Read the reference file matching your current task from the index above. Each file is self-contained with code examples and inline gotchas.