#[non_exhaustive]pub struct EvolutionAnswers {
pub parameterized_string_widening_is_lossless: bool,
pub nested_field_addition_is_lossless: bool,
}Expand description
What this engine keeps through a change to a table that already holds rows.
Every answer defaults to false, which means nothing has been measured
rather than this engine loses data. Razeri’s classifier treats a change it
cannot prove keeps every value as one that does not, so a silence here costs
an operator a warning they can read and never costs them a row.
An answer only ever makes a verdict gentler. Razeri proves what it can from the types themselves first; these answers are asked afterwards, about the changes the engine’s own spelling left unprovable.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.parameterized_string_widening_is_lossless: boolThis engine widens a string’s declared length in place, keeping every value.
A column declared varchar(10) and now declared varchar(40) holds a
strict superset of what it held, as a type. Whether the engine gets it
there without rewriting the column is the engine’s own business, and
this is where it says so.
The question is asked at all because a length is spelled differently on
every engine — VARCHAR(40) on one, STRING(40) on another,
NVARCHAR(40) on a third — and the length in a spelling Razeri does not
write is a length Razeri cannot read back. A true here is the dialect
saying “that pair is a widening on my engine, and nothing is lost”.
nested_field_addition_is_lossless: boolThis engine adds a field to a record a table already holds, keeping every value.
The change is a record column that gained a field and changed in no other way. Some engines take it as a change to the column’s declared shape and keep every row; others have no way to make it at all, and the column has to be rebuilt.
false is the careful answer, and it is the right one for every engine
that has no records to begin with.
Implementations§
Source§impl EvolutionAnswers
impl EvolutionAnswers
Sourcepub const fn widening_a_string_in_place() -> Self
pub const fn widening_a_string_in_place() -> Self
This engine widens a string’s declared length in place. See
EvolutionAnswers::parameterized_string_widening_is_lossless.
Sourcepub const fn and_a_nested_field(self) -> Self
pub const fn and_a_nested_field(self) -> Self
The same answers with the nested-field one added, so an engine that keeps both states both without a constructor per pair.
Trait Implementations§
Source§impl Clone for EvolutionAnswers
impl Clone for EvolutionAnswers
Source§fn clone(&self) -> EvolutionAnswers
fn clone(&self) -> EvolutionAnswers
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more