
D1 Drizzle Schema
Generates Drizzle ORM schemas that actually work with Cloudflare D1's quirks. D1 is SQLite-based but foreign keys are always enforced, there's a 100 bound parameter limit that breaks naive bulk inserts, and you need specific column modes for booleans and timestamps or you'll store garbage. This handles all of that automatically and produces schema files, migration commands, type exports, and a DATABASE_SCHEMA.md for documentation. Use it when scaffolding a new D1 database or adding tables to an existing one. Saves you from the annoying trial-and-error of learning D1's differences from standard SQLite the hard way.
- skills.sh installs
- 1.7K
- GitHub stars
- 1.1K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add jezweb/claude-skills --skill d1-drizzle-schema --agent claude-codeInstalls into .claude/skills of the current project.
Files
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:
import { sqliteTable, text, integer, real, index, uniqueIndex } from 'drizzle-orm/sqlite-core'
Sponsors
Details
- Repository
- github.com/jezweb/claude-skills
- Categories
- Backend & APIs, Documentation, Cloud & Infrastructure, Databases
- First seen
- Apr 16, 2026
More from jezweb/claude-skills
All 166- Wordpress Content1.7K
- Elevenlabs Agents1.7K
- Project Health1.6K
- Hono Api Scaffolder1.6K
- Wordpress Setup1.6K
- Landing Page1.5K
- Design Review1.5K
- Mcp Builder1.4K
- Social Media Posts1.4K
- Cloudflare Worker Builder1.4K
- Ai Image Generator1.4K
- Shopify Products1.4K
- Github Release1.3K
- React Native1.3K
- React Patterns1.3K
- Resume Cover Letter1.3K
- Google Chat Messages1.3K
- Proposal Writer1.3K
- Aussie Business English1.3K
- Shopify Setup1.2K
- Git Workflow1.2K
- Project Docs1.2K
- Zustand State Management1.2K
- Vite Flare Starter1.2K