pub enum WriteMode {
Insert,
Skip,
Upsert,
}Expand description
Host-facing conflict semantics for a batched write.
Maps onto the same per-dialect SQL the cross-DB copy path uses
(IfExists); exposed as its own enum so the write API names the
write intent (insert / skip / upsert) rather than the copy-time
“what if the target exists” framing.
Variants§
Insert
Plain INSERT. A primary-key / unique conflict surfaces as a
driver error and rejects the batch (or, under
WriteOptions::isolate_failures, the offending rows).
Skip
Insert rows whose key is new; silently skip rows whose key
already exists (ON CONFLICT DO NOTHING / INSERT IGNORE /
MERGE … WHEN NOT MATCHED). Requires conflict columns.
Upsert
Insert new rows; overwrite the non-key columns of rows whose key
already exists (ON CONFLICT DO UPDATE / ON DUPLICATE KEY UPDATE / full MERGE). Requires conflict columns.
Trait Implementations§
impl Copy for WriteMode
impl Eq for WriteMode
impl StructuralPartialEq for WriteMode
Auto Trait Implementations§
impl Freeze for WriteMode
impl RefUnwindSafe for WriteMode
impl Send for WriteMode
impl Sync for WriteMode
impl Unpin for WriteMode
impl UnsafeUnpin for WriteMode
impl UnwindSafe for WriteMode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.