pub enum ConflictResolution {
Rollback,
Abort,
Fail,
Ignore,
Replace,
}Expand description
The SQLite OR <action> conflict-resolution algorithm on the mutation verb —
INSERT OR {REPLACE | IGNORE | ABORT | FAIL | ROLLBACK} and the same tail on
UPDATE. It selects what SQLite does when the statement hits a constraint
violation, so it carries genuine new information (which algorithm) rather than a
surface spelling; the Insert::or_action / Update::or_action slot models it
and the parser gates it on MutationSyntax::or_conflict_action.
This is distinct from two same-named neighbours: it is not the PostgreSQL
ConflictAction (the ON CONFLICT DO {NOTHING | UPDATE} upsert action — a
different construct in a different clause position, which SQLite also has and which
maps to Insert::upsert); and its Replace variant is not the
InsertVerb::Replace statement spelling — INSERT OR REPLACE and REPLACE INTO
are equivalent SQLite semantics written as different source texts, so each keeps its
own representation and round-trips through it (one is never folded onto the other).
Variants§
Rollback
OR ROLLBACK — abort the statement and roll back the enclosing transaction.
Abort
OR ABORT — abort the statement, reverting its own prior changes (the default
resolution when no OR <action> is written).
Fail
OR FAIL — abort the statement without reverting the rows it already changed.
Ignore
OR IGNORE — skip the offending row and continue the statement.
Replace
OR REPLACE — delete the conflicting rows, then insert/update the new one.
Trait Implementations§
Source§impl Clone for ConflictResolution
impl Clone for ConflictResolution
Source§fn clone(&self) -> ConflictResolution
fn clone(&self) -> ConflictResolution
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 ConflictResolution
Source§impl Debug for ConflictResolution
impl Debug for ConflictResolution
Source§impl<'de> Deserialize<'de> for ConflictResolution
impl<'de> Deserialize<'de> for ConflictResolution
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>,
impl Eq for ConflictResolution
Source§impl Hash for ConflictResolution
impl Hash for ConflictResolution
Source§impl PartialEq for ConflictResolution
impl PartialEq for ConflictResolution
Source§impl Render for ConflictResolution
impl Render for ConflictResolution
Source§fn render(&self, _ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
fn render(&self, _ctx: &RenderCtx<'_>, f: &mut Formatter<'_>) -> Result
Source§fn operand_binding_power(&self) -> Option<BindingPower>
fn operand_binding_power(&self) -> Option<BindingPower>
None (the default) for a self-delimiting node — an atom, call, or
constructor — that never needs parentheses. Read more