ReviewOS

stacks/bun-query-builder

Add INTERSECT / EXCEPT set operators

#1049
Closed glennmichael123 opened this 2 months ago ·
2 months ago

Summary

union/unionAll exist as trivial text appenders; intersect/except/exceptAll are absent. Adding them mirrors the existing union methods almost verbatim (Postgres/SQLite native; MySQL 8.0.31+ for INTERSECT/EXCEPT, else document the gap).

Effort: S. Location: src/client.ts:~4474. (Note: fix the union param-merging bug #1029 first so the new ones don't inherit it.) Found via internal code audit.

9 days ago

Done in 6a8b4f4. Added intersect/intersectAll/except/exceptAll next to union/unionAll, reusing the same appendSetOp seam so params merge and Postgres $n placeholders renumber correctly across the operator (#1029). The ALL variants are Postgres/MySQL-only (SQLite has no INTERSECT ALL / EXCEPT ALL). Regression test added; full suite green.

Sign in to comment on this issue.