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

Queries now STOP once the limit has been reached. #200

Merged
merged 1 commit into from
Oct 11, 2016
Merged

Queries now STOP once the limit has been reached. #200

merged 1 commit into from
Oct 11, 2016

Conversation

jdpedrie
Copy link
Contributor

Semantically, limiting query results should be a hard limit rather than a results-per-page limit. This change will cause Operation::runQuery() to respect limits and endCursors rather than continuing past the limits set by the user.

Once improvements to the Iterator are released, we should return the endCursor to the user along with the moreResultsType value (i.e. MORE_RESULTS_AFTER_LIMIT, MORE_RESULTS_AFTER_CURSOR) and allow them to fetch as they see fit.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 10, 2016
@jdpedrie jdpedrie added the api: datastore Issues related to the Datastore API. label Oct 10, 2016
@@ -405,7 +405,7 @@ public function runQuery(QueryInterface $query, array $options = [])
yield $result;
}

if ($query->canPaginate() && $res['batch']['moreResults'] !== 'NO_MORE_RESULTS') {
if ($query->canPaginate() && $res['batch']['moreResults'] === 'NOT_FINISHED') {

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@dwsupplee dwsupplee merged commit 28f30a3 into googleapis:master Oct 11, 2016
@jdpedrie jdpedrie deleted the query-real-limits branch October 11, 2016 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: datastore Issues related to the Datastore API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants