Builds an "upsert". SQLite and PostgreSQL get ON CONFLICT ... DO UPDATE:
on conflict for conflictColumns, the listed update columns (or all
non-conflict columns by default) are overwritten with the incoming values
via the excluded pseudo-row. MySQL and MariaDB get
ON DUPLICATE KEY UPDATE col = VALUES(col), which reacts to a conflict on any
unique key of the table, so conflictColumns should name the primary key or
the unique key you mean. MySQL and MariaDB report 2 affected rows when the
update changed the row, 1 for an insert, and 0 when nothing changed.
Builds an "upsert". SQLite and PostgreSQL get
ON CONFLICT ... DO UPDATE: on conflict forconflictColumns, the listedupdatecolumns (or all non-conflict columns by default) are overwritten with the incoming values via theexcludedpseudo-row. MySQL and MariaDB getON DUPLICATE KEY UPDATE col = VALUES(col), which reacts to a conflict on any unique key of the table, soconflictColumnsshould name the primary key or the unique key you mean. MySQL and MariaDB report 2 affected rows when the update changed the row, 1 for an insert, and 0 when nothing changed.