cloudflare-d1

Featured

Cloudflare D1 SQLite database with Workers, Drizzle ORM, migrations

API & Backend 694 stars 57 forks Updated today MIT

Install

View on GitHub

Quality Score: 98/100

Stars 20%
95
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Cloudflare D1 Skill Cloudflare D1 is a serverless SQLite database designed for Cloudflare Workers with global distribution and zero cold starts. **Sources:** [D1 Docs](https://developers.cloudflare.com/d1/) | [Drizzle + D1](https://orm.drizzle.team/docs/connect-cloudflare-d1) | [Wrangler CLI](https://developers.cloudflare.com/workers/wrangler/) --- ## Core Principle **SQLite at the edge, migrations in version control, Drizzle for type safety.** D1 brings SQLite's simplicity to serverless. Design for horizontal scale (multiple small databases) rather than vertical (one large database). Use Drizzle ORM for type-safe queries and migrations. --- ## D1 Stack | Component | Purpose | |-----------|---------| | **D1** | Serverless SQLite database | | **Workers** | Edge runtime for your application | | **Wrangler** | CLI for development and deployment | | **Drizzle ORM** | Type-safe ORM with migrations | | **Drizzle Kit** | Migration tooling | | **Hono** | Lightweight web framework (optional) | --- ## Project Setup ### Create Worker Project ```bash # Create new project npm create cloudflare@latest my-app -- --template "worker-typescript" cd my-app # Install dependencies npm install drizzle-orm npm install -D drizzle-kit ``` ### Create D1 Database ```bash # Create database (creates both local and remote) npx wrangler d1 create my-database # Output: # [[d1_databases]] # binding = "DB" # database_name = "my-database" # database_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"...

Details

Author
alinaqi
Repository
alinaqi/maggy
Created
5 months ago
Last Updated
today
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category