Drizzle ORM Guide
Helps you model tables, write type safe queries and run safe migrations with Drizzle ORM in TypeScript.
Claude's review
7/10 Current Drizzle guidance with version decisions, relations v1 vs v2, generate-review-migrate workflow and a sharp anti-pattern table.
We asked Claude the question you would ask: would I be glad I installed this? Two separate reviews, the second blind to the first, must both rate a skill 7 or higher before we sell it.
In detail
Use when modeling data or querying with Drizzle ORM in TypeScript — `pgTable` schema in `.ts`, type-safe select/insert/relational queries, `drizzle-kit` migrations. NOT Prisma Client or `schema.prisma` (that is `prisma-orm`), NOT ORM-agnostic migration strategy (that is `db-migrations`), NOT Postgres engine tuning or EXPLAIN (that is `postgresdb`).
How you use it
- Add it to your pack, then download your pack (1 credit).
- In Claude, open Customize > Skills and upload the zip. Code execution needs to be on under Settings > Capabilities.
- Ask Claude for the job in your own words. It uses the skill when your request matches what it does. Step by step guide
Safety check
Nothing risky found: no hidden instructions, no download and run, no reading of saved passwords or keys.
An automated scan lowers risk but cannot promise zero risk. How we check skills
Preview
The first lines of SKILL.md
---
name: drizzle-orm
description: "Use when modeling data or querying with Drizzle ORM in TypeScript — `pgTable` schema in `.ts`, type-safe select/insert/relational queries, `drizzle-kit` migrations. NOT Prisma Client or `schema.prisma` (that is `prisma-orm`), NOT ORM-agnostic migration strategy (that is `db-migrations`), NOT Postgres engine tuning or EXPLAIN (that is `postgresdb`)."
tags: [drizzle, drizzle-orm, typescript-orm, drizzle-kit, sql, migrations, database, schema]
recommends: [prisma-orm, postgresdb, db-migrations, neon, sqlite-turso, planetscale, supabase, typescript, sql]
origin: risco
---
# Drizzle ORM — schema as code, type-safe queries, drizzle-kit migrations
Drizzle is the SQL-transparent TypeScript ORM: you declare tables in plain `.ts`, the query
builder emits SQL you can read, and there is no codegen client to regenerate. It runs in
edge/serverless runtimes. You own the schema, the queries, and the `drizzle-kit` workflow here —
the database engine, the ORM-agnostic migration *strategy*, and Prisma live in sibling skills.
## Decide first
Three decisions before you write a line. Each branches, so use the table.
| Decision | Pick | Why |
|---|---|---|
| Drizzle vs Prisma | Drizzle when you want SQL you can read, no codegen step, edge runtime | Prisma's generated client + `schema.prisma` DSL is the opposite trade — use `../prisma-orm/SKILL.md` if that is the ask |
| Version | `0.45.x` + `drizzle-kit@0.31.x` for production | npm `latest` is `drizzle-orm@0.45.2`; the 0.45 line has been `latest` since 2025-12-04 (checked 2026-06-02) |
| Version | `1.0.0-rc.x` (npm `rc` tag = `1.0.0-rc.3`, 2026-05-18) for a NEW edge-first project | v1 has moved past beta into release candidates with Relations v2 — close to stable, but still pin an exact rc and expect late API churn |
| Driver entrypoint | match it to your DB/host (see below) | Each driver has its own `drizzle-orm/<driver>` import and its own client |
Driver entrypoints (pick one; full matrix + edge caveats in `references/relations-and-drivers.md`):
`drizzle-orm/node-postgres`, `/postgres-js`, `/neon-http`, `/libsql` (Turso), `/planetscale-serverless`,
`/mysql2`, `/better-sqlite3`, `/bun-sqlite`.
## Install & config
```bash
npm i drizzle-orm
npm i -D drizzle-kit
npm i postgres # the driver client — here postgres-js; swap per your DB
```
`drizzle.config.ts` — the four keys `drizzle-kit` reads. The `dialect` here MUST match your table
helper (`pgTable` ⇒ `'postgresql'`), or migrations target the wrong SQL.
...From ericrisco's repository, MIT licence.
Related skills
-
Checked
Supabase auth and database
Builds with Supabase auth, database, storage and edge functions while avoiding common security traps.
8/101 credit -
Checked
AWS schema conversion
Runs AWS DMS Schema Conversion projects to move database schemas between engines and convert SQL to match.
7/101 credit -
Checked
Firebase Done Right
Builds Firebase apps with safe security rules, data models that scale and reliable Cloud Functions.
7/101 credit -
Checked
Google Workspace API Setup
Connects your server code to Gmail, Drive, Calendar and Sheets with safe service accounts and fewer quota errors.
7/101 credit -
Checked
Supabase Backend Security
Wires up Supabase auth, row level security, storage and realtime so your data stays private and queries stay fast.
8/101 credit -
Checked
NestJS API endpoints
Adds NestJS endpoints with proper validation, status codes and the traps that break startup fixed.
8/101 credit