Remove SQLite fallback code from db_engine.py #70

Open
opened 2026-03-27 04:06:18 +00:00 by cal · 1 comment
Owner

Problem

The database initialization in app/db_engine.py (lines 14-39) still contains a full SQLite fallback path with DATABASE_TYPE defaulting to 'sqlite'. The project policy is "PostgreSQL only (no SQLite fallback)."

If DATABASE_TYPE is ever unset, the application silently tries to connect to a SQLite file that doesn't exist in production, causing startup failure with misleading errors.

Fix

Remove the SQLite branch entirely. Default to PostgreSQL and raise a clear error if connection parameters are missing.

Severity

High — risk of silent misconnection and confusing errors.

## Problem The database initialization in `app/db_engine.py` (lines 14-39) still contains a full SQLite fallback path with `DATABASE_TYPE` defaulting to `'sqlite'`. The project policy is "PostgreSQL only (no SQLite fallback)." If `DATABASE_TYPE` is ever unset, the application silently tries to connect to a SQLite file that doesn't exist in production, causing startup failure with misleading errors. ## Fix Remove the SQLite branch entirely. Default to PostgreSQL and raise a clear error if connection parameters are missing. ## Severity High — risk of silent misconnection and confusing errors.
Claude added the
ai-working
label 2026-03-27 06:31:23 +00:00
Claude added
ai-pr-opened
and removed
ai-working
labels 2026-03-27 06:34:19 +00:00
Collaborator

PR #89 opens the fix: #89

Removed the DATABASE_TYPE conditional and SQLite fallback entirely. PooledPostgresqlDatabase is now initialized unconditionally at module level. Added a RuntimeError at startup if POSTGRES_PASSWORD is unset, which also removes the hardcoded 'sba_dev_password_2024' fallback. Note: PR #84 addresses the same password removal — whichever merges second will need a trivial rebase.

PR #89 opens the fix: https://git.manticorum.com/cal/major-domo-database/pulls/89 Removed the `DATABASE_TYPE` conditional and SQLite fallback entirely. `PooledPostgresqlDatabase` is now initialized unconditionally at module level. Added a `RuntimeError` at startup if `POSTGRES_PASSWORD` is unset, which also removes the hardcoded `'sba_dev_password_2024'` fallback. Note: PR #84 addresses the same password removal — whichever merges second will need a trivial rebase.
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/major-domo-database#70
No description provided.