Skip to content

Commit acbf24f

Browse files
committed
add pipeline to Listen RPC
1 parent 4f9a5fc commit acbf24f

File tree

4 files changed

+44
-2
lines changed

4 files changed

+44
-2
lines changed

packages/firestore/src/protos/firestore_proto_api.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,9 @@ export declare namespace firestoreV1ApiClientInterfaces {
356356
parent?: string;
357357
structuredQuery?: StructuredQuery;
358358
}
359+
interface PipelineQueryTarget {
360+
pipeline?: StructuredPipeline;
361+
}
359362
interface ReadOnly {
360363
readTime?: string;
361364
}
@@ -424,6 +427,7 @@ export declare namespace firestoreV1ApiClientInterfaces {
424427
interface Target {
425428
query?: QueryTarget;
426429
documents?: DocumentsTarget;
430+
pipelineQuery?: PipelineQueryTarget;
427431
resumeToken?: string | Uint8Array;
428432
readTime?: Timestamp;
429433
targetId?: number;

packages/firestore/src/protos/google/firestore/v1/firestore.proto

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -913,13 +913,25 @@ message Target {
913913
}
914914
}
915915

916+
// A target specified by a pipeline query.
917+
message PipelineQueryTarget {
918+
// The pipeline to run.
919+
oneof pipeline_type {
920+
// A pipelined operation in structured format.
921+
StructuredPipeline pipeline = 1;
922+
}
923+
}
924+
916925
// The type of target to listen to.
917926
oneof target_type {
918927
// A target specified by a query.
919928
QueryTarget query = 2;
920929

921930
// A target specified by a set of document names.
922931
DocumentsTarget documents = 3;
932+
933+
// A target specified by a pipeline query.
934+
PipelineQueryTarget pipeline_query = 13;
923935
}
924936

925937
// When to start listening.

packages/firestore/src/protos/google/firestore/v1/write.proto

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,12 @@ message WriteResult {
198198
//
199199
// Multiple [DocumentChange][google.firestore.v1.DocumentChange] messages may be returned for the same logical
200200
// change, if multiple targets are affected.
201+
//
202+
// For PipelineQueryTargets, `document` will be in the new pipeline format,
203+
// (-- TODO(b/330735468): Insert link to spec. --)
204+
// For a Listen stream with both QueryTargets and PipelineQueryTargets present,
205+
// if a document matches both types of queries, then a separate DocumentChange
206+
// messages will be sent out one for each set.
201207
message DocumentChange {
202208
// The new state of the [Document][google.firestore.v1.Document].
203209
//

packages/firestore/src/protos/protos.json

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2343,7 +2343,8 @@
23432343
"targetType": {
23442344
"oneof": [
23452345
"query",
2346-
"documents"
2346+
"documents",
2347+
"pipeline_query"
23472348
]
23482349
},
23492350
"resumeType": {
@@ -2362,6 +2363,10 @@
23622363
"type": "DocumentsTarget",
23632364
"id": 3
23642365
},
2366+
"pipeline_query": {
2367+
"type": "PipelineQueryTarget",
2368+
"id": 13
2369+
},
23652370
"resumeToken": {
23662371
"type": "bytes",
23672372
"id": 4
@@ -2411,6 +2416,21 @@
24112416
"id": 2
24122417
}
24132418
}
2419+
},
2420+
"PipelineQueryTarget": {
2421+
"oneofs": {
2422+
"pipelineType": {
2423+
"oneof": [
2424+
"pipeline"
2425+
]
2426+
}
2427+
},
2428+
"fields": {
2429+
"pipeline": {
2430+
"type": "StructuredPipeline",
2431+
"id": 1
2432+
}
2433+
}
24142434
}
24152435
}
24162436
},
@@ -3266,4 +3286,4 @@
32663286
}
32673287
}
32683288
}
3269-
}
3289+
}

0 commit comments

Comments
 (0)