Skip to content

Commit b9cbfce

Browse files
Google APIscopybara-github
authored andcommitted
feat: Add "or" query support (only in the preview API surface)
docs: Clarify wording around default database_id usage PiperOrigin-RevId: 462444231
1 parent 0d62617 commit b9cbfce

6 files changed

Lines changed: 60 additions & 7 deletions

File tree

google/datastore/v1/BUILD.bazel

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ go_gapic_library(
124124
transport = "grpc+rest",
125125
deps = [
126126
":datastore_go_proto",
127+
"//google/longrunning:longrunning_go_gapic",
128+
"//google/longrunning:longrunning_go_proto",
129+
"@com_google_cloud_go//longrunning:go_default_library",
130+
"@com_google_cloud_go//longrunning/autogen:go_default_library",
127131
],
128132
)
129133

google/datastore/v1/datastore.proto

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ message LookupRequest {
116116
// Required. The ID of the project against which to make the request.
117117
string project_id = 8 [(google.api.field_behavior) = REQUIRED];
118118

119+
// The ID of the database against which to make the request.
120+
//
121+
// '(default)' is not allowed; please use empty string '' to refer the default
122+
// database.
123+
string database_id = 9;
124+
119125
// The options for this lookup request.
120126
ReadOptions read_options = 1;
121127

@@ -149,6 +155,12 @@ message RunQueryRequest {
149155
// Required. The ID of the project against which to make the request.
150156
string project_id = 8 [(google.api.field_behavior) = REQUIRED];
151157

158+
// The ID of the database against which to make the request.
159+
//
160+
// '(default)' is not allowed; please use empty string '' to refer the default
161+
// database.
162+
string database_id = 9;
163+
152164
// Entities are partitioned into subsets, identified by a partition ID.
153165
// Queries are scoped to a single partition.
154166
// This partition ID is normalized with the standard default context
@@ -163,7 +175,7 @@ message RunQueryRequest {
163175
// The query to run.
164176
Query query = 3;
165177

166-
// The GQL query to run.
178+
// The GQL query to run. This query must be a non-aggregation query.
167179
GqlQuery gql_query = 7;
168180
}
169181
}
@@ -182,6 +194,12 @@ message BeginTransactionRequest {
182194
// Required. The ID of the project against which to make the request.
183195
string project_id = 8 [(google.api.field_behavior) = REQUIRED];
184196

197+
// The ID of the database against which to make the request.
198+
//
199+
// '(default)' is not allowed; please use empty string '' to refer the default
200+
// database.
201+
string database_id = 9;
202+
185203
// Options for a new transaction.
186204
TransactionOptions transaction_options = 10;
187205
}
@@ -197,6 +215,12 @@ message RollbackRequest {
197215
// Required. The ID of the project against which to make the request.
198216
string project_id = 8 [(google.api.field_behavior) = REQUIRED];
199217

218+
// The ID of the database against which to make the request.
219+
//
220+
// '(default)' is not allowed; please use empty string '' to refer the default
221+
// database.
222+
string database_id = 9;
223+
200224
// Required. The transaction identifier, returned by a call to
201225
// [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction].
202226
bytes transaction = 1 [(google.api.field_behavior) = REQUIRED];
@@ -227,6 +251,12 @@ message CommitRequest {
227251
// Required. The ID of the project against which to make the request.
228252
string project_id = 8 [(google.api.field_behavior) = REQUIRED];
229253

254+
// The ID of the database against which to make the request.
255+
//
256+
// '(default)' is not allowed; please use empty string '' to refer the default
257+
// database.
258+
string database_id = 9;
259+
230260
// The type of commit to perform. Defaults to `TRANSACTIONAL`.
231261
Mode mode = 5;
232262

@@ -273,6 +303,12 @@ message AllocateIdsRequest {
273303
// Required. The ID of the project against which to make the request.
274304
string project_id = 8 [(google.api.field_behavior) = REQUIRED];
275305

306+
// The ID of the database against which to make the request.
307+
//
308+
// '(default)' is not allowed; please use empty string '' to refer the default
309+
// database.
310+
string database_id = 9;
311+
276312
// Required. A list of keys with incomplete key paths for which to allocate IDs.
277313
// No key may be reserved/read-only.
278314
repeated Key keys = 1 [(google.api.field_behavior) = REQUIRED];
@@ -290,7 +326,10 @@ message ReserveIdsRequest {
290326
// Required. The ID of the project against which to make the request.
291327
string project_id = 8 [(google.api.field_behavior) = REQUIRED];
292328

293-
// If not empty, the ID of the database against which to make the request.
329+
// The ID of the database against which to make the request.
330+
//
331+
// '(default)' is not allowed; please use empty string '' to refer the default
332+
// database.
294333
string database_id = 9;
295334

296335
// Required. A list of keys with complete key paths whose numeric IDs should not be

google/datastore/v1/datastore_grpc_service_config.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
"service": "google.datastore.v1.Datastore",
1111
"method": "RunQuery"
1212
},
13+
{
14+
"service": "google.datastore.v1.Datastore",
15+
"method": "RunAggregationQuery"
16+
},
1317
{
1418
"service": "google.datastore.v1.Datastore",
1519
"method": "ReserveIds"
@@ -20,10 +24,7 @@
2024
"initialBackoff": "0.100s",
2125
"maxBackoff": "60s",
2226
"backoffMultiplier": 1.3,
23-
"retryableStatusCodes": [
24-
"UNAVAILABLE",
25-
"DEADLINE_EXCEEDED"
26-
]
27+
"retryableStatusCodes": ["UNAVAILABLE", "DEADLINE_EXCEEDED"]
2728
}
2829
},
2930
{

google/datastore/v1/datastore_v1.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ title: Cloud Datastore API
55

66
apis:
77
- name: google.datastore.v1.Datastore
8+
- name: google.longrunning.Operations
89

910
documentation:
1011
summary: |-

google/datastore/v1/entity.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ message PartitionId {
5151
// The ID of the project to which the entities belong.
5252
string project_id = 2;
5353

54+
// If not empty, the ID of the database to which the entities
55+
// belong.
56+
string database_id = 3;
57+
5458
// If not empty, the ID of the namespace to which the entities belong.
5559
string namespace_id = 4;
5660
}

google/datastore/v1/query.proto

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ syntax = "proto3";
1616

1717
package google.datastore.v1;
1818

19+
import "google/api/field_behavior.proto";
1920
import "google/datastore/v1/entity.proto";
2021
import "google/protobuf/timestamp.proto";
2122
import "google/protobuf/wrappers.proto";
@@ -184,7 +185,10 @@ message CompositeFilter {
184185
Operator op = 1;
185186

186187
// The list of filters to combine.
187-
// Must contain at least one filter.
188+
//
189+
// Requires:
190+
//
191+
// * At least one filter is present.
188192
repeated Filter filters = 2;
189193
}
190194

0 commit comments

Comments
 (0)