D1 Drizzle Schema
Generates D1-correct Drizzle ORM schemas, migrations, types, and schema docs for Cloudflare D1.
Dev & CodingIntermediate★ 1,034⑂ 105AI score 8/10Last updated: Sep 29, 2026
What it does
- Produces Drizzle ORM schema files tailored to Cloudflare D1 (SQLite-based, but with quirks).
- Encodes D1-specific rules: no native
BOOLEAN/DATETIME(useinteger({ mode: 'boolean' | 'timestamp' })), foreign keys always enforced, 100 bound-parameter cap, JSON stored as TEXT, single-writer concurrency. - Scaffolds relations,
$inferSelect/$inferInserttype exports,drizzle.config.ts, migration npm scripts, and aDATABASE_SCHEMA.mdreference doc. - Includes a bulk-insert batching formula and Worker runtime query patterns (
.all(),.get(), count).
Who it's for
- Developers building on Cloudflare Workers + D1.
- Drizzle users who have hit subtle D1 bugs from standard SQLite assumptions.
- Teams scaffolding a fresh data layer that needs documentation from day one.
Examples
- "Create a D1 schema for users, organisations, and posts" → schema.ts with UUID PKs, unique email index, cascade FKs.
- "My 5,000-row import fails with too many SQL variables" → rewritten as batched inserts using
BATCH_SIZE = floor(100 / columnsPerRow). - "Add an audit_log table and ship the migration" → table added, then
drizzle-kit generatepluswrangler d1 migrations apply DB --localand--remote.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/jezweb/claude-skills/HEAD/archive/plugins/cloudflare/skills/d1-drizzle-schema/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the archive/plugins/cloudflare/skills/d1-drizzle-schema folder from the GitHub repo jezweb/claude-skills into my ~/.claude/skills/jezweb-d1-drizzle-schema/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/jezweb/claude-skills.git /tmp/claude-skills && mkdir -p ~/.claude/skills && cp -r /tmp/claude-skills/archive/plugins/cloudflare/skills/d1-drizzle-schema ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal.
- Clone the repo:
git clone https://github.com/jezweb/claude-skills.git - Create the skills directory:
mkdir -p ~/.claude/skills - Copy the skill:
cp -r claude-skills/archive/plugins/cloudflare/skills/d1-drizzle-schema ~/.claude/skills/ - Install project prerequisites:
npm i drizzle-orm && npm i -D drizzle-kit wrangler - Restart Claude Code and ask something like "scaffold a D1 Drizzle schema for my app" to trigger the skill.
View source on GitHub ↗License: MIT