clockworklabs / clockworklabs/SpacetimeDB
Pagination for views and tables
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 25.2k
- Forks
- 1.1k
- Avg merge
- 2d 7h
- Merged PRs (30d)
- 46
Description
it would be really useful to have an index type for pagination. my idea is #[index(page(page_size)) (idk rust enough if that is valid/good syntax for this) that is accessed with ctx.db.table.column.page(nr) and returns the subset of rows defined by the page_size that's sorted by the column it was used on.
this would simplify and optimise leaderboards, Auction pages, any form of listings and so on a lot.
once view parameters are out, it would be possible to make a view that takes the page nr as parameter and then just get the subset without having to manually sort and subset the data within the view.
as for the client updates, the client could just insert sort the new and deleted rows, so there is no need to change bsatn or the WS protocol for that
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
No files or tests are named. Start by locating the existing index, view, and table query paths, then review how view parameters, client updates, BSATN, and the WebSocket protocol currently work. Done requires an agreed pagination API and semantics for page size, ordering, and row updates, with implementation scope and tests identified.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- databases
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100