rwsdk-database-do

Scaffold SQLite Durable Objects with type-safe Kysely queries in Cloudflare Workers.

Updated Dec 26, 2025
One-click install
npx skills add https://github.com/kcc989/logoer --skill rwsdk-database-do
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rwsdk-database-do
Source: https://github.com/kcc989/logoer/tree/main/.claude/skills/rwsdk-do-db
Command: npx skills add https://github.com/kcc989/logoer --skill rwsdk-database-do

SYSTEM DOCUMENTATION & REQUIREMENTS

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

Frequently Asked Questions about rwsdk-database-do

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

FAQPage Schema
How do I set up SQLite Durable Objects with type-safe queries in Cloudflare Workers?

To set up SQLite Durable Objects, create migration files, define a database instance, implement a Durable Object class, export it from your worker, and update wrangler.toml to bind the object for type-safe queries.

How do I manage database migrations for SQLite Durable Objects across isolated instances?

Database migrations for SQLite Durable Objects are managed by defining schema changes in a migrations file, which allows safe rollback paths and automatic schema evolution across isolated Durable Object instances.

Can I perform joins and CRUD operations in Cloudflare Workers without runtime schema hints?

Yes, you can perform joins and CRUD operations without runtime schema hints by leveraging Kysely-powered typings that are automatically inferred directly from your migration files.

Does Kysely work with SQLite Durable Objects for type-safe database queries?

Kysely works with SQLite Durable Objects to provide type-safe database queries by inferring schema types directly from migrations, eliminating the need for separate code generation steps.

What is the best way to seed initial data into isolated SQLite Durable Objects?

The best way to seed initial data into isolated SQLite Durable Objects is by using the built-in seeding and maintenance features provided during development and deployment to manage initial records.

Why use migration-driven schema inference instead of code generation for Cloudflare Workers databases?

Using migration-driven schema inference instead of code generation streamlines development by automatically typing your queries through migrations, ensuring your database schema stays synchronized with your code safely.