pub struct Plan {
pub id: PlanId,
pub groups: Vec<TransactionGroup>,
pub intents: Vec<DestructiveIntent>,
pub lint_waivers: Vec<LintWaiver>,
pub step_overrides: Vec<StepOverride>,
pub metadata: PlanMetadata,
pub advisory_findings: Vec<RecordedFinding>,
}Expand description
The canonical in-memory representation of a plan.
Fields§
§id: PlanIdDeterministic identity hash; see PlanId::compute.
groups: Vec<TransactionGroup>Steps partitioned into transaction groups; each step’s step_no and
intent_id are filled in by Plan::from_grouped.
intents: Vec<DestructiveIntent>Destructive intents, one per destructive step, in step order.
lint_waivers: Vec<LintWaiver>Lint waivers loaded from [[lint_waiver]] rows in intent.toml.
When pgevolve plan detects unwaived LintAtPlan findings, it prints
an example [[lint_waiver]] row to stderr for the user to copy into
intent.toml; the field is omitted from serialized output when empty
(skip_serializing_if = "Vec::is_empty"). The field is populated when
reading back a plan directory whose intent.toml already contains
[[lint_waiver]] rows.
step_overrides: Vec<StepOverride>Step overrides loaded from [[step_override]] rows in intent.toml.
Each row can suppress a specific auto-emitted step at apply time.
The executor checks this list before running each step and skips
(recording as skipped in the audit log) any step whose kind
and primary target match an override with suppress = true.
metadata: PlanMetadataPlan metadata.
advisory_findings: Vec<RecordedFinding>Advisory (Warning-severity) lint findings produced at plan time.
These are informational — they never block plan construction — and are not persisted to disk. Callers (CLI, conformance tests) can inspect this field and print or assert on them as needed.
Currently populated by the pgevolve::api::build_plan shim from
crate::lint::check_changeset (changeset-level rules such as
storage-downgrade-not-retroactive and
compression-change-not-retroactive).
Implementations§
Source§impl Plan
impl Plan
Sourcepub fn from_grouped(
groups: Vec<TransactionGroup>,
source: &Catalog,
target: &Catalog,
target_identity: String,
source_rev: Option<String>,
pgevolve_version: &str,
planner_ruleset_version: u32,
) -> Result<Self, PlanError>
pub fn from_grouped( groups: Vec<TransactionGroup>, source: &Catalog, target: &Catalog, target_identity: String, source_rev: Option<String>, pgevolve_version: &str, planner_ruleset_version: u32, ) -> Result<Self, PlanError>
Assemble a Plan from a step-grouped output of the rewrite pass.
Walks groups in order to:
- Assign 1-indexed
step_noto every step (continuous across groups). - Allocate a
DestructiveIntent(andintent_id) for every destructive step, in step order. - Compute the deterministic
PlanIdover(source, target, version, ruleset_version).
target_identity is opaque to the planner — the executor binary
computes it from (host, port, dbname, system_identifier) at apply time.
§Errors
Returns PlanError::Internal if the source or target catalog cannot be
serialized to JSON for hashing (see PlanId::compute).
Sourcepub fn approve_all_intents(&mut self)
pub fn approve_all_intents(&mut self)
Mark every destructive intent as approved = true.
Intended for test harnesses that build plans programmatically and
want to bypass the intent.toml-based approval workflow. Production
apply must continue to require explicit approval in intent.toml.
Trait Implementations§
impl StructuralPartialEq for Plan
Auto Trait Implementations§
impl Freeze for Plan
impl RefUnwindSafe for Plan
impl Send for Plan
impl Sync for Plan
impl Unpin for Plan
impl UnsafeUnpin for Plan
impl UnwindSafe for Plan
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more