UPSERT wire contract
Language clients use the existing source wire variants insert_values and insert_from; no compiler endpoint or second operation is required.
Attach onConflict as either {"type":"do_nothing","targets":["id"]} or {"type":"do_update","targets":["id"],"sets":{...}}.
do_nothing may omit targets for PostgreSQL, SQLite, and DuckDB. Supply a named conflict key for Oracle, SQL Server, and DB2 because their native MERGE form needs that key for its ON clause.
Named do_update compiles natively on PostgreSQL, SQLite, DuckDB, Oracle, SQL Server, and DB2; Oracle, SQL Server, and DB2 emit MERGE.
MySQL supports do_update only with an explicit empty targets array: {"type":"do_update","targets":[],"sets":{...}}. It emits `ON DUPLICATE KEY UPDATE`, which applies to any duplicate unique key. Named targets are rejected because MySQL cannot name a specific conflicting key. MySQL also rejects do_nothing, because INSERT IGNORE suppresses non-conflict errors too.
RETURNING/OUTPUT on UPSERT is available for PostgreSQL, SQLite, DuckDB, and SQL Server. Oracle, DB2, and MySQL reject it for native UPSERT forms.