pub enum Or {
Rollback,
Abort,
Replace,
Fail,
Ignore,
}Expand description
The conflict-clause of an INSERT or UPDATE: INSERT OR REPLACE INTO …,
UPDATE OR IGNORE ….
From https://www.sqlite.org/lang_insert.html and https://www.sqlite.org/lang_update.html:
INSERT OR { ROLLBACK | ABORT | REPLACE | FAIL | IGNORE } INTO …
UPDATE OR { ROLLBACK | ABORT | REPLACE | FAIL | IGNORE } …ABORT is the default and there is no reason to write it, but it is one of
the five keywords the grammar lists rather than an absence, so it is
representable — unlike PostgreSQL’s ALL on a SELECT, which adds nothing at
all. A DELETE has no such clause, which is why nothing in
delete mentions one.
SQLite’s standalone REPLACE INTO t … is exactly INSERT OR REPLACE INTO t …;
only the longer spelling is produced, because the two are the same statement
and one spelling is enough.
Variants§
Rollback
OR ROLLBACK — abort the whole transaction.
Abort
OR ABORT — the default: abort this statement, keep the transaction.
Replace
OR REPLACE — delete the rows that conflict, then insert.
Fail
OR FAIL — stop, but keep the changes already made by this statement.
Ignore
OR IGNORE — skip the offending row and carry on.