> Always try UPDATE first. Get affected rows.
> If 0 affected rows, try INSERT. Get affected rows.
> If 0 affected rows, throw error (give user the chance to make a decision, e.g. retry).

Let's prepare a separate pr for this @bantu @icewind1991 Can you please take care? THX