Skip to content

feat(query): add @aeye/query — LLM-friendly query language, runtime &…#180

Open
ClickerMonkey wants to merge 2 commits into
mainfrom
feat/aeye-query
Open

feat(query): add @aeye/query — LLM-friendly query language, runtime &…#180
ClickerMonkey wants to merge 2 commits into
mainfrom
feat/aeye-query

Conversation

@ClickerMonkey

Copy link
Copy Markdown
Owner

… SQL converter

New standalone package (packages/query):

  • Types/fields meta-model + class-based Expr system (one file per kind, Registry dispatch)
  • Relation-based joins, params, per-FieldType filters, functions (scalar/tabular/aggregate/window), array field type
  • In-memory runtime + base & postgres SQL converter (RLS/FLS, computed-field backing, named joins/LATERAL, three-valued NULL logic)
  • Dev-side Type backing (Access/Computed) so the conceptual model stays simple while fields map to columns/SQL/runtime fns
  • Graduated per-axis LLM schema depth + capability gating; strict/typed-args schemas
  • Transforms (drill-down, auto-paginate), cost estimation, type-from-data util
  • Examples folder + interactive CLI; README

100% test coverage (932 tests, base+postgres SQL + runtime), 0 typecheck errors, no any/unknown/casts. Wires packages/query into the workspace (root package.json, tsconfig.base.json).

Claude-Session: https://claude.ai/code/session_012aWFXmP2zN1wnX43EwRjBS

ClickerMonkey and others added 2 commits July 1, 2026 20:17
… SQL converter

New standalone package (packages/query):
- Types/fields meta-model + class-based Expr system (one file per kind, Registry dispatch)
- Relation-based joins, params, per-FieldType filters, functions (scalar/tabular/aggregate/window), array field type
- In-memory runtime + base & postgres SQL converter (RLS/FLS, computed-field backing, named joins/LATERAL, three-valued NULL logic)
- Dev-side Type backing (Access/Computed) so the conceptual model stays simple while fields map to columns/SQL/runtime fns
- Graduated per-axis LLM schema depth + capability gating; strict/typed-args schemas
- Transforms (drill-down, auto-paginate), cost estimation, type-from-data util
- Examples folder + interactive CLI; README

100% test coverage (932 tests, base+postgres SQL + runtime), 0 typecheck errors, no any/unknown/casts.
Wires packages/query into the workspace (root package.json, tsconfig.base.json).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012aWFXmP2zN1wnX43EwRjBS
…GROUP BY / ORDER BY / HAVING

`{ kind:'output', name }` delegates to the referenced select item's expression
(looked up by its `as` / natural name): expands to portable SQL (base+postgres)
and re-evaluates correctly at runtime (group keys over the source row; ORDER BY /
HAVING over the group, incl. aggregate targets). Offered by the LLM schema only
in groupBy/orderBy/having positions (gated out of the general Expr union), with
output.unknown / output.aggregate / output.not-available validation and drill-down
expansion. README "Output references" section. 100% coverage maintained (960 tests).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012aWFXmP2zN1wnX43EwRjBS
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