Skip to content

Expand query DSL support for null checks, set ops, and distinct-style queries#80

Closed
elcritch wants to merge 6 commits intoAraq:masterfrom
elcritch:add-sql
Closed

Expand query DSL support for null checks, set ops, and distinct-style queries#80
elcritch wants to merge 6 commits intoAraq:masterfrom
elcritch:add-sql

Conversation

@elcritch
Copy link
Copy Markdown
Contributor

Summary

This PR expands the query DSL with a few common SQL features and tightens the
test/docs coverage around them.

Added

  • NULL support in expressions
    • nil / null literals
    • == nil -> IS NULL
    • != nil -> IS NOT NULL
  • exists(...) / not exists(...)
  • query-level DISTINCT
    • select \distinct` Post(author)`
    • existing count(distinct author) support remains
  • query-level UNIQUE as a synonym for distinct
    • select unique Post(author)
  • set operations
    • call form still works: union(...), intersect(...), `except`(...)
    • infix form now also works:
      query:
        select person(id) where id <= 2
        union
        select person(id) where id >= 4

Docs / cleanup

  • removed stale completed TODOs from README.md

  • updated README examples to reflect the current DSL forms

  • added/updated regression tests for the new syntax

  • mixed infix set-op chains like a union b intersect c are still rejected

  • complex join variants (leftjoin, rightjoin, fulljoin) are still deferred

@elcritch
Copy link
Copy Markdown
Contributor Author

The parser changes were pretty simple for these. Nice!

@elcritch elcritch closed this Apr 16, 2026
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