Support for UPSERT/conflict resolution clauses
This patch was authored and released by @gwynne.
Currently, the emitted syntax is compatible with SQLite and PostgreSQL, but not MySQL. Because MySQL diverges radically from the standard, considerable additional work would be needed to support it. Some design flaws still exist in this implementation, but it is possible to specify all of the common clauses needed for UPSERT
. There is no support for SQLite's ON CONFLICT ROLLBACK/ABORT/FAIL/IGNORE/REPLACE
syntax, nor for any of the more esoteric clauses supported by PostgreSQL. It doesn't seem useful to add that support; it's unlikely that a query requiring such specialized facilities would be portable across databases in any event.