d1-drizzle-schema

Installation
Summary

Generate Drizzle ORM schemas for Cloudflare D1 with D1-specific SQLite patterns and constraints.

  • Handles D1 quirks: enforced foreign keys, no native BOOLEAN/DATETIME types, 100 bound parameter limit, and JSON stored as TEXT
  • Produces schema files, type exports, migration commands, and DATABASE_SCHEMA.md documentation
  • Includes bulk insert batching logic and D1 runtime query patterns for Workers
  • Reference guides cover D1 vs standard SQLite differences, column type patterns, and migration workflows
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

Related skills
Installs
992
GitHub Stars
776
First Seen
Feb 18, 2026