drizzle-d1

Manage Cloudflare D1 schemas and migrations with Drizzle ORM conventions.

Updated Nov 19, 2025
One-click install
npx skills add https://github.com/alexturpin/cf-app-starter --skill drizzle-d1
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drizzle-d1
Source: https://github.com/alexturpin/cf-app-starter/tree/main/.opencode/skills/drizzle-d1
Command: npx skills add https://github.com/alexturpin/cf-app-starter --skill drizzle-d1

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides conventions and guidance for using Drizzle ORM with Cloudflare D1 databases, streamlining database interactions and schema management.

Core Features & Use Cases

  • D1 Integration: Seamlessly use Drizzle ORM with Cloudflare D1.
  • Schema Conventions: Standardized approach to defining table schemas, including common fields like id, createdAt, and updatedAt.
  • Migration Management: Clear instructions on how to generate and manage database migrations.
  • Use Case: When developing a new feature that requires database persistence, follow these conventions to define your D1 schema and manage migrations efficiently.

Quick Start

Import db or schema from @/db to interact with your D1 database.

Frequently Asked Questions about drizzle-d1

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

FAQPage Schema
How do I manage database migrations for Cloudflare D1 using Drizzle ORM?

You can manage D1 migrations by enforcing schema conventions and automating migration generation and application via npm scripts. This streamlines database interactions and ensures standardized schema management for Cloudflare D1.

What schema conventions should I follow when defining tables for Drizzle and D1?

When defining D1 schemas with Drizzle ORM, you should follow conventions including standardized ID prefixes, timestamp fields like `createdAt` and `updatedAt`, and clear relation definitions to ensure consistency.

Does Drizzle ORM work seamlessly with Cloudflare D1 databases?

Yes, Drizzle ORM integrates seamlessly with Cloudflare D1. It provides specific conventions and guidance to streamline database interactions, schema management, and migrations specifically for the D1 platform.

How do I generate and apply migrations for a D1 database in an automated workflow?

You can generate and apply D1 migrations automatically by using defined npm scripts. This approach automates the migration workflow while enforcing schema conventions like ID prefixes and relation definitions for Drizzle ORM.

What is the best way to structure a new D1 database schema for a feature requiring persistence?

The best way to structure a D1 schema is by following Drizzle ORM conventions, which standardizes table definitions with common fields like `id`, `createdAt`, and `updatedAt` to efficiently manage database persistence.

Why do I need standardized timestamps and ID prefixes in my D1 schema?

Standardized ID prefixes and timestamps like `createdAt` and `updatedAt` are enforced by Drizzle ORM conventions to maintain data consistency, streamline schema management, and automate migrations reliably across your D1 database.