-
Notifications
You must be signed in to change notification settings - Fork 935
Add invokeRunQueryRpc() #3025
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
Add invokeRunQueryRpc() #3025
Conversation
Binary Size ReportAffected SDKs
Test Logs |
|
||
return ( | ||
response | ||
// Filter RunQueryResponses that only contain readTimes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ultranit: consider s/Filter/Omit/ ("filter" has the unfortunate ambiguity in that it might refer to either the part that is left in place or the part that gets removed. It's clear enough from the context, but I still think something like "omit" is slightly better).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
structuredQuery | ||
}; | ||
|
||
const response = await datastoreImpl.invokeStreamingRPC< |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optional: it appears that response
is actually a container, perhaps rename it to responses
, streamingResponse
, etc.?
|
||
return ( | ||
response | ||
// Filter RunQueryResponses that only contain readTimes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: from reading the PR description, it appears that only the last element may not contain a document
, whereas the comment makes it seem as if there might be several such elements throughout the container.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR description reflects the behavior that I have observed. The protocol state though that it is also valid to not provide a document mid-stream as a way to report status.
This adds a new
invokeRunQueryRpc
RPC that is used (and tested) in the Lite SDK to run queries via Rest.This is similar to
firebase-js-sdk/packages/firestore/src/remote/datastore.ts
Line 124 in 96cd91d
Note:
The Query RPC needs a parent set. The types are not correct in
master
. See https://github.com/googleapis/googleapis/blob/master/google/firestore/v1/firestore.proto#L442RunQueryResponse returns a stream of documents followed by an empty result which just has
readTime
set. See https://github.com/googleapis/googleapis/blob/master/google/firestore/v1/firestore.proto#L477