Expand description
Trigger storage: every statement that reads or writes a trigger.
The pure half of the concept lives in crate::domain::trigger; this is
the coordination half. Two rules keep the concept owned rather than
scattered:
- Each statement is written once. The functions here take
&Connection, andTransactiondereferences toConnection, so a caller inside a transaction and a caller on its own lock share one statement instead of two copies that drift. - Every write is a named transition. No call site outside this module
spells
INSERT INTO triggers,UPDATE triggers, orDELETE FROM triggers; it names the transition it wants and this module decides the SQL and the guard.
Structs§
- Enqueue
Request - One request for demand.
filtersare the--onlyticket ids, which are part of the request rather than a follow-up write — see [enqueue]. - Enqueued
- NewTrigger
- A trigger row to be inserted. The id is supplied because minting it is a
separate reservation; [
enqueue] is the verb that does both. - Queued
Trigger - A queued trigger as the dispatcher sees it: the demand plus what it points
at. Convert with
Trigger::fromto ask the domain a question about it.
Enums§
- Duplicates
- What to do when the requested demand already exists as a queued trigger. The two creation paths genuinely disagree, so the disagreement is an argument rather than a property of which function was called.