-
Notifications
You must be signed in to change notification settings - Fork 0
Description
-
AST (ast.rs)
[ ] Add UnionClause struct (contains left and right queries)
[ ] Add UnionAllClause struct (or use a flag)
[ ] Consider: UNION might need a different Query structure (multiple queries combined) -
Clause enum (clauses.rs)
[ ] Add Union(UnionClause) variant
[ ] Add UnionAll(UnionClause) variant (or use a flag) -
Parser functions (clauses.rs)
[ ] Add union_clause() parser function
[ ] Add union_all_clause() parser function
[ ] Parse two complete queries separated by UNION -
Clause dispatcher (clauses.rs)
[ ] Add UNION to clause() function's alt() parser
[ ] Add UNION ALL to clause() function's alt() parser -
Query assembly (clauses.rs)
[ ] Handle UNION in parse_query() - may need different structure
[ ] UNION combines two queries, so Query struct might need unions: Vec -
Clause order validation (clauses.rs)
[ ] Add UNION to validate_clause_order() state machine
[ ] UNION must connect two complete queries (both must have RETURN)
[ ] UNION can only appear between complete queries -
Clause name function (clauses.rs)
[ ] Add Clause::Union() => "UNION" to clause_name()
[ ] Add Clause::UnionAll() => "UNION ALL" to clause_name() -
Validation extraction (validation.rs)
[ ] Add UNION clause extraction in extract_query_elements()
[ ] Validate both sides of UNION have compatible RETURN columns -
Tests (clauses.rs)
[ ] Add parsing tests (UNION, UNION ALL)
[ ] Add clause order validation tests
[ ] Add validation extraction tests
[ ] Test RETURN column compatibility -
Documentation
[ ] Update PARSER_INTERNALS.md
[ ] Update CHANGELOG.md -
Special considerations
[ ] UNION requires rethinking Query structure (combines two queries)
[ ] Both sides of UNION must have RETURN clauses
[ ] RETURN columns must be compatible (same number, compatible types)