What problem does it solve?
This skill helps developers configure and use SQLite-based Durable Objects in Cloudflare Workers, providing a structured approach to migrations, type-safe queries, and isolated database instances.
Core Features & Use Cases
- Migration-driven schema: Define migrations that evolve the database schema with safe rollback paths across DOs.
- Type-safe queries: Leverage Kysely-powered typings inferred from migrations to perform CRUD, joins, and complex reads without runtime schema hints.
- Seeding and maintenance: Seed initial data and manage migrations during development and deployment in isolated environments.
Quick Start
Follow the steps to set up a Durable Object-backed SQLite database:
- Create a migrations file at db/migrations.ts
- Create a database instance in db/db.ts
- Implement a Durable Object class in db/durableObject.ts
- Export the DO from worker.ts
- Update wrangler.toml to bind the durable object