Skip to content
This repository has been archived by the owner on Sep 2, 2024. It is now read-only.

database list_documents() and query() pagination missing #5

Open
dstpierre opened this issue Mar 13, 2022 · 0 comments
Open

database list_documents() and query() pagination missing #5

dstpierre opened this issue Mar 13, 2022 · 0 comments

Comments

@dstpierre
Copy link
Member

The two functions accept the pagination data but do not provide them to the URL.

They should be provided as query strings i.e.:

/db/repo?page=1&size=25&desc=true

In the Go library the desc=true is added only when the user wants to sort descending order.

It might be better to accept a defined type (I guess class in Python?), for example there's a new sortby field that's in the work and it will be easier to change for further version vs. function parameters. For example

class ListParams:
    page: int
    size: int
    desc: bool

def list_documents(self, repo, lp: ListParams)

This will prevent breaking caller code and give flexibility to allow for additional meta data.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant