Skip to main content

GenerationVerifier

Struct GenerationVerifier 

Source
pub struct GenerationVerifier { /* private fields */ }
Expand description

Reparses a generated SQL file and audits it against a GenerationPlan.

The verifier extracts everything it needs from the plan up front into an owned [PlanSpec], so it does not borrow the plan — the caller can move the plan into the crate::generate::GenerationEngine to render, then verify the rendered file against the already-captured spec.

Implementations§

Source§

impl GenerationVerifier

Source

pub fn new(plan: &GenerationPlan) -> Self

A verifier for plan, defaulting to the plan’s output dialect (or MySQL when none is pinned).

Source

pub fn dialect(self, dialect: SqlDialect) -> Self

Override the dialect the generated SQL is parsed with.

Source

pub fn output_mode(self, mode: OutputMode) -> Self

Match verification to the renderer’s output mode.

Data-only output uses the compiled plan schema to decode rows because no DDL is present. Schema-only output checks DDL and expects no row data.

Source

pub fn membership_budget_bytes(self, bytes: usize) -> Self

Set the in-memory byte budget for each membership/uniqueness index before it spills to a protected spool. A small budget exercises the spill path.

Source

pub fn temp_directory(self, dir: impl Into<PathBuf>) -> Self

Store protected verification spools in dir instead of the OS temp directory. The directory must already exist.

Source

pub fn expect_distribution(self, expectation: DistributionExpectation) -> Self

Add an approximate distribution expectation, checked as CheckStatus::Sampled.

Source

pub fn verify_path( &self, path: &Path, ) -> Result<VerificationReport, GenerateError>

Reparse and audit path, returning the full report. Parses the file twice: once to reconstruct the schema from the emitted DDL, once to audit rows against the plan.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Allocation for T
where T: RefUnwindSafe + Send + Sync,

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> Fake for T

Source§

fn fake<U>(&self) -> U
where Self: FakeBase<U>,

Source§

fn fake_with_rng<U, R>(&self, rng: &mut R) -> U
where R: RngExt + ?Sized, Self: FakeBase<U>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V