Skip to content

Add comprehensive SQL parser integration tests#14

Merged
dannywillems merged 4 commits intomainfrom
danny/parser-comprehensive-tests
Feb 11, 2026
Merged

Add comprehensive SQL parser integration tests#14
dannywillems merged 4 commits intomainfrom
danny/parser-comprehensive-tests

Conversation

@dannywillems
Copy link
Contributor

Summary

  • Add 154 integration tests in crates/oxide-sql-core/tests/parser_comprehensive.rs
  • Cover every parser feature: SELECT (columns, FROM, JOIN, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT/OFFSET), INSERT, UPDATE, DELETE, all operators (arithmetic, comparison, logical, bitwise), operator precedence, CASE, CAST, aggregate/custom functions, subqueries, EXISTS, parameters, data types, literals, and error cases
  • No changes to parser or lexer — tests use only the public API as an external consumer

Test plan

  • cargo test --test parser_comprehensive -p oxide-sql-core — 154 passed
  • make test — full suite passes
  • make lint — clippy clean

Cover every parser feature: SELECT columns, FROM/JOIN, WHERE,
GROUP BY, HAVING, ORDER BY, LIMIT/OFFSET, INSERT, UPDATE, DELETE,
all operators, precedence, CASE, CAST, functions, subqueries,
parameters, data types, and error cases.
Implement fmt::Display (using core::fmt) for every AST type so that
parse(sql).to_string() produces valid, re-parseable SQL. Add a
round_trip() helper to parser_comprehensive.rs that verifies the
rendered output is a fixed point (parse -> render -> parse -> render
produces identical strings).

Fix DataType::Double to render as DOUBLE (was DOUBLE PRECISION which
the parser cannot re-parse). Special-case EXISTS in FunctionCall
Display to avoid double parentheses.
@dannywillems dannywillems merged commit 2b32cd0 into main Feb 11, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant