Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,8 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-spanner/tre
| Queryoptions | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/queryoptions.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/queryoptions.js,samples/README.md) |
| Quickstart | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/quickstart.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/quickstart.js,samples/README.md) |
| Read data with database role | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/read-data-with-database-role.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/read-data-with-database-role.js,samples/README.md) |
| Performs a read-write transaction with isolation level option | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/repeatable-reads.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/repeatable-reads.js,samples/README.md) |
| Performs a read-write transaction with read lock mode option | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/read-lock-mode.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/read-lock-mode.js,samples/README.md) |
| Performs a read-write transaction with isolation level option | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/repeatable-reads.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/repeatable-reads.js,samples/README.md) |
| Sets a request tag for a single query | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/request-tag.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/request-tag.js,samples/README.md) |
| Run Batch update with RPC priority | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/rpc-priority-batch-dml.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/rpc-priority-batch-dml.js,samples/README.md) |
| Run partitioned update with RPC priority | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/rpc-priority-partitioned-dml.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/rpc-priority-partitioned-dml.js,samples/README.md) |
Expand Down
2 changes: 1 addition & 1 deletion protos/google/spanner/v1/change_stream.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2025 Google LLC
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion protos/google/spanner/v1/commit_response.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2025 Google LLC
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion protos/google/spanner/v1/keys.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2025 Google LLC
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion protos/google/spanner/v1/location.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2025 Google LLC
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion protos/google/spanner/v1/mutation.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2025 Google LLC
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion protos/google/spanner/v1/query_plan.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2025 Google LLC
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
10 changes: 9 additions & 1 deletion protos/google/spanner/v1/result_set.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2025 Google LLC
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -61,6 +61,14 @@ message ResultSet {
// [Commit][google.spanner.v1.Spanner.Commit] request for this transaction.
MultiplexedSessionPrecommitToken precommit_token = 5
[(google.api.field_behavior) = OPTIONAL];

// Optional. A cache update expresses a set of changes the client should
// incorporate into its location cache. The client should discard the changes
// if they are older than the data it already has. This data can be obtained
// in response to requests that included a `RoutingHint` field, but may also
// be obtained by explicit location-fetching RPCs which may be added in the
// future.
CacheUpdate cache_update = 6 [(google.api.field_behavior) = OPTIONAL];
}

// Partial results from a streaming read or SQL query. Streaming reads and
Expand Down
27 changes: 17 additions & 10 deletions protos/google/spanner/v1/spanner.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2025 Google LLC
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -544,8 +544,9 @@ message RequestOptions {
// A tag used for statistics collection about this transaction.
// Both `request_tag` and `transaction_tag` can be specified for a read or
// query that belongs to a transaction.
// The value of transaction_tag should be the same for all requests belonging
// to the same transaction.
// To enable tagging on a transaction, `transaction_tag` must be set to the
// same value for all requests belonging to the same transaction, including
// [BeginTransaction][google.spanner.v1.Spanner.BeginTransaction].
// If this request doesn't belong to any transaction, `transaction_tag` is
// ignored.
// Legal characters for `transaction_tag` values are all printable characters
Expand Down Expand Up @@ -1018,7 +1019,8 @@ message PartitionQueryRequest {
// operations.
string sql = 3 [(google.api.field_behavior) = REQUIRED];

// Parameter names and values that bind to placeholders in the SQL string.
// Optional. Parameter names and values that bind to placeholders in the SQL
// string.
//
// A parameter placeholder consists of the `@` character followed by the
// parameter name (for example, `@firstName`). Parameter names can contain
Expand All @@ -1030,18 +1032,18 @@ message PartitionQueryRequest {
// `"WHERE id > @msg_id AND id < @msg_id + 100"`
//
// It's an error to execute a SQL statement with unbound parameters.
google.protobuf.Struct params = 4;
google.protobuf.Struct params = 4 [(google.api.field_behavior) = OPTIONAL];

// It isn't always possible for Cloud Spanner to infer the right SQL type
// from a JSON value. For example, values of type `BYTES` and values
// of type `STRING` both appear in
// Optional. It isn't always possible for Cloud Spanner to infer the right SQL
// type from a JSON value. For example, values of type `BYTES` and values of
// type `STRING` both appear in
// [params][google.spanner.v1.PartitionQueryRequest.params] as JSON strings.
//
// In these cases, `param_types` can be used to specify the exact
// SQL type for some or all of the SQL query parameters. See the
// definition of [Type][google.spanner.v1.Type] for more information
// about SQL types.
map<string, Type> param_types = 5;
map<string, Type> param_types = 5 [(google.api.field_behavior) = OPTIONAL];

// Additional options that affect how many partitions are created.
PartitionOptions partition_options = 6;
Expand Down Expand Up @@ -1407,6 +1409,11 @@ message BatchWriteResponse {
google.rpc.Status status = 2;

// The commit timestamp of the transaction that applied this batch.
// Present if `status` is `OK`, absent otherwise.
// Present if status is OK and the mutation groups were applied, absent
// otherwise.
//
// For mutation groups with conditions, a status=OK and missing
// commit_timestamp means that the mutation groups were not applied due to the
// condition not being satisfied after evaluation.
google.protobuf.Timestamp commit_timestamp = 3;
}
2 changes: 1 addition & 1 deletion protos/google/spanner/v1/transaction.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2025 Google LLC
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
2 changes: 1 addition & 1 deletion protos/google/spanner/v1/type.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2025 Google LLC
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down
6 changes: 6 additions & 0 deletions protos/protos.d.ts

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

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

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

17 changes: 15 additions & 2 deletions protos/protos.json

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

20 changes: 11 additions & 9 deletions samples/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ and automatic, synchronous replication for high availability.
* [Queryoptions](#queryoptions)
* [Quickstart](#quickstart)
* [Read data with database role](#read-data-with-database-role)
* [Performs a read-write transaction with isolation level option](#performs-a-read-write-transaction-with-isolation-level-option)
* [Performs a read-write transaction with read lock mode option](#performs-a-read-write-transaction-with-read-lock-mode-option)
* [Performs a read-write transaction with isolation level option](#performs-a-read-write-transaction-with-isolation-level-option)
* [Sets a request tag for a single query](#sets-a-request-tag-for-a-single-query)
* [Run Batch update with RPC priority](#run-batch-update-with-rpc-priority)
* [Run partitioned update with RPC priority](#run-partitioned-update-with-rpc-priority)
Expand Down Expand Up @@ -1890,32 +1890,34 @@ __Usage:__



### Performs a read-write transaction with isolation level option
### Performs a read-write transaction with read lock mode option

View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/repeatable-reads.js).
View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/read-lock-mode.js).

[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/repeatable-reads.js,samples/README.md)
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/read-lock-mode.js,samples/README.md)

__Usage:__


`node repeatable-reads.js <INSTANCE_ID> <DATABASE_ID> <PROJECT_ID>`
`node read-lock-mode.js <INSTANCE_ID> <DATABASE_ID> <PROJECT_ID>`


-----




### Performs a read-write transaction with read lock mode option
### Performs a read-write transaction with isolation level option

View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/read-lock-mode.js).
View the [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/repeatable-reads.js).

[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/read-lock-mode.js,samples/README.md)
[![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/repeatable-reads.js,samples/README.md)

__Usage:__

`node read-lock-mode.js <INSTANCE_ID> <DATABASE_ID> <PROJECT_ID>`

`node repeatable-reads.js <INSTANCE_ID> <DATABASE_ID> <PROJECT_ID>`


-----

Expand Down
Loading
Loading