Skip to content

Commit

Permalink
feat: Add the last statement option to ExecuteSqlRequest and ExecuteB…
Browse files Browse the repository at this point in the history
…atchDmlRequest (googleapis#2196)

* feat: Add the last statement option to ExecuteSqlRequest and ExecuteBatchDmlRequest

PiperOrigin-RevId: 699218836

Source-Link: googleapis/googleapis@97da65f

Source-Link: https://github.com/googleapis/googleapis-gen/commit/d134e8da8048393b019da39866976d2c413ac5e1
Copy-Tag: eyJwIjoiLmdpdGh1Yi8uT3dsQm90LnlhbWwiLCJoIjoiZDEzNGU4ZGE4MDQ4MzkzYjAxOWRhMzk4NjY5NzZkMmM0MTNhYzVlMSJ9

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
gcf-owl-bot[bot] and gcf-owl-bot[bot] authored Nov 25, 2024
1 parent 7299a43 commit 223f167
Show file tree
Hide file tree
Showing 5 changed files with 124 additions and 0 deletions.
22 changes: 22 additions & 0 deletions protos/google/spanner/v1/spanner.proto
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,17 @@ message ExecuteSqlRequest {
// If the field is set to `true` but the request does not set
// `partition_token`, the API returns an `INVALID_ARGUMENT` error.
bool data_boost_enabled = 16;

// Optional. If set to true, this statement marks the end of the transaction.
// The transaction should be committed or aborted after this statement
// executes, and attempts to execute any other requests against this
// transaction (including reads and queries) will be rejected.
//
// For DML statements, setting this option may cause some error reporting to
// be deferred until commit time (e.g. validation of unique constraints).
// Given this, successful execution of a DML statement should not be assumed
// until a subsequent Commit call completes successfully.
bool last_statement = 17 [(google.api.field_behavior) = OPTIONAL];
}

// The request for [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml].
Expand Down Expand Up @@ -861,6 +872,17 @@ message ExecuteBatchDmlRequest {

// Common options for this request.
RequestOptions request_options = 5;

// Optional. If set to true, this request marks the end of the transaction.
// The transaction should be committed or aborted after these statements
// execute, and attempts to execute any other requests against this
// transaction (including reads and queries) will be rejected.
//
// Setting this option may cause some error reporting to be deferred until
// commit time (e.g. validation of unique constraints). Given this, successful
// execution of statements should not be assumed until a subsequent Commit
// call completes successfully.
bool last_statements = 6 [(google.api.field_behavior) = OPTIONAL];
}

// The response for
Expand Down
12 changes: 12 additions & 0 deletions protos/protos.d.ts

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

46 changes: 46 additions & 0 deletions protos/protos.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 14 additions & 0 deletions protos/protos.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

30 changes: 30 additions & 0 deletions src/v1/spanner_client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -895,6 +895,16 @@ export class SpannerClient {
*
* If the field is set to `true` but the request does not set
* `partition_token`, the API returns an `INVALID_ARGUMENT` error.
* @param {boolean} [request.lastStatement]
* Optional. If set to true, this statement marks the end of the transaction.
* The transaction should be committed or aborted after this statement
* executes, and attempts to execute any other requests against this
* transaction (including reads and queries) will be rejected.
*
* For DML statements, setting this option may cause some error reporting to
* be deferred until commit time (e.g. validation of unique constraints).
* Given this, successful execution of a DML statement should not be assumed
* until a subsequent Commit call completes successfully.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
Expand Down Expand Up @@ -1010,6 +1020,16 @@ export class SpannerClient {
* handled requests will yield the same response as the first execution.
* @param {google.spanner.v1.RequestOptions} request.requestOptions
* Common options for this request.
* @param {boolean} [request.lastStatements]
* Optional. If set to true, this request marks the end of the transaction.
* The transaction should be committed or aborted after these statements
* execute, and attempts to execute any other requests against this
* transaction (including reads and queries) will be rejected.
*
* Setting this option may cause some error reporting to be deferred until
* commit time (e.g. validation of unique constraints). Given this, successful
* execution of statements should not be assumed until a subsequent Commit
* call completes successfully.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Promise} - The promise which resolves to an array.
Expand Down Expand Up @@ -1906,6 +1926,16 @@ export class SpannerClient {
*
* If the field is set to `true` but the request does not set
* `partition_token`, the API returns an `INVALID_ARGUMENT` error.
* @param {boolean} [request.lastStatement]
* Optional. If set to true, this statement marks the end of the transaction.
* The transaction should be committed or aborted after this statement
* executes, and attempts to execute any other requests against this
* transaction (including reads and queries) will be rejected.
*
* For DML statements, setting this option may cause some error reporting to
* be deferred until commit time (e.g. validation of unique constraints).
* Given this, successful execution of a DML statement should not be assumed
* until a subsequent Commit call completes successfully.
* @param {object} [options]
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
* @returns {Stream}
Expand Down

0 comments on commit 223f167

Please sign in to comment.