Skip to content

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.

ModelSource
sonnetpack: orm
Full Reference

┏━ 🔧 drizzle ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Use when working with Drizzle ORM — schema def… ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

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.

ItemValue
Install (ORM)npm i drizzle-orm
Install (CLI)npm i -D drizzle-kit
Config filedrizzle.config.ts
Push schemanpx drizzle-kit push
Generate migrationnpx drizzle-kit generate
Apply migrationnpx drizzle-kit migrate
Studio UInpx drizzle-kit studio
Introspect existing DBnpx drizzle-kit introspect
Key env varDATABASE_URL
I want to…File
Connect to Neon, Supabase, Turso, SQLite, or PlanetScalereference/setup.md
Define tables, columns, indexes, enums, and Zod validationreference/schema.md
Define one-to-many, one-to-one, or many-to-many relationsreference/relations.md
Run queries — findMany, findFirst, insert, update, delete, joinsreference/queries.md
Generate and apply migrations, push to dev, use Drizzle Studioreference/migrations.md
Use transactions and savepointsreference/transactions.md
Compare Drizzle vs Prisma and pick the right ORMreference/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.