Acme

Database

Drizzle + D1 demo

A minimal data flow from a TanStack server function through Drizzle ORM to Cloudflare D1.

Todos
Stored in the local Cloudflare D1 database through Drizzle ORM.
  • No todos yet. Create one below.
Drizzle ORM on Cloudflare D1
Type-safe SQLite queries running in the Cloudflare Workers runtime.

Local migration workflow

  1. Prepare the local D1 database once: pnpm begin
  2. After editing src/db/schema.ts, generate and review a migration: pnpm db:generate
  3. Apply it to the local database named in wrangler.jsonc: pnpm exec wrangler d1 migrations apply <configured-database> --local
  4. Use docs/deployment.md for production migration steps.