Skip to main content

Crate alembic_engine

Crate alembic_engine 

Source
Expand description

engine orchestration: load, validate, plan, apply.

Re-exports§

pub use external::run_external_adapter;
pub use external::ExternalAdapter;
pub use external::ExternalEnvelope;
pub use external::ExternalObject;
pub use external::ExternalRequest;
pub use external::ExternalResponse;
pub use external::EXTERNAL_PROTOCOL_VERSION;

Modules§

external
helpers for implementing external adapters.
journal
Keep track of successfully applied ops to enable resume after an error.
mapping
shared mapping helpers used by multiple adapters.

Macros§

alembic_external_main
convenience macro to define an external adapter main.

Structs§

AppliedOp
result for a single applied operation.
ApplyReport
aggregated apply report.
ChangedEntry
an object present in both intent and backend, but with diverging fields.
DriftEntry
an object that exists on only one side of the diff (missing or extra).
DriftReport
read-only report of how observed backend state diverges from declared intent.
FieldChange
field-level change for an update op.
ImportReport
MapSpec
a map specification: the target schema plus the transformation rules.
ObservedObject
observed backend object representation.
ObservedState
observed backend state indexed by id and key.
Plan
full plan document.
PlanSummary
high-level summary of plan operations.
ProvisionReport
report from ensure_schema provisioning.
RetryApplyResult
StateData
on-disk state schema.
StateStore
state store wrapper with load/save helpers.
TransformsSpec
the transforms: block of a map spec: starlark source from a file or inline. exactly one of the two must be set.

Enums§

AdapterApplyError
Backend
a constructed backend, tagged with its capability.
BackendId
generic backend identifier (integer or string/uuid).
Op
plan operation.
PostgresTlsMode
TLS configuration for postgres state backend connections.

Traits§

Adapter
full adapter contract for read+write backends; may also provision schema.
Emitter
write capability: apply a plan’s operations.
Observer
read capability: observe backend state.
RetryApplyDriver

Functions§

apply_non_delete_with_retries
apply_plan
apply a plan and update the state store. full adapters provision schema before writing; emitters only write.
build_key_from_schema
build_plan
observe backend state and produce a deterministic plan.
build_request_body
compile_map
transform an ir inventory into another ir inventory under the target schema.
eval_map_transform
evaluate a single named transform from a map spec against a json value, consulting the spec’s user transforms first, then the built-ins. backs alembic map transform, the iteration loop for writing transforms: one value in, the typed result out, no inventory or backend involved.
import_inventory
load_inventory
load a inventory file (yaml or json) and merge any includes.
load_map_spec
load a map spec from a yaml file. the spec remembers the file’s directory so transforms.file and starlark load() paths resolve relative to it.
plan
build a deterministic plan from desired and observed state.
query_filters_from_key
report_to_result
helper to format a validation report into a Result.
report_to_result_with_sources
helper to format a validation report with source locations into a Result.
resolve_value_for_type
sort_ops_for_apply
order operations for apply: creates/updates first (topologically sorted so referenced objects are created before the objects that reference them), then deletes (reverse-toposorted so an object is deleted only after everything referencing it). reference cycles fall back to a stable order.
validate
validate an inventory and return the report.