cloudflare-d1

Solid

Cloudflare D1 serverless SQLite on edge. Use for databases, migrations, bindings, or encountering D1_ERROR, statement too long, too many requests queued errors.

DevOps & Infrastructure 162 stars 25 forks Updated 2 weeks ago MIT

Install

View on GitHub

Quality Score: 91/100

Stars 20%
74
Recency 20%
90
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
80
License 10%
100
Description 5%
100

Skill Content

# Cloudflare D1 Database **Status**: Production Ready โœ… | **Last Verified**: 2025-01-15 ## Table of Contents 1. [What Is D1?](#what-is-d1) 2. [Quick Start](#quick-start-5-minutes) 3. [Critical Rules](#critical-rules) 4. [D1 API Methods](#d1-api-methods) 5. [Top 5 Use Cases](#top-5-use-cases) 6. [Migrations Best Practices](#migrations-best-practices) 7. [Common Patterns](#common-patterns) 8. [SQLite Type Affinity](#sqlite-type-affinity) 9. [Top 5 Errors Prevented](#top-5-errors-prevented) --- ## What Is D1? Cloudflare D1 is **serverless SQLite** on the edge: - SQL database without servers - Global distribution - Zero cold starts - Standard SQLite syntax - Read replication for global performance --- ## ๐Ÿ†• New in 2025 D1 received major updates throughout 2025: ### Performance (January 2025) - **40-60% latency reduction** globally (P50 query times) - Optimized SQLite engine for edge execution - Reduced cold start impact for databases <100 MB ### Reliability (September 2025) - **Automatic query retries**: Read queries retry up to 2x on transient failures - Transparent to application code (logged in `wrangler tail`) ### Scalability (April 2025) - **Read Replication (Public Beta)**: Deploy read replicas globally - Up to 2x read throughput for read-heavy workloads - Sessions API for read-write separation ### Compliance (November 2025) - **Data Localization**: Specify EU/US jurisdiction for GDPR/data sovereignty - Configure via `--jurisdiction` flag or wrangler.jsonc ### ...

Details

Author
secondsky
Repository
secondsky/claude-skills
Created
6 months ago
Last Updated
2 weeks ago
Language
TypeScript
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content โ€” not just same category

API & Backend Solid

d1-migration

Cloudflare D1 migration workflow: generate with Drizzle, inspect SQL for gotchas, apply to local and remote, fix stuck migrations, handle partial failures. Use when running migrations, fixing migration errors, or setting up D1 schemas.

813 Updated 2 weeks ago
jezweb
API & Backend Solid

d1-drizzle-schema

Generate Drizzle ORM schemas for Cloudflare D1 databases with correct D1-specific patterns. Produces schema files, migration commands, type exports, and DATABASE_SCHEMA.md documentation. Handles D1 quirks: foreign keys always enforced, no native BOOLEAN/DATETIME types, 100 bound parameter limit, JSON stored as TEXT. Use when creating a new database, adding tables, or scaffolding a D1 data layer.

813 Updated 2 weeks ago
jezweb
API & Backend Solid

drizzle-orm-d1

Type-safe ORM for Cloudflare D1 databases using Drizzle. Use when: building D1 database schemas, writing type-safe SQL queries, managing migrations with Drizzle Kit, defining table relations, implementing prepared statements, using D1 batch API, or encountering D1_ERROR, transaction errors, foreign key constraint failures, or schema inference issues. Keywords: drizzle orm, drizzle d1, type-safe sql, drizzle schema, drizzle migrations, drizzle kit, orm cloudflare, d1 orm, drizzle typescript, drizzle relations, drizzle transactions, drizzle query builder, schema definition, prepared statements, drizzle batch, migration management, relational queries, drizzle joins, D1_ERROR, BEGIN TRANSACTION d1, foreign key constraint, migration failed, schema not found, d1 binding error, schema design, database indexes, soft deletes, uuid primary keys, enum constraints, performance optimization, naming conventions, schema testing

162 Updated 2 weeks ago
secondsky
Web & Frontend Solid

better-auth

Skill for integrating Better Auth - comprehensive TypeScript authentication framework for Cloudflare D1, Next.js, Nuxt, and 15+ frameworks. Use when adding auth, encountering D1 adapter errors, or implementing OAuth/2FA/RBAC features.

162 Updated 2 weeks ago
secondsky
AI & Automation Listed

cloudflare

Build and deploy on Cloudflare's edge platform. Use when creating Workers, Pages, D1 databases, R2 storage, AI inference, or KV storage. Triggers on Cloudflare, Workers, Cloudflare Pages, D1, R2, KV, Cloudflare AI, Durable Objects, edge computing.

2 Updated today
Makiya1202