Skip to content

test: add smoke tests for the 5 runtime UPDATE helpers migrated off query! #792

Description

@grunch

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:

  • update_order_to_initial_state (10 binds — highest value)
  • reset_order_taken_at_time
  • update_order_invoice_held_at_time
  • update_user_trade_index
  • update_user_rating

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions