Summary
Abstract the database layer in engine-core to support multiple backends, enabling a future migration from SQLite to PostgreSQL without breaking the application.
Context
The current stack uses better-sqlite3 with Drizzle ORM. The database file lives at ./data/ceegee.db with WAL mode. As the application moves toward production deployment (Docker, multi-instance), PostgreSQL support will be needed.
Scope
- Abstract the database connection layer to support both SQLite and PostgreSQL
- Use Drizzle ORM's multi-dialect support
- Environment-variable-driven backend selection (e.g.,
DATABASE_URL)
- Ensure migrations work for both backends
- Keep SQLite as the default for local development
Summary
Abstract the database layer in engine-core to support multiple backends, enabling a future migration from SQLite to PostgreSQL without breaking the application.
Context
The current stack uses better-sqlite3 with Drizzle ORM. The database file lives at
./data/ceegee.dbwith WAL mode. As the application moves toward production deployment (Docker, multi-instance), PostgreSQL support will be needed.Scope
DATABASE_URL)