DBIO-GraphQL

 view release on metacpan or  search on metacpan

docs/adr/0005-stateless-base64-pk-cursors.md  view on Meta::CPAN

  `primary_columns` when no `orderBy` is given), which is what makes the
  `pk > value` seek correspond to "the next page." Under `cursor` that order
  is the only one: an `orderBy` naming the first PK column ascending is
  accepted and leaves the full PK order in place, any other `orderBy` is
  refused with an error (karr k6).

## Rationale

A stateless PK cursor needs no server-side session, no storage, and no
cleanup — every request carries everything required to resume, which is the
right fit for a stateless GraphQL endpoint and for a layer that wants to add
no runtime dependency. Encoding the PK (rather than an offset) makes
`after` a keyset seek (`pk > value`) instead of a large `OFFSET`, so deep
pages stay cheap and do not skew when rows are inserted/deleted between
requests. Base64 keeps the token opaque to clients and URL/transport-safe;
the percent-escaping of `:` and `%` keeps composite-PK decoding unambiguous.

The design's correctness rests on one assumption: that the result is ordered
by the same PK the cursor encodes. That assumption is satisfied by the
default ordering, which is why cursor pagination is paired with PK ordering.



( run in 0.786 second using v1.01-cache-2.11-cpan-eb134014566 )