New advertisers: 50% off your first month with code FIRSTMONTHSee slots
jezweb avatar

D1 Drizzle Schema

Generate Drizzle ORM schemas for Cloudflare D1 with D1-specific column patterns, migrations, and docs.

skills.sh installs
1.7K
GitHub stars
1.1K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers the schema workflow: data model, Drizzle table definitions, relations, exported types, drizzle config, and migration scripts
  • Includes DATABASE_SCHEMA.md documentation, a bulk insert pattern that respects the 100 bound parameter limit, and runtime query examples
  • Enforces D1 differences such as always-on foreign keys, booleans and timestamps stored as integers, and JSON stored as TEXT
  • Designed for creating a new D1 database, adding tables, or scaffolding a D1 data layer in Claude Code

Install

$ npx -y skills add jezweb/claude-skills --skill d1-drizzle-schema -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

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

FeatureStandard SQLiteD1
Foreign keysOFF by defaultAlways ON (cannot disable)
Boolean typeNoNo — use integer({ mode: 'boolean' })
Datetime typeNoNo — use integer({ mode: 'timestamp' })
Max bound params~999100 (affects bulk inserts)
JSON supportExtensionAlways available (json_extract, ->, ->>)
ConcurrencyMulti-writerSingle-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'

Details

Repository
github.com/jezweb/claude-skills
Categories
Databases, Backend & APIs
First seen
Apr 16, 2026

More from jezweb/claude-skills

All 64

Similar to D1 Drizzle Schema

More Databases