[Arch] Route handler bypasses db.py with raw SQL #56

Closed
opened 2026-07-01 07:26:46 +02:00 by bullitt · 1 comment
Owner

Severity: Medium | Category: Architecture

main.py:935-952 (api_bulk_archive_delivered) executes raw SQL directly instead of calling a db.py function, violating docs/architecture.md golden principle #1 ("All DB access through db.py functions").

Recommendation: Move the bulk-archive query into db.py as db.bulk_archive_delivered(shipment_ids).

Full detail: docs/architecture-review.md § C, Finding "Route handler bypasses db.py with raw SQL"

**Severity:** Medium | **Category:** Architecture `main.py:935-952` (`api_bulk_archive_delivered`) executes raw SQL directly instead of calling a `db.py` function, violating docs/architecture.md golden principle #1 ("All DB access through db.py functions"). **Recommendation:** Move the bulk-archive query into `db.py` as `db.bulk_archive_delivered(shipment_ids)`. Full detail: `docs/architecture-review.md` § C, Finding "Route handler bypasses db.py with raw SQL"
Author
Owner

Fixed on branch architecture-rework, commit ebcc1f8: added db.bulk_archive_delivered(user_id), moved the raw SQL from api_bulk_archive_delivered into it. Full suite: 257 passed.

Fixed on branch `architecture-rework`, commit ebcc1f8: added `db.bulk_archive_delivered(user_id)`, moved the raw SQL from `api_bulk_archive_delivered` into it. Full suite: 257 passed.
Sign in to join this conversation.
No labels
arch
harness
security
ux
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
bullitt/trackbox#56
No description provided.