beetbox / beetbox/beets

Pagination support in dbcore

Open
#750 6 comments 1 reaction 0 assignees View on GitHub
feature
Dominant language
Python
Stars
15.7k
Forks
2.1k
Avg merge
4d 21h
Merged PRs (30d)
31

Description

The creation of this issue has been discussed in #736.
To implement pagination properly in the HTTP API, we need to add support for pagination in dbCore. Ideally the pagination mechanism should also be usable with the command-line interface.

Ideas about pagination have been discussed in #718. It seems were are basically 4 options :
- the naive approach : using start/offset parameters in query. While this is trivial to implement it is definitely not very efficient.
- use a seek-able id in the query ( i.e. "gives me the next items starting with this one") : this is the approach [recommended by sqlite](http://www.sqlite.org/cvstrac/wiki?p=ScrollingCursor), we have to make a small prototype to make sure it's doable with complex queries.
- when performing a query, store temporarily the result and return a token to the client, which can be used to walk through the ResultSet. The difficult part here is to maintain, and discard at some point, the ResultSets
- last solution : only return id for complex queries. This looks nice but I'm afraid it might not play well with the current query mechanism, which fetches full rows anyway.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.