# drizzle-orm-expert

Guides schema authoring, relational queries, and migrations in Drizzle ORM. Helpful when structuring type-safe database layers in TypeScript.

- skill · `type=skill` · Claude Code · 83 installs
- Author: davila7
- License: not stated · policy=link-only · description only; the file stays with the author
- Source: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/skills/web-development/drizzle-orm-expert
- Updated: 2026-10-24
- HTML: https://affpapa.org/en/nevibecode/skills/drizzle-orm-expert

## What it does

This skill assists Claude Code with setting up type-safe persistence using Drizzle ORM in TypeScript projects. It supplies patterns for table declarations via `pgTable`, entity associations with `relations`, and automatic type inference using `InferSelectModel`.

The guidelines cover SQL-style selects with joins, batch inserts, and nested relational reads without N+1 query pitfalls. It also details migration handling via `drizzle-kit` commands, transactional updates, and client connections for Neon, Turso, or PlanetScale.

Drizzle translates directly into SQL without relying on an external engine binary. Because of this architecture, your schemas require exact TypeScript type definitions upfront.

## Install

### Claude Code (native platform)

1. **claude-code-templates**
```bash
npx claude-code-templates@latest --skill web-development/drizzle-orm-expert
```

2. **Skills CLI (Vercel)**
```bash
npx skills add davila7/claude-code-templates --skill drizzle-orm-expert -a claude-code
```

3. **Manually: put the files in place**
- File: `~/.claude/skills/drizzle-orm-expert/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/drizzle-orm-expert/

### Codex

**Manually: put the files in place**
- File: `.agents/skills/drizzle-orm-expert/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

**Manually: put the files in place**
- File: `.cursor/skills/drizzle-orm-expert/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install davila7/claude-code-templates drizzle-orm-expert
```

2. **Manually: put the files in place**
- File: `.github/skills/drizzle-orm-expert/SKILL.md`

### Gemini CLI

**Platform CLI**
```bash
gemini skills install https://github.com/davila7/claude-code-templates --path cli-tool/components/skills/web-development/drizzle-orm-expert
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/drizzle-orm-expert/SKILL.md` — The legacy .windsurf/skills/ path still works

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/davila7/claude-code-templates/tree/HEAD/cli-tool/components/skills/web-development/drizzle-orm-expert

## When to use it
- define database tables and foreign keys in TypeScript
- execute nested relational queries without triggering N+1 issues
- generate and run schema migrations using `drizzle-kit`
- connect Drizzle to serverless drivers like Neon, LibSQL, or PlanetScale

## Example prompts
- Generate a Drizzle schema for users and posts with a one-to-many relation
- Write a relational query fetching authors and their published posts
- Configure `drizzle.config.ts` and generate a migration for PostgreSQL

## Similar
- [mcp-builder](https://affpapa.org/en/nevibecode/skills/mcp-builder.md) — skill · 130949 installs
- [claude-api](https://affpapa.org/en/nevibecode/skills/claude-api.md) — skill · 74198 installs
- [lark-im](https://affpapa.org/en/nevibecode/skills/lark-im.md) — skill · 472900 installs
- [lark-event](https://affpapa.org/en/nevibecode/skills/lark-event.md) — skill · 466800 installs
- [caveman-discover](https://affpapa.org/en/nevibecode/skills/caveman-discover.md) — skill · 104400 installs
- [migration](https://affpapa.org/en/nevibecode/skills/migration.md) — skill · 103900 installs

From the same set: [davila7/claude-code-templates](https://affpapa.org/en/nevibecode/by/davila7/claude-code-templates.md) — 804 cards

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
