refactor(db): de-duplicate the SQLite version check and _run_schema rollback #262

Open
opened 2026-10-03 10:45:42 +00:00 by gabogg · 0 comments
Owner

P3 follow-up from PR #234 review pass 2 (both axes).

Finding

  • app/db/database.py:593-596 checks the SQLite version twice: sqlite_version_info < (3, 35), then again by parsing sqlite_version. Either one is enough.
  • app/db/database.py:922-934 has the same try/rollback/raise block in both branches.

Acceptance Criteria

  • Keep only the sqlite_version_info check, and update the test that patches both.
  • Write the rollback once: call _run_schema once on the resolved connection, or move the rollback inside it.
P3 follow-up from PR #234 review pass 2 (both axes). ### Finding - `app/db/database.py:593-596` checks the SQLite version twice: `sqlite_version_info < (3, 35)`, then again by parsing `sqlite_version`. Either one is enough. - `app/db/database.py:922-934` has the same try/rollback/raise block in both branches. ### Acceptance Criteria - Keep only the `sqlite_version_info` check, and update the test that patches both. - Write the rollback once: call `_run_schema` once on the resolved connection, or move the rollback inside it.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
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
gabogg/hikcentral#262
No description provided.