Inspect Database Mutations
Every INSERT, UPDATE, and DELETE linked to the request that caused it.
Scenario: a database row is in an unexpected state and you don't know what changed it or when.
See the full mutation history for a row
$ flux state history users --id 42
users id=42 (4 mutations)
2026-03-10 12:00 INSERT email=a@b.com, plan=free req:1a2b3c4d
2026-03-10 14:21 UPDATE name: null → Alice Smith req:a3c91ef0
2026-03-10 14:22 UPDATE plan: free → pro req:4f9a3b2c
2026-03-10 14:22 UPDATE plan: pro → null (rolled back) req:550e8400
Every mutation is timestamped and linked to its request_id. The rollback on the last row tells you that req:550e8400 attempted a change but the transaction was rolled back — likely due to an error.
Find which request owns each column's current value
$ flux state blame users --id 42
email a@b.com req:1a2b3c4d 2026-03-10 12:00
name Alice req:a3c91ef0 2026-03-10 14:21
plan free req:550e8400 2026-03-10 14:22 ✗ rolled back
flux state blame shows the last successful write to each column. The ✗ rolled back marker means the most recent attempt was reverted — the current value comes from the previous successful write.
Trace a mutation back to its request
Each req: ID links directly to its execution record:
$ flux why 550e8400
ROOT CAUSE Stripe API timeout after 10s
LOCATION payments/create.ts:42
DATA CHANGES users.id=42 plan: free → null (rolled back)
Now you know exactly what caused the attempted mutation and why it was rolled back.
Filter mutations by time range
$ flux state history users --id 42 --since 24h
$ flux state history orders --id 81b2 --between 2026-03-10T14:00 2026-03-10T15:00
Filter mutations by request
# All tables mutated by a specific request
$ flux state history --request 550e8400
users id=42 plan: free → null (rolled back)
orders id=81b2 status: pending → null (rolled back)
Export mutation history
$ flux state history users --id 42 --format json > mutations.json
$ flux state history users --id 42 --format csv > mutations.csv