Skip to main content

Module engine

Module engine 

Source
Expand description

The run engine’s parts around a Binding’s run (crate::run):

  • the plan: which Bindings run, with every profile’s entry checked (crate::run::plan);
  • the executor: runs a plan on a worker thread, cancellable through a CancelToken, reporting what happens as RunEvents on a channel. The terminal UI, --log-format json, the log file and run_results.json are consumers; whoever drives the run decides how events look (dispatch replays them into a Ui);
  • the RunStore: where a run’s files go in the target path.

Structs§

CancelToken
Asks a run to stop. Clones share the request; the first reason given sticks.
Events
Where a running Binding sends its events. Cheap to clone, and Send: the executor’s worker and plugins’ stderr readers hold one each.
RunStore
Where a run’s files go in the target path, for one Binding (<report>/<binding>): compiled/ (rendered SQL), run/ (outputs and run_results.json) and schema/ (the schema snapshot drift is checked against).

Enums§

CancelReason
Why a run was asked to stop.
RunEvent
Something that happened during a run.

Functions§

dispatch
Replay an event into a Ui. plugin_log and sql_log are the UI’s own sinks, taken once before the run.