Summary
Add MERGE statement support for upsert operations.
SQL:2003 Standard MERGE
MERGE INTO target USING source ON condition
WHEN MATCHED THEN UPDATE SET ...
WHEN NOT MATCHED THEN INSERT (cols) VALUES (vals)
Dialect Support
- MSSQL: Full MERGE support
- PostgreSQL: No MERGE (use INSERT ... ON CONFLICT)
- MySQL: No MERGE (use INSERT ... ON DUPLICATE KEY UPDATE)
- SQLite: No MERGE (use INSERT ... ON CONFLICT)
Design
- Add MergeNode to AST
- Printer generates MERGE for MSSQL, ON CONFLICT for PG/SQLite, ON DUPLICATE KEY for MySQL
- Single builder API that abstracts dialect differences
Action Items
Summary
Add MERGE statement support for upsert operations.
SQL:2003 Standard MERGE
Dialect Support
Design
Action Items