mcpField
D
drizzle-orm

drizzle-orm

github.com/dobroslavradosavljevicDevelopment344 installsUpdated 2d ago
Repository

About drizzle-orm

The drizzle-orm skill supports developers using Drizzle 1.0 release candidates, including drizzle-kit, drizzle-seed, validators, and Effect drivers. It covers version alignment, schemas and queries, migrations, and verification, with guidance specific to the RC line.

Key features

  1. 01Check ORM, Kit, and Seed versions
  2. 02Guide schema definitions and SQL queries
  3. 03Explain RQBv2 relational queries
  4. 04Guide migrations, generation, and seeding
  5. 05Cover validators and Effect drivers

Use cases

  1. 01Set up Drizzle 1.0 RC for a new project
  2. 02Upgrade a 0.x project to an RC
  3. 03Generate migrations and verify on a test database
  4. 04Run Kit commands in CI

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/dobroslavradosavljevic/skills --skill drizzle-orm

After installing, type/drizzle-ormin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

agents/
openai.yaml
references/
drivers-upgrade.md
effect-integration.md
kit-migrations.md
relations-rqb.md
schema-queries.md
seed-validators.md
source-map.md
usage-guide.md

Details

From the project README

Drizzle ORM (1.0 RC)

Use this skill for Drizzle 1.0 release candidates (drizzle-orm@rc, currently 1.0.0-rc.4), plus drizzle-kit, drizzle-seed, in-tree validators, Studio, and official Effect drivers.

Do not treat npm latest (0.45.x / kit 0.31.x) as current for new work. Pin the rc channel for ORM + Kit + Seed together. Stable 1.0.0 has not shipped yet; rc5-style dist-tags are commit previews, not the RC line.

Workflow

  1. Inspect the local Drizzle surface:
    • Exact versions / dist-tags for drizzle-orm, drizzle-kit, drizzle-seed, eslint-plugin-drizzle.
    • Dialect + driver entrypoints (postgres-js, neon-http, bun-sql, libsql, effect-postgres, …).
    • Schema files, defineRelations, drizzle.config.ts, migrations folder shape (v3 folders vs legacy journal).
    • Whether Effect (effect 4.x + drizzle-orm/effect-*) or Promise drivers are in use.
  2. For install, day-to-day usage, baselines, and troubleshooting, follow usage-guide.md first.
  3. Refresh docs when versions drift or the task touches RQBv2, kit v3 migrations, codecs, or Effect. Start from source-map.md.
  4. Route deeper detail:
  5. Preserve the project's dialect and driver unless the user asks to switch.
  6. Verify with the narrowest useful query, bunx drizzle-kit check / generate --explain-style dry runs, or a focused migrate against a disposable DB.

Core Judgment

  • Always install @rc for new Drizzle 1.0 work: bun add drizzle-orm@rc and bun add -D drizzle-kit@rc. Never mix RC ORM with Kit 0.31.x.
  • RQBv1 is gone. Use defineRelations(schema, …) and pass { relations } into drizzle() — not per-table relations() + { schema } for db.query.
  • Prefer SQL query builder for joins/aggregations; prefer RQB for nested graphs.
  • Casing is on tables (snakeCase.table / camelCase.table), not drizzle({ casing }).
  • Production schema changes: generate → migrate. Use push only for local prototyping (--explain first).
  • After leaving 0.x: run bunx drizzle-kit up once to convert migration folders to v3 (no journal.json).
  • Validators live in-tree: drizzle-orm/zod, …/valibot, …/typebox, …/arktype, …/effect-schema. Avoid standalone [email protected] with RC.
  • Effect on RC: use drizzle-orm/effect-* + Effect v4 (effect 4.0 stable on latest, matching @effect/sql-* 4.x). The effect@beta tag is now an old prerelease — do not install it. Do not pair RC with @effect/sql-drizzle (Effect v3 / drizzle <0.50 only).
  • Non-interactive / CI / agent runs of Kit: use --output json and pass rename/data-loss decisions via --hints / --hints-file instead of answering prompts; for code, call the drizzle-kit/cli SDK.
  • Prefer $inferSelect / $inferInsert (aliases: InferSelectModel / InferInsertModel).

Verification

Prefer repository-owned commands. For meaningful Drizzle RC work, cover the relevant subset:

  • Typecheck schema + relations + client factory.
  • Focused insert/select/update/delete or db.query.*.findMany against a real or test DB.
  • bunx drizzle-kit generate then review SQL; migrate on disposable DB; check for branch conflicts.
  • Seed: reset + seed on a non-prod database only.
  • Effect path: provide PgClient (or dialect) layer and run one Effect program end-to-end.
  • After 0.x upgrades: confirm RQBv2 rewrite, casing builders, migrator folder v3, and codec-sensitive columns (arrays, timestamps, JSON).

Report which checks ran, which did not, and any @rc vs latest assumptions that remain.

Comments

Markdown supported