pub struct RiskEngine {
pub row_counts: HashMap<String, u64>,
pub live_schema: Option<LiveSchema>,
}Fields§
§row_counts: HashMap<String, u64>Estimated rows per table – supplied by the user via –table-rows flag OR imported from the live database via –db-url.
live_schema: Option<LiveSchema>Optional live schema snapshot fetched via –db-url.
Implementations§
Source§impl RiskEngine
impl RiskEngine
pub fn new(row_counts: HashMap<String, u64>) -> Self
Sourcepub fn with_live_schema(
row_counts: HashMap<String, u64>,
live: LiveSchema,
) -> Self
pub fn with_live_schema( row_counts: HashMap<String, u64>, live: LiveSchema, ) -> Self
Create an engine seeded from a live database snapshot.
Row counts from live override any manually provided row_counts.
Sourcepub fn analyze(
&self,
file: &str,
statements: &[ParsedStatement],
) -> MigrationReport
pub fn analyze( &self, file: &str, statements: &[ParsedStatement], ) -> MigrationReport
Run every rule against the parsed statements and build a graph, then return the final report for the file.
Auto Trait Implementations§
impl Freeze for RiskEngine
impl RefUnwindSafe for RiskEngine
impl Send for RiskEngine
impl Sync for RiskEngine
impl Unpin for RiskEngine
impl UnsafeUnpin for RiskEngine
impl UnwindSafe for RiskEngine
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
Mutably borrows from an owned value. Read more
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>
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 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>
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