d1-drizzle-schema

Generate D1-ready Drizzle ORM schemas with type exports for Cloudflare D1.

1|Updated Apr 29, 2026
One-click install
npx skills add https://github.com/firstsun-dev/yao-agent-skills --skill d1-drizzle-schema-firstsun-dev
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: d1-drizzle-schema
Source: https://github.com/firstsun-dev/yao-agent-skills/tree/main/custom/develop/drizzle-orm-best-practices
Command: npx skills add https://github.com/firstsun-dev/yao-agent-skills --skill d1-drizzle-schema-firstsun-dev

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) and assets (resource) components.

What problem does it solve?

Automates generation of accurate Drizzle ORM schemas for Cloudflare D1, addressing D1-specific quirks.

Core Features & Use Cases

  • Schema generation using D1-compatible column patterns (text, integers, JSON, foreign keys, and indexes).
  • Type exports for inferred models to ensure type-safe queries and broader code-gen compatibility.
  • D1-specific guidance on migrations, JSON storage, and troubleshooting to ensure robust schemas across environments.

Quick Start

Run drizzle-kit against assets/schema-template.ts to generate and validate your D1-compatible schema.

Frequently Asked Questions about d1-drizzle-schema

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate a Drizzle schema for Cloudflare D1?

To generate a Drizzle schema for Cloudflare D1, run drizzle-kit against a D1-ready schema template to produce type-safe code and validate D1-specific column patterns.

Does Drizzle ORM support D1-specific JSON storage and foreign keys?

Yes, Drizzle ORM supports D1-specific JSON storage and foreign keys by applying D1-compliant column patterns to ensure robust schema design and type-safe queries.

What is the best way to handle D1 database migrations with Drizzle?

The best way to handle D1 database migrations with Drizzle is to use D1-specific guidance on migrations alongside drizzle-kit to generate and validate your schema.

How do I export inferred TypeScript models from a Drizzle schema?

Export inferred TypeScript models from a Drizzle schema using built-in type export templates, ensuring type-safe queries and broader code-gen compatibility for Node.js projects.

Why are my Cloudflare D1 schema migrations not working with Drizzle?

D1 schema migrations may fail if they ignore D1-specific quirks; using a D1-ready schema template with drizzle-kit provides troubleshooting guidance to resolve robust schema issues.