Agent skill · Databases

d1-drizzle-schema

Generate Drizzle ORM schemas for Cloudflare D1 databases with correct D1-specific patterns. Produces schema files, migration commands, type exports, and DATABASE_SCHEMA.md documentation. Handles D1 quirks: foreign keys always enforced, no native BOOLEAN/DATETIME types, 100 bound parameter limit, JSON stored as TEXT. Use when creating a new database, adding tables, or scaffolding a D1 data layer.

jezwebgithub.com/jezwebGitHub ↗
claude-codeships scriptsMIT
Install
npx skills add jezweb/claude-skills --skill d1-drizzle-schema --agent claude-code

Same command for any agent — swap --agent for codex, cursor, copilot.

Facts
Files in the skill folder: 5
SKILL.md size: 5 KB
Bundled scripts: yes
Requires: claude-code-only
Path: plugins/cloudflare/skills/d1-drizzle-schema/SKILL.md
Open the folder on GitHub →
Where it comes from
Stars: 954
Language: Python

Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.

From the SKILL.md

# D1 Drizzle Schema Generate correct Drizzle ORM schemas for Cloudflare D1. D1 is SQLite-based but has important differences that cause subtle bugs if you use standard SQLite patterns. This skill produces schemas that work correctly with D1's constraints. ## Critical D1 Differences | Feature | Standard SQLite | D1 | |---------|-----------------|-----| | Foreign keys | OFF by default | **Always ON** (cannot disable) | | Boolean type | No | No — use `integer({ mode: 'boolean' })` | | Datetime type | No | No — use `integer({ mode: 'timestamp' })` | | Max bound params | ~999 | **100** (affects bulk inserts) | | JSON support | Extension | **Always available** (json_extract, ->, ->>) | | Concurrency | Multi-writer | **Single-threaded** (one query at a time) | ## Workflow ### Step 1: Describe the Data Model Gather requirements: what tables, what relationships, what needs indexing. If working from an existing description, infer the schema directly. ### Step 2: Generate Drizzle Schema Create schema files using D1-correct column patterns: ```typescript import { sqliteTable, text, integer, real, index, uniqueIndex } from 'drizzle-orm/sqlite-core' export const users = sqliteTable('users', { //

What's inside
Steps it walks through
  1. Critical D1 Differences
  2. Workflow
  3. Step 1: Describe the Data Model
  4. Step 2: Generate Drizzle Schema
  5. Step 3: Add Relations
  6. Step 4: Export Types
  7. Step 5: Set Up Drizzle Config
  8. Step 6: Add Migration Scripts
  9. Step 7: Generate DATABASESCHEMA.md
  10. Bulk Insert Pattern
  11. D1 Runtime Usage
  12. Reference Files
  13. Assets
Ships with 4 files
  • assets/drizzle-config-template.ts
  • assets/schema-template.ts
  • references/column-patterns.md
  • references/d1-specifics.md
More from claude-skills
All skills →
About this skill
What does the d1-drizzle-schema skill do?

Generate Drizzle ORM schemas for Cloudflare D1 databases with correct D1-specific patterns. Produces schema files, migration commands, type exports, and DATABASE_SCHEMA.md documentation. Handles D1 quirks: foreign keys always enforced, no native BOOLEAN/DATETIME types, 100 bound parameter limit, JSON stored as TEXT. Use when creating a new database, adding tables, or scaffolding a D1 data layer.

How do I install it?

Run `npx skills add jezweb/claude-skills --skill d1-drizzle-schema --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.

Where does this skill come from?

From jezweb/claude-skills, a repository with 954 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.

Is a popular skill a good skill?

Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.

Keep going