Skip to main content

Module trigger

Module trigger 

Source
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, and Transaction dereferences to Connection, 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, or DELETE FROM triggers; it names the transition it wants and this module decides the SQL and the guard.

Structs§

EnqueueRequest
One request for demand. filters are the --only ticket 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.
QueuedTrigger
A queued trigger as the dispatcher sees it: the demand plus what it points at. Convert with Trigger::from to 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.