Open tprochazka opened 9 months ago
While I agree it would be nice to have, it's too database-vendor specific.
PostgreSQL:
... ON CONFLICT (column) DO ...
FirebirdSQL:
UPDATE OR INSERT INTO table ... MATCHING (column) ...
Implementing MERGE (that is SQL standard) makes more sense. However it seems that MySQL still doesn't support it.
The best, for now, is an ad-hoc query.
Would be really useful to have
It is the same like INSERT, just with REPLACE is used
Or
Useful when update should for example increment some column, change date, etc.
Reference: https://dev.mysql.com/doc/refman/8.0/en/replace.html https://dev.mysql.com/doc/refman/8.0/en/insert-on-duplicate.html