feat(page): add typed keyset pagination for Bob #15

Merged
end merged 8 commits from feat/page into main 2026-10-27 20:21:58 -07:00
Showing only changes of commit c3f3a3faf5 - Show all commits
@@ -2,7 +2,7 @@
title: Preserve supported value types in versioned page cursors
date: 2026-10-27
status: accepted
implementation: in-progress
implementation: implemented
summary: Pair a plain sort with a typed row key function and preserve supported concrete values with tagged cursors.
tags:
- pagination
@@ -13,7 +13,8 @@ related:
- /docs/adr/20261025T214616275Z-version-light-core-packages-in-the-root-module-and-nest-heavy-dependency-modules.md
tracking:
- https://gitea.auvem.com/corestack/go/issues/6
implemented_by: []
implemented_by:
- https://gitea.auvem.com/corestack/go/pulls/15
---
# Preserve supported value types in versioned page cursors
@@ -33,7 +34,7 @@ Type preservation here means retaining each supported concrete value across enco
## Decision Outcome
Use plain Sort/key inputs with tagged JSON, wrapped in unpadded base64url (`base64.RawURLEncoding`). The owner accepted this reviewed design on 2026-10-27, including the two-input API and continuation flags. Implementation is present in the working branch; delivery remains in progress pending independent implementation review and a real PR. No PR delivery evidence is recorded yet.
Use plain Sort/key inputs with tagged JSON, wrapped in unpadded base64url (`base64.RawURLEncoding`). The owner accepted this reviewed design on 2026-10-27, including the two-input API and continuation flags. [PR 15](https://gitea.auvem.com/corestack/go/pulls/15) delivers the implementation, SQLite/PostgreSQL outcome tests and package example. Local build, vet, race tests with real PostgreSQL, pinned lint, TODO and documentation checks passed; independent Standard review's Minor fixture finding was fixed, and fresh High review of `927594b` found no Blocking, Major or Minor findings. Published-head CI remains a merge-readiness gate reported in the PR; this implementation state does not assert CI success, merge or release.
Sort contains a stable caller-owned ID and an ordered list of columns, each with a Bob expression, direction and unique marker. Reject empty sorts, a missing or invalid UTF-8 Sort ID, nil expressions, invalid directions and a missing unique marker on the final column. Columns have no redundant ID field. The marker asserts that column alone is unique in the selected relation under database collation/comparison semantics, including joins. The library cannot prove schema truth. Composite-only uniqueness is outside the issue's final unique-column contract. Expressions and IDs come from trusted application declarations, never cursor-controlled SQL. The sort ID identifies the full immutable interpretation: ordered expressions, directions, key types, uniqueness and comparison semantics. Changing any of these requires a new ID. The backend selects the expected trusted Sort for the query; a decoded token ID must equal its ID. There is no global registry, descriptor fallback or hash subsystem. Local column metadata remains available for validation and query generation; it is not repeated on the wire.