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
impl GenerationVerifier
Sourcepub fn new(plan: &GenerationPlan) -> Self
pub fn new(plan: &GenerationPlan) -> Self
A verifier for plan, defaulting to the plan’s output dialect (or MySQL
when none is pinned).
Sourcepub fn dialect(self, dialect: SqlDialect) -> Self
pub fn dialect(self, dialect: SqlDialect) -> Self
Override the dialect the generated SQL is parsed with.
Sourcepub fn output_mode(self, mode: OutputMode) -> Self
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.
Sourcepub fn membership_budget_bytes(self, bytes: usize) -> Self
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.
Sourcepub fn temp_directory(self, dir: impl Into<PathBuf>) -> Self
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.
Sourcepub fn expect_distribution(self, expectation: DistributionExpectation) -> Self
pub fn expect_distribution(self, expectation: DistributionExpectation) -> Self
Add an approximate distribution expectation, checked as
CheckStatus::Sampled.
Sourcepub fn verify_path(
&self,
path: &Path,
) -> Result<VerificationReport, GenerateError>
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§
impl Freeze for GenerationVerifier
impl RefUnwindSafe for GenerationVerifier
impl Send for GenerationVerifier
impl Sync for GenerationVerifier
impl Unpin for GenerationVerifier
impl UnsafeUnpin for GenerationVerifier
impl UnwindSafe for GenerationVerifier
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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