pub struct NormalizedMutation {Show 13 fields
pub action: Action,
pub table: String,
pub columns: Vec<Expr>,
pub payload: Vec<MutationClause>,
pub filters: Vec<MutationClause>,
pub returning: Option<Vec<Expr>>,
pub on_conflict: Option<OnConflict>,
pub source_query: Option<Box<Qail>>,
pub default_values: bool,
pub overriding: Option<OverridingKind>,
pub from_tables: Vec<String>,
pub using_tables: Vec<String>,
pub only_table: bool,
}Expand description
Canonical representation for the rewrite-safe subset of mutation queries.
Fields§
§action: Action§table: String§columns: Vec<Expr>§payload: Vec<MutationClause>§filters: Vec<MutationClause>§returning: Option<Vec<Expr>>§on_conflict: Option<OnConflict>§source_query: Option<Box<Qail>>§default_values: bool§overriding: Option<OverridingKind>§from_tables: Vec<String>§using_tables: Vec<String>§only_table: boolImplementations§
Source§impl NormalizedMutation
impl NormalizedMutation
Sourcepub fn cleaned(&self) -> Self
pub fn cleaned(&self) -> Self
Apply deterministic cleanup on supported mutation shapes.
Cleanup rules:
- merge multiple
SETpayload cages into one (preserving assignment order) - merge all
ANDfilter clauses into one clause - merge all
ORfilter clauses into one clause - remove empty filter clauses
- sort and dedupe filter conditions
Sourcepub fn canonicalized(&self) -> Self
pub fn canonicalized(&self) -> Self
Return a canonicalized clone for structural comparison.
Sourcepub fn equivalent_shape(&self, other: &Self) -> bool
pub fn equivalent_shape(&self, other: &Self) -> bool
Compare two normalized mutations under the supported-subset semantics.
Trait Implementations§
Source§impl Clone for NormalizedMutation
impl Clone for NormalizedMutation
Source§fn clone(&self) -> NormalizedMutation
fn clone(&self) -> NormalizedMutation
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NormalizedMutation
impl Debug for NormalizedMutation
Source§impl PartialEq for NormalizedMutation
impl PartialEq for NormalizedMutation
Source§impl TryFrom<&Qail> for NormalizedMutation
impl TryFrom<&Qail> for NormalizedMutation
impl StructuralPartialEq for NormalizedMutation
Auto Trait Implementations§
impl Freeze for NormalizedMutation
impl RefUnwindSafe for NormalizedMutation
impl Send for NormalizedMutation
impl Sync for NormalizedMutation
impl Unpin for NormalizedMutation
impl UnsafeUnpin for NormalizedMutation
impl UnwindSafe for NormalizedMutation
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