Skip to content

Conversation

@Evalir
Copy link
Member

@Evalir Evalir commented Oct 23, 2025

Adds cursor-based pagination types to the tx-cache crate. This allows us to implement pagination on the cache, and for the tx-cache client to be able to use pagination queries.

Getting all items in one of the collections in the cache is as simple as:

  • getting items in the collection, which will return a PaginationInfo
  • passing the cursor returned from PaginationInfo into the next request. This can easily be done by .into()ing a PaginationInfo into a PaginationParams.
  • do this repeatedly until there are no more pages. PaginationInfo has an utility method to detect this.

These changes are not breaking for the current tx cache consumers.

Copy link
Member Author

Evalir commented Oct 23, 2025

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Evalir Evalir force-pushed the evalir/cache-pagination branch 2 times, most recently from 695f90e to 38133ea Compare October 23, 2025 15:52
@Evalir Evalir force-pushed the evalir/cache-pagination branch from 38133ea to 9c99eeb Compare October 23, 2025 16:32
@Evalir Evalir marked this pull request as ready for review October 23, 2025 16:34
@Evalir Evalir requested a review from a team as a code owner October 23, 2025 16:34
Copy link
Member

is this a breaking change for existing consumers of the api? i.e. if they are using an older version of the builder will their builder break if I deploy this version of the tx cache?

@Evalir
Copy link
Member Author

Evalir commented Oct 27, 2025

Not technically a breaking change. The builder will still be able to fetch items from the cache as serde can partially deserialize JSON (it's a self-described format). They will be missing the pagination info, which is fine for now.

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.

2 participants