Skip to content

Support PostgreSQL group pages and SQL-visible ordinary aggregates - #111

Merged
Dastari merged 2 commits into
mainfrom
feat/portable-group-pages-20261002
Oct 3, 2026
Merged

Dastari merged 2 commits into
mainfrom
feat/portable-group-pages-20261002

Conversation

@Dastari

@Dastari Dastari commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

Complete tenant-visible event enumeration can now use fetch_group_page on PostgreSQL as well as SQLite. Reuse the existing typed builder, JSON cursor and Binary/SqliteNoCase modes: PostgreSQL groups exact original TEXT/VARCHAR values under C comparison, orders with explicit ASCII A–Z translation and original-byte tie-breaking under qualified pg_catalog."C", and continues with the identical expression in HAVING. Case-distinct names remain separate even on a nondeterministic/case-insensitive source column. An actual ORM reproduction exposed a user-defined public."C" shadow under explicit search_path; the qualified built-ins correct it. Blank exclusion also uses byte comparison, retaining non-empty Unicode values which an ICU source collation equates with empty. SQLite native grouping and comparison behavior is preserved. No fixed catalogue, capped replacement, raw SQL escape hatch or in-memory ledger scan is introduced; the API is retained.

Ordinary .fetch()/generated GraphQL aggregates now accept current Unrestricted or fully SQL-renderable Complete row visibility. Policy and caller filters are intersected before COUNT/SUM/grouping; entity/group/metric/filter field checks remain active. CallbackOnly/Prefilter fail closed. A provided aggregate enum identity hook avoids imposing a new 'static bound on existing generic fetch callers: generated enums supply it; handwritten implementations stay source compatible and need the token only for complete visibility.

Limits, nullable groups, optional metrics, strict cursor/context/auth bindings, DbAuthContext/RLS and static SDL are retained. Unsupported scalar/multi-key/storage profiles and MSSQL pages reject explicitly. Concurrent reads are statement snapshots, not a cross-request snapshot: new groups behind the cursor may be missed; groups ahead may appear. Refresh from None for a refreshed dropdown.

Scope/dependencies/version coordination

#110's eight-line documentation-date maintenance merged at 2f5dd8418f73a34995e9a1f16168cd4a6be533eb, removing an inherited release gate failure (#108). This PR now targets main. No dependency on runtime A–D, #97 or host timestamp #109. Remaining joined/computed queries, SQL Server summaries/pages and private generated views in #91 stay open.

Investigation starting main/release: 809d8946b7a3e2aa8f795818e36d2434a41e85cf, published workspace-2026.10.01.3 with ORM/macros 0.35.2. Current main base: 2f5dd8418f73a34995e9a1f16168cd4a6be533eb; tested implementation head: c7d564ffab8105e67c6f1932cc99a572c347313a. Propose aligned ORM/macros 0.38.0, above the independent pending 0.36.0/0.37.0 reservations. Reconcile later branch versions/locks/inventory with actual merge order; no pending branch is overwritten. No new feature, schema/data/SDL/cursor migration or license change. Latest release did not implement either gap.

Verification

All local builds used isolated worktrees, disk-backed TMPDIR, CARGO_BUILD_JOBS=2 and sequential backend lanes. No GEMA/Digibase/sibling files or application database access.

  • Full SQLite package suite at initial feature head: 401 passed / 11 ignored / 0 failed, including doc tests; ignored backend/compile fixtures are not live evidence. Final head reran affected SQLite tests and warnings-denied checks.
  • SQLite selected core regressions: 49 passed (28 library, 6 legacy complete-page, 6 portable-page, 5 grouped aggregate, 4 projection-policy). Standalone private consumer: 1 passed, plus example execution enumerating 1,225 original events in batches of 100 without query SQL/direct async-graphql dependency.
  • PostgreSQL verified disposable postgres:17-alpine containers: 8 portable execution tests passed, plus 1 existing grouped-metric test and 1 standalone-consumer example explicitly executed with --ignored. 29 library tests passed. Acceptance covers >1,300 groups, page sizes 100/1000 with lookahead, ASCII/case/Unicode, whitespace/nulls, COUNT/MIN/MAX/SUM, tenant/current policy, invalid cursors/bindings, independent field/entity checks, GraphQL context, nonowner RLS/DbAuthContext and concurrent-write behavior. Normal external-consumer all-targets compilation reports owned tests ignored; executable evidence is the explicit run above.
  • MSSQL: 34 library/rendering/rejection tests passed, external consumer/examples compile. No live MSSQL execution; pages remain unsupported before pool I/O, ordinary aggregate renderers/gates retained.
  • Macro units 6 passed per sqlite/postgres/mssql lane. Explicit SQLite+MSSQL coexistence fixture compiled, including AI/core consumers.
  • Warnings-denied Clippy: SQLite all-targets; PostgreSQL lib/tests; MSSQL focused supported targets. Warnings-denied Rustdoc all three backends passed. Known broader target-gating is tracked independently in Gate backend-specific examples and tests in explicit backend lanes #89; no all-targets PostgreSQL/MSSQL claim.
  • Formatting, dependency directions/trees, inventory/release-state, documentation 191 documents, package-release-policy, SemVer 1 changed library lane, deterministic release-manifest 6 tests passed.

Primary execution commands:

cargo test -p graphql-orm --locked --no-default-features --features sqlite --lib --test complete_group_pages --test portable_group_pages --test grouped_aggregates --test projection_visibility
cargo test -p graphql-orm --locked --no-default-features --features postgres --test portable_group_pages -- --ignored --test-threads=1
cargo run --manifest-path crates/graphql-orm/tests/fixtures/repository-aggregate-consumer/Cargo.toml --locked --no-default-features --features sqlite --example complete_events
cargo test --manifest-path crates/graphql-orm/tests/fixtures/repository-aggregate-consumer/Cargo.toml --locked --no-default-features --features postgres --test portable_groups -- --ignored --test-threads=1

CI and immutable release lanes explicitly execute these PostgreSQL regressions/example. Published immutable workspace-2026.10.03.1 at exact merge 3bff96b90ce19efa2bfc9cc71d3c95f45cad8c39: all 12 PR checks and all 20 release jobs passed. Protected deployment review recorded the owner's publication authorization through required-reviewer Dastari. Source-only release; no router binary or registry publication. Workspace/core/macro annotated tags resolve to the same merge source. Downloaded manifest/notes match the deterministic preview; checksums, lockfile hash and package source trees verified. Manifest SHA-256: 1a6ebbbcbb47312ccc351074c4fb990836ee6ed7c6b7ccb831cb4791c2b0e135.

Documentation impact

  • Documentation updated
  • No documentation impact

Canonical typed-aggregate reference, READMEs, changelog, migration guide and generated inventory document provider coverage, exact comparison/null/cursor semantics, complete SQL visibility, standalone usage, limits and concurrent-write guarantees. No deprecation of fetch_group_page. Independent feature scopes and consumer private storage boundaries are preserved.

@Dastari
Dastari changed the base branch from docs/refresh-release-review-dates-20261002 to main October 2, 2026 23:13
@Dastari
Dastari merged commit 3bff96b into main Oct 3, 2026
12 checks passed
@Dastari

Dastari commented Oct 3, 2026

Copy link
Copy Markdown
Owner Author

Published immutable workspace-2026.10.03.1, ORM/macros 0.38.0, exact source 3bff96b90ce19efa2bfc9cc71d3c95f45cad8c39 (merged #111; tested head c7d564ffab8105e67c6f1932cc99a572c347313a). All 12 PR checks and all 20 release jobs passed.

Release: https://github.com/Dastari/graphql-orm/releases/tag/workspace-2026.10.03.1
Manifest: https://github.com/Dastari/graphql-orm/releases/download/workspace-2026.10.03.1/workspace-2026.10.03.1.json

Workspace/core/macro tags resolve to the exact merge source. Published manifest/notes match the deterministic preview; checksums, package trees and lockfile hash verified. Complete SQLite/PostgreSQL text-group enumeration and SQL-visible ordinary COUNT/SUM are now published. Remaining joined/computed queries, MSSQL summaries/pages and private generated views stay open in #91. Runtime A–D and host timestamps are not included; pending branch versions must advance above actual main before merge. No downstream files or application databases were changed.

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