Context
PR #791 replaced the five compile-time-checked sqlx::query! UPDATE helpers in src/db.rs with runtime sqlx::query(). This is a documented, acceptable trade-off — but it removes the compile-time guarantee that column names, bind count, and SQL syntax stay in sync with the schema for exactly these five statements.
PR #791 already added an excellent sentinel-based positional-alignment test for the bonds INSERT (bond_insert_column_bind_alignment in src/app/bond/db.rs). This issue tracks extending that same safety net to the migrated UPDATEs.
Scope
Add in-memory SQLite smoke tests (module src/db.rs) for each of the 5 helpers, asserting the expected column(s) actually changed and untouched columns did not:
Why
These are fixed SQL over orders / users primary keys, so runtime risk is low — but a future schema change (renamed/dropped column) would now only surface at runtime instead of at compile time. A cheap per-helper test closes that gap and mirrors the coverage the bonds INSERT already enjoys.
Notes
Context
PR #791 replaced the five compile-time-checked
sqlx::query!UPDATE helpers insrc/db.rswith runtimesqlx::query(). This is a documented, acceptable trade-off — but it removes the compile-time guarantee that column names, bind count, and SQL syntax stay in sync with the schema for exactly these five statements.PR #791 already added an excellent sentinel-based positional-alignment test for the bonds INSERT (
bond_insert_column_bind_alignmentinsrc/app/bond/db.rs). This issue tracks extending that same safety net to the migrated UPDATEs.Scope
Add in-memory SQLite smoke tests (module
src/db.rs) for each of the 5 helpers, asserting the expected column(s) actually changed and untouched columns did not:update_order_to_initial_state(10 binds — highest value)reset_order_taken_at_timeupdate_order_invoice_held_at_timeupdate_user_trade_indexupdate_user_ratingWhy
These are fixed SQL over
orders/usersprimary keys, so runtime risk is low — but a future schema change (renamed/dropped column) would now only surface at runtime instead of at compile time. A cheap per-helper test closes that gap and mirrors the coverage the bonds INSERT already enjoys.Notes
src/app/bond/db.rs.