Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

search: if limit === total, cursor should be null #8

Closed
wants to merge 1 commit into from

Conversation

Dzieni
Copy link
Contributor

@Dzieni Dzieni commented Oct 14, 2020

Small bugfix, bug found by @chiss2906

@Dzieni Dzieni requested a review from wmertens October 14, 2020 11:38
@wmertens
Copy link
Collaborator

I'm wondering if we should change the API so you always get the cursor and an additional hasMore boolean. This allows paging through future results.

The API change could coincide with the API change I propose in #9 and the transact branch

@Dzieni
Copy link
Contributor Author

Dzieni commented Oct 15, 2020

@wmertens
Good point, but then it's going to be a breaking change, right? While adding hasMore is not breaking anything, we're going to change the behavior of cursor a bit. That means all of those 3 changes would make strato-db v4.

Should we make a v4 roadmap then?

@wmertens
Copy link
Collaborator

wmertens commented Nov 6, 2020

I created a next branch for v4. So we could implement hasMore on there.

But I think maybe we can avoid breakage by returning the cursor twice, in the field named e.g. lastCursor? That one will always have the cursor for the last element, and cursor will keep the same semantics. Or is that too ugly and is the breaking change easy to handle in application code?

@wmertens wmertens closed this Mar 1, 2022
@wmertens wmertens deleted the cursorLimit branch March 1, 2022 11:40
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