Skip to content

Add SQLite/D1 support as alternative database provider #27

Description

@PAMulligan

Description

Add SQLite (and Cloudflare D1) as an alternative database provider alongside PostgreSQL. Drizzle ORM already supports SQLite — this change surfaces that support through Nerva's pipeline and templates.

Why

SQLite is ideal for prototyping, local development, and edge deployments. Cloudflare D1 (SQLite at the edge) is the native database for Cloudflare Workers. Currently Nerva defaults to PostgreSQL everywhere — even for Workers projects where D1 is the natural fit.

Current State

  • `pipeline.config.json` has `database.defaultProvider: "postgresql"`
  • `setup-project.sh` always generates PostgreSQL Drizzle config
  • The `database-design` skill generates `pgTable` schemas exclusively

Acceptance Criteria

  • Add `--sqlite` / `--d1` flag to `setup-project.sh`
  • Generate SQLite-compatible Drizzle schema (`sqliteTable` instead of `pgTable`)
  • Generate appropriate `drizzle.config.ts` for SQLite/D1
  • Update `pipeline.config.json` to support `"sqlite"` as a provider option
  • Update the `database-design` skill to handle SQLite column types
  • Update the `schema-architect` agent to consider database provider
  • Add D1 bindings to the Cloudflare Workers template when using D1
  • Document SQLite limitations vs. PostgreSQL (no JSON operators, limited ALTER TABLE, etc.)
  • CI passes

Breaking Changes

None — PostgreSQL remains the default. SQLite is opt-in.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions