pub struct ConflictChain { /* private fields */ }Expand description
An ON CONFLICT clause under construction.
Not a mod until an action is chosen — ON CONFLICT with no
DO NOTHING/DO UPDATE is not a clause — so do_nothing
or do_update has to be called.
Implementations§
Source§impl ConflictChain
impl ConflictChain
Sourcepub fn where_(self, predicate: impl IntoExpr) -> ConflictChain
pub fn where_(self, predicate: impl IntoExpr) -> ConflictChain
The index predicate: ON CONFLICT (a) WHERE ….
Matched against a partial unique index’s own definition, not evaluated per
row — which is why it is a method here and not the where_ mod that filters
which conflicting rows get updated. It hangs off the parenthesised column
list and cannot stand without one.
Sourcepub fn do_nothing(self) -> ConflictMod
pub fn do_nothing(self) -> ConflictMod
DO NOTHING — skip the conflicting row.
Sourcepub fn do_update(self, body: impl Mod<ConflictClause>) -> ConflictMod
pub fn do_update(self, body: impl Mod<ConflictClause>) -> ConflictMod
DO UPDATE SET … — the upsert.
The body is built from mods against
ConflictClause, which implements
HasSet and HasWhere: set, set_col, set_excluded and where_
all apply, and that where_ is the row filter.
Trait Implementations§
Source§impl Clone for ConflictChain
impl Clone for ConflictChain
Source§fn clone(&self) -> ConflictChain
fn clone(&self) -> ConflictChain
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for ConflictChain
impl !UnwindSafe for ConflictChain
impl Freeze for ConflictChain
impl Send for ConflictChain
impl Sync for ConflictChain
impl Unpin for ConflictChain
impl UnsafeUnpin for ConflictChain
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