Remove legacy SQLite compatibility code #122

Open
opened 2026-03-23 03:33:08 +00:00 by cal · 1 comment
Owner

Summary

Both prod and dev databases are now PostgreSQL. The codebase still contains legacy SQLite compatibility code from the migration that should be cleaned out.

Known areas to check

  • DATABASE_TYPE env var and any conditional branching between sqlite/postgresql
  • storage/pd_master.db references
  • SQLite WAL mode references
  • Any sqlite3 imports or SQLite-specific connection handling
  • Peewee database initialization that supports both backends
  • CLAUDE.md references to SQLite (already updated in parent CLAUDE.md and agent definitions)

Acceptance Criteria

  • All SQLite-specific code paths removed
  • Database initialization assumes PostgreSQL only
  • No sqlite3 imports remain
  • DATABASE_TYPE env var removed or simplified if it was only for sqlite/pg switching
  • Tests pass with PostgreSQL only
  • CLAUDE.md updated to reflect PostgreSQL-only stack
## Summary Both prod and dev databases are now PostgreSQL. The codebase still contains legacy SQLite compatibility code from the migration that should be cleaned out. ## Known areas to check - `DATABASE_TYPE` env var and any conditional branching between sqlite/postgresql - `storage/pd_master.db` references - SQLite WAL mode references - Any `sqlite3` imports or SQLite-specific connection handling - Peewee database initialization that supports both backends - CLAUDE.md references to SQLite (already updated in parent CLAUDE.md and agent definitions) ## Acceptance Criteria - All SQLite-specific code paths removed - Database initialization assumes PostgreSQL only - No `sqlite3` imports remain - `DATABASE_TYPE` env var removed or simplified if it was only for sqlite/pg switching - Tests pass with PostgreSQL only - CLAUDE.md updated to reflect PostgreSQL-only stack
Claude added the
ai-working
label 2026-03-23 04:31:04 +00:00
Claude removed the
ai-working
label 2026-03-23 04:37:41 +00:00
Collaborator

PR #126 opened: #126

Removed all SQLite compatibility code across 5 files (-335 / +48 lines):

  • db_engine.py: DATABASE_TYPE, SKIP_TABLE_CREATION, SQLite else branch, 13 db.create_tables() guards, commented-out scout_db code all removed. PooledPostgresqlDatabase now initialized unconditionally.
  • db_helpers.py: DATABASE_TYPE var and SQLite on_conflict_replace() branch removed. PostgreSQL ON CONFLICT DO UPDATE is the only upsert path.
  • players.py: Stale SQLite compatibility comment updated.
  • tests/conftest.py: DATABASE_TYPE=postgresql env var removed (no longer needed).
  • CLAUDE.md: SQLite references replaced with PostgreSQL throughout.

Unit tests using SqliteDatabase(':memory:') for test isolation were left in place — those are test infrastructure, not production compatibility code.

PR #126 opened: https://git.manticorum.com/cal/paper-dynasty-database/pulls/126 Removed all SQLite compatibility code across 5 files (-335 / +48 lines): - **db_engine.py**: `DATABASE_TYPE`, `SKIP_TABLE_CREATION`, SQLite `else` branch, 13 `db.create_tables()` guards, commented-out `scout_db` code all removed. `PooledPostgresqlDatabase` now initialized unconditionally. - **db_helpers.py**: `DATABASE_TYPE` var and SQLite `on_conflict_replace()` branch removed. PostgreSQL `ON CONFLICT DO UPDATE` is the only upsert path. - **players.py**: Stale SQLite compatibility comment updated. - **tests/conftest.py**: `DATABASE_TYPE=postgresql` env var removed (no longer needed). - **CLAUDE.md**: SQLite references replaced with PostgreSQL throughout. Unit tests using `SqliteDatabase(':memory:')` for test isolation were left in place — those are test infrastructure, not production compatibility code.
Claude added the
ai-pr-opened
label 2026-03-23 04:37:54 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cal/paper-dynasty-database#122
No description provided.