pub enum ConflictMode {
Error,
Skip,
}Expand description
ConflictMode : What the target does with a row that collides with one already present. error is a plain INSERT (the default, and the behaviour of every run before #1216). skip is INSERT ... ON CONFLICT DO NOTHING, which makes re-sending an already-applied batch a no-op – the only thing that lets a run resume across the window where the previous attempt’s last batch may or may not have committed. skip is refused with a 400 if the target table has no unique constraint covering the mapped columns, since ON CONFLICT DO NOTHING would then never fire and would duplicate rather than skip.
What the target does with a row that collides with one already present. error is a plain INSERT (the default, and the behaviour of every run before #1216). skip is INSERT ... ON CONFLICT DO NOTHING, which makes re-sending an already-applied batch a no-op – the only thing that lets a run resume across the window where the previous attempt’s last batch may or may not have committed. skip is refused with a 400 if the target table has no unique constraint covering the mapped columns, since ON CONFLICT DO NOTHING would then never fire and would duplicate rather than skip.
Variants§
Trait Implementations§
Source§impl Clone for ConflictMode
impl Clone for ConflictMode
Source§fn clone(&self) -> ConflictMode
fn clone(&self) -> ConflictMode
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ConflictMode
Source§impl Debug for ConflictMode
impl Debug for ConflictMode
Source§impl Default for ConflictMode
impl Default for ConflictMode
Source§fn default() -> ConflictMode
fn default() -> ConflictMode
Source§impl<'de> Deserialize<'de> for ConflictMode
impl<'de> Deserialize<'de> for ConflictMode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for ConflictMode
impl Display for ConflictMode
impl Eq for ConflictMode
Source§impl Hash for ConflictMode
impl Hash for ConflictMode
Source§impl Ord for ConflictMode
impl Ord for ConflictMode
Source§fn cmp(&self, other: &ConflictMode) -> Ordering
fn cmp(&self, other: &ConflictMode) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for ConflictMode
impl PartialEq for ConflictMode
Source§impl PartialOrd for ConflictMode
impl PartialOrd for ConflictMode
Source§impl Serialize for ConflictMode
impl Serialize for ConflictMode
impl StructuralPartialEq for ConflictMode
Auto Trait Implementations§
impl Freeze for ConflictMode
impl RefUnwindSafe for ConflictMode
impl Send for ConflictMode
impl Sync for ConflictMode
impl Unpin for ConflictMode
impl UnsafeUnpin for ConflictMode
impl UnwindSafe for ConflictMode
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.