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

hack a watch integration #8582

Open
wants to merge 6 commits into
base: markduckworth/ppl
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
add pipeline to Listen RPC
  • Loading branch information
wu-hui committed Nov 1, 2024
commit acbf24f8e37acc81637915120cb71c3460f6ee74
4 changes: 4 additions & 0 deletions packages/firestore/src/protos/firestore_proto_api.ts
Original file line number Diff line number Diff line change
@@ -356,6 +356,9 @@ export declare namespace firestoreV1ApiClientInterfaces {
parent?: string;
structuredQuery?: StructuredQuery;
}
interface PipelineQueryTarget {
pipeline?: StructuredPipeline;
}
interface ReadOnly {
readTime?: string;
}
@@ -424,6 +427,7 @@ export declare namespace firestoreV1ApiClientInterfaces {
interface Target {
query?: QueryTarget;
documents?: DocumentsTarget;
pipelineQuery?: PipelineQueryTarget;
resumeToken?: string | Uint8Array;
readTime?: Timestamp;
targetId?: number;
Original file line number Diff line number Diff line change
@@ -913,13 +913,25 @@ message Target {
}
}

// A target specified by a pipeline query.
message PipelineQueryTarget {
// The pipeline to run.
oneof pipeline_type {
// A pipelined operation in structured format.
StructuredPipeline pipeline = 1;
}
}

// The type of target to listen to.
oneof target_type {
// A target specified by a query.
QueryTarget query = 2;

// A target specified by a set of document names.
DocumentsTarget documents = 3;

// A target specified by a pipeline query.
PipelineQueryTarget pipeline_query = 13;
}

// When to start listening.
Original file line number Diff line number Diff line change
@@ -198,6 +198,12 @@ message WriteResult {
//
// Multiple [DocumentChange][google.firestore.v1.DocumentChange] messages may be returned for the same logical
// change, if multiple targets are affected.
//
// For PipelineQueryTargets, `document` will be in the new pipeline format,
// (-- TODO(b/330735468): Insert link to spec. --)
// For a Listen stream with both QueryTargets and PipelineQueryTargets present,
// if a document matches both types of queries, then a separate DocumentChange
// messages will be sent out one for each set.
message DocumentChange {
// The new state of the [Document][google.firestore.v1.Document].
//
24 changes: 22 additions & 2 deletions packages/firestore/src/protos/protos.json
Original file line number Diff line number Diff line change
@@ -2343,7 +2343,8 @@
"targetType": {
"oneof": [
"query",
"documents"
"documents",
"pipeline_query"
]
},
"resumeType": {
@@ -2362,6 +2363,10 @@
"type": "DocumentsTarget",
"id": 3
},
"pipeline_query": {
"type": "PipelineQueryTarget",
"id": 13
},
"resumeToken": {
"type": "bytes",
"id": 4
@@ -2411,6 +2416,21 @@
"id": 2
}
}
},
"PipelineQueryTarget": {
"oneofs": {
"pipelineType": {
"oneof": [
"pipeline"
]
}
},
"fields": {
"pipeline": {
"type": "StructuredPipeline",
"id": 1
}
}
}
}
},
@@ -3266,4 +3286,4 @@
}
}
}
}
}