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

Fix Query.One + Filter behavior (#248) #249

Merged
merged 4 commits into from
Dec 17, 2024
Merged

Fix Query.One + Filter behavior (#248) #249

merged 4 commits into from
Dec 17, 2024

Conversation

guregu
Copy link
Owner

@guregu guregu commented Dec 16, 2024

See: #248

When One can't use the GetItem API, it triggers a Query. Previously these would only check one results page, which interacted poorly with Filter, potentially dropping results in large but empty datasets. Now, we iterate through pages until we find a result. ErrTooMany is emitted on a best-effort basis.

To preserve the old behavior, use RequestLimit(1) or SearchFilter(N).

@dharkness please take a look and see if this helps your use case. This is the simplest way I could think to implement it. I think the root cause was simply that One was written without Filter in mind, much of its code untouched for 9 years.

@guregu guregu merged commit ea7f332 into master Dec 17, 2024
2 checks passed
@guregu guregu deleted the fix-query-one branch December 17, 2024 19:58
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.

1 participant