• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

joaoh82 / rust_sqlite / 27238748281
70%

Build:
DEFAULT BRANCH: main
Ran 09 Jun 2026 10:07PM UTC
Jobs 1
Files 62
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

09 Jun 2026 10:02PM UTC coverage: 69.262% (+0.03%) from 69.235%
27238748281

push

github

web-flow
feat(sql): HAVING — post-aggregation filter (SQLR-52) (#161)

WHERE filters rows before grouping; HAVING filters groups after
aggregation. Closes the Phase 9e aggregates story.

Parser (src/sql/parser/select.rs):
- SelectQuery grows `having: Option<Expr>`, passed through raw from
  sqlparser like WHERE. parse_aggregate_call / AggregateFn::from_name
  exposed pub(crate) for the executor's HAVING lowering.
- HAVING without GROUP BY rejected with a typed NotImplemented (the
  degenerate single-group form SQLite allows isn't worth the executor
  branch in v0). HAVING + JOIN stays covered by the existing
  GROUP-BY-over-JOIN rejection (SQLR-6 is the follow-up).

Executor (src/sql/executor.rs):
- lower_having_expr rewrites aggregate calls in the HAVING tree to
  identifiers naming their output slot (SUM(salary) → "SUM(salary)"),
  registering hidden trailing projection slots for aggregates and
  GROUP BY keys referenced only in HAVING so aggregate_rows computes
  them alongside the visible ones.
- New GroupRowScope resolves those identifiers against the group's
  output row through the shared expression evaluator — comparisons,
  AND/OR/NOT, arithmetic, IS NULL, LIKE, IN all work, with the same
  NULL-as-false collapse WHERE applies (design-decisions §13).
- filter_groups_by_having runs after aggregation, before DISTINCT /
  ORDER BY / LIMIT; hidden slots are stripped after filtering.

Tests: +13 executor tests (612 → 625 in the engine suite): COUNT/SUM
thresholds, aggregate alias, aggregate-only-in-HAVING, group-key-only-
in-HAVING, compound AND, ORDER BY/LIMIT composition, all-groups-
excluded, NULL-aggregate collapse, lowercase call form, no-GROUP-BY
rejection, out-of-scope column rejection, all four JOIN flavors
rejected cleanly.

Docs: supported-sql.md (HAVING semantics section + syntax block),
sql-engine.md aggregation pipeline, roadmap.md shipped entry, README,
design-decisions §13 wording, web docs page / sql-ref / roadmap.

Co-authored-by: Claude F... (continued)

135 of 191 new or added lines in 2 files covered. (70.68%)

11616 of 16771 relevant lines covered (69.26%)

1.25 hits per line

Uncovered Changes

Lines Coverage ∆ File
54
81.56
-1.08% src/sql/executor.rs
2
69.26
0.96% src/sql/parser/select.rs
Jobs
ID Job ID Ran Files Coverage
1 27238748281.1 09 Jun 2026 10:07PM UTC 62
69.26
GitHub Action Run
Source Files on build 27238748281
  • Tree
  • List 62
  • Changed 2
  • Source Changed 0
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • d285c383 on github
  • Prev Build on main (#26806675771)
  • Next Build on main (#27239248152)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc