Skip to content

Commit d4599ad

Browse files
Google APIscopybara-github
authored andcommitted
feat: new transaction options for datastoreV1
PiperOrigin-RevId: 501960571
1 parent 990f7b8 commit d4599ad

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

google/datastore/v1/datastore.proto

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,13 @@ message LookupResponse {
191191
// order of the keys in the input.
192192
repeated Key deferred = 3;
193193

194+
// The identifier of the transaction that was started as part of this Lookup
195+
// request.
196+
//
197+
// Set only when [ReadOptions.begin_transaction][] was set in
198+
// [LookupRequest.read_options][google.datastore.v1.LookupRequest.read_options].
199+
bytes transaction = 5;
200+
194201
// The time at which these entities were read or found missing.
195202
google.protobuf.Timestamp read_time = 7;
196203
}
@@ -233,6 +240,13 @@ message RunQueryResponse {
233240

234241
// The parsed form of the `GqlQuery` from the request, if it was set.
235242
Query query = 2;
243+
244+
// The identifier of the transaction that was started as part of this
245+
// RunQuery request.
246+
//
247+
// Set only when [ReadOptions.begin_transaction][] was set in
248+
// [RunQueryRequest.read_options][google.datastore.v1.RunQueryRequest.read_options].
249+
bytes transaction = 5;
236250
}
237251

238252
// The request for
@@ -274,6 +288,13 @@ message RunAggregationQueryResponse {
274288

275289
// The parsed form of the `GqlQuery` from the request, if it was set.
276290
AggregationQuery query = 2;
291+
292+
// The identifier of the transaction that was started as part of this
293+
// RunAggregationQuery request.
294+
//
295+
// Set only when [ReadOptions.begin_transaction][] was set in
296+
// [RunAggregationQueryRequest.read_options][google.datastore.v1.RunAggregationQueryRequest.read_options].
297+
bytes transaction = 5;
277298
}
278299

279300
// The request for
@@ -354,6 +375,13 @@ message CommitRequest {
354375
// transaction identifier is returned by a call to
355376
// [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction].
356377
bytes transaction = 1;
378+
379+
// Options for beginning a new transaction for this request.
380+
// The transaction is committed when the request completes. If specified,
381+
// [TransactionOptions.mode][google.datastore.v1.TransactionOptions.mode]
382+
// must be
383+
// [TransactionOptions.ReadWrite][google.datastore.v1.TransactionOptions.ReadWrite].
384+
TransactionOptions single_use_transaction = 10;
357385
}
358386

359387
// The mutations to perform.
@@ -533,6 +561,15 @@ message ReadOptions {
533561
// [Datastore.BeginTransaction][google.datastore.v1.Datastore.BeginTransaction].
534562
bytes transaction = 2;
535563

564+
// Options for beginning a new transaction for this request.
565+
//
566+
// The new transaction identifier will be returned in the corresponding
567+
// response as either
568+
// [LookupResponse.transaction][google.datastore.v1.LookupResponse.transaction]
569+
// or
570+
// [RunQueryResponse.transaction][google.datastore.v1.RunQueryResponse.transaction].
571+
TransactionOptions new_transaction = 3;
572+
536573
// Reads entities as they were at the given time. This may not be older
537574
// than 270 seconds. This value is only supported for Cloud Firestore in
538575
// Datastore mode.

0 commit comments

Comments
 (0)