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.
npx skills add jezweb/claude-skills --skill d1-drizzle-schema --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# 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', { //
- Critical D1 Differences
- Workflow
- Step 1: Describe the Data Model
- Step 2: Generate Drizzle Schema
- Step 3: Add Relations
- Step 4: Export Types
- Step 5: Set Up Drizzle Config
- Step 6: Add Migration Scripts
- Step 7: Generate DATABASESCHEMA.md
- Bulk Insert Pattern
- D1 Runtime Usage
- Reference Files
- Assets
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.
