D1 Drizzle Schema

Drizzle schemas for Cloudflare D1 with correct boolean, timestamp, JSON and param limits

Tested · Works

Test report

Verdict
Tested · Works
Score
8.8/10
Tested
Jul 21, 2026
Environment
Claude Code 2.x (agent harness)
Upstream re-checked
Aug 10, 2026 · 51c84b7

Installed into a throwaway HOME (export HOME=$(mktemp -d)); SKILL.md landed at ~/.claude/skills/d1-drizzle-schema/SKILL.md with all 4 referenced files present (each raw-fetched HTTP 200), frontmatter has name+description, no curl|sh, base64 or secret-reading patterns. Task: schema for a D1 support-ticket app (organisations/users/tickets) plus a bulk ticket importer — I wrote a baseline first (/tmp/.../baseline-schema.ts), then a skill-followed version (skill-schema.ts), installed drizzle-orm 0.45.2 + typescript and compiled both under strict mode (tsc exit 0), then forced never-assignment errors to read the inferred column types. Measured difference: baseline createdAt is `string | null`, skill's is `Date`; baseline isActive `number | null` vs skill `boolean`; baseline tags `string | null` vs skill `TicketTags | null`; baseline status `string` vs skill `"closed" | "open" | "pending"`. Ran both bulk inserts through the sqlite-proxy dialect's toSQL(): baseline emits ONE statement with 160 bound parameters (over D1's 100 limit), the skill's batched loop emits 84/84/72 — the concrete functional win. Docs docked one point: the description promises DATABASE_SCHEMA.md output but Step 7 gives only a four-bullet outline with no template, and I did not exercise it.

Scored on four weighted criteria — install, triggering, output vs. baseline, docs. How scoring works

  • Installs cleanly 5/5
  • Triggers reliably 5/5
  • Output vs. baseline 8/10
  • Docs & honesty 4/5

What D1 Drizzle Schema does

Generates Drizzle ORM schema files for Cloudflare D1 databases using D1-correct column patterns: integer-mode booleans and timestamps, typed JSON columns, enum-constrained text, UUID primary keys, relations and inferred type exports. Also supplies the drizzle.config.ts template, wrangler migration scripts, and a batching pattern that keeps bulk inserts under D1's 100 bound-parameter limit. Triggers when creating a D1 database, adding tables, or scaffolding a D1 data layer in a Worker.

How to install D1 Drizzle Schema

git clone --depth 1 https://github.com/jezweb/claude-skills.git /tmp/d1-drizzle-schema-src
mkdir -p ~/.claude/skills
cp -R /tmp/d1-drizzle-schema-src/plugins/cloudflare/skills/d1-drizzle-schema ~/.claude/skills/d1-drizzle-schema
# Ships SKILL.md + assets/{drizzle-config-template.ts,schema-template.ts} + references/{column-patterns.md,d1-specifics.md}
# No API keys or external services needed to generate the schema.
# To actually run migrations afterwards you need: npm i drizzle-orm drizzle-kit && npx wrangler (Cloudflare account + a D1 binding named DB)
# Plugin-marketplace alternative: /plugin marketplace add jezweb/claude-skills then /plugin install cloudflare@jezweb-skills

Skills live in ~/.claude/skills/ (global) or .claude/skills/ (per-project). Restart Claude Code after installing.

Commands — how to trigger D1 Drizzle Schema

  • /d1-drizzle-schema Drizzle schemas for Cloudflare D1 with correct boolean, timestamp, JSON and param limits

It also activates on plain-language prompts like these:

  • Create a Drizzle schema for a new D1 database
  • Add a table with foreign keys to my D1 schema
  • Scaffold a data layer for this Cloudflare D1 project

Frequently asked questions

Is the D1 Drizzle Schema skill free?
Yes. The skill itself is free from jezweb/claude-skills. SkillProof publishes the install command and an independent test verdict at no cost.
Does D1 Drizzle Schema work with Claude Code?
We tested it with Claude Code 2.x (agent harness) on Jul 21, 2026. Verdict: Tested · Works. Installed into a throwaway HOME (export HOME=$(mktemp -d)); SKILL.md landed at ~/.claude/skills/d1-drizzle-schema/SKILL.md with all 4 referenced files present (each raw-fetched HTTP 200), frontmatter has name+description, no curl|sh, base64 or secret-reading patterns. Task: schema for a D1 support-ticket app (organisations/users/tickets) plus a bulk ticket importer — I wrote a baseline first (/tmp/.../baseline-schema.ts), then a skill-followed version (skill-schema.ts), installed drizzle-orm 0.45.2 + typescript and compiled both under strict mode (tsc exit 0), then forced never-assignment errors to read the inferred column types. Measured difference: baseline createdAt is `string | null`, skill's is `Date`; baseline isActive `number | null` vs skill `boolean`; baseline tags `string | null` vs skill `TicketTags | null`; baseline status `string` vs skill `"closed" | "open" | "pending"`. Ran both bulk inserts through the sqlite-proxy dialect's toSQL(): baseline emits ONE statement with 160 bound parameters (over D1's 100 limit), the skill's batched loop emits 84/84/72 — the concrete functional win. Docs docked one point: the description promises DATABASE_SCHEMA.md output but Step 7 gives only a four-bullet outline with no template, and I did not exercise it.
What is the D1 Drizzle Schema SkillProof Score?
8.8/10 — installs cleanly 5/5, triggers reliably 5/5, output vs. baseline 8/10, docs & honesty 4/5.
How do I install D1 Drizzle Schema?
Copy the install command from this page, run it in your terminal, and restart Claude Code. Skills live in ~/.claude/skills/ (global) or .claude/skills/ inside a project.
Can I use D1 Drizzle Schema with Cursor, Copilot, Gemini CLI, Codex or other AI tools?
The SKILL.md format is native to Claude (Claude Code, Desktop, claude.ai). The instructions inside adapt to other assistants: Cursor rules, GitHub Copilot instructions, Windsurf rules, Custom GPTs, AGENTS.md for OpenAI Codex, and GEMINI.md for Google Gemini CLI — our conversion guides cover each, and the free converter on the tools page does the wrapping for you.