feat(page): add typed keyset pagination for Bob

Add versioned typed cursors, composable native query mods, bidirectional page assembly and opt-in authorized counts. Cover SQLite and PostgreSQL outcomes, strict cursor boundaries and a runnable example; require PostgreSQL service tests in CI.

Refs: #6
This commit is contained in:
end committed 2026-10-27 12:55:23 -07:00
1 parent da1ff94fe2
commit 8615d8ca66
11 files changed
+1142 -11

No files matched your search

+13
View File
@@ -20,6 +20,19 @@ docs check [--root DIR] # prints path:line: messa
The format is specified in [docs/docs-format.md](docs/docs-format.md); that document is the complete rule set. Exit status is `0` when every record is valid, `1` when problems are reported and `2` for usage errors.
## page
[`page`](page/page.go) provides transport-neutral Bob keyset pagination with typed
items, mixed-direction sorts, opaque typed cursors, and a separate opt-in count.
Pass a trusted Sort and a typed row key in the same column order; sort columns
must be non-null and end in a unique column. See the [runnable example](page/example_test.go)
and [cursor decision](docs/adr/20261027T184351001Z-preserve-typed-sort-values-in-versioned-page-cursors.md).
SQLite runs in-process in the normal test suite (requires CGO). PostgreSQL runs in
CI; locally set `PAGE_POSTGRES_DSN` to an isolated test database to run the same
flow. Set `PAGE_REQUIRE_POSTGRES=1` to fail rather than skip when the DSN is absent.
MySQL mod composition compiles; its runtime behavior has not been verified.
## Status
No support is guaranteed. Breaking changes, including to the format rules, may happen before 1.0 and are listed in the release notes.