@google-cloud/spanner 5.16.3 → 5.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -0
- package/README.md +12 -12
- package/build/protos/google/spanner/admin/database/v1/backup.proto +4 -1
- package/build/protos/google/spanner/admin/database/v1/common.proto +14 -1
- package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +14 -4
- package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +8 -5
- package/build/protos/google/spanner/v1/commit_response.proto +3 -3
- package/build/protos/google/spanner/v1/keys.proto +1 -1
- package/build/protos/google/spanner/v1/mutation.proto +6 -5
- package/build/protos/google/spanner/v1/query_plan.proto +19 -19
- package/build/protos/google/spanner/v1/result_set.proto +2 -1
- package/build/protos/google/spanner/v1/spanner.proto +21 -19
- package/build/protos/google/spanner/v1/transaction.proto +20 -32
- package/build/protos/google/spanner/v1/type.proto +34 -7
- package/build/protos/protos.d.ts +381 -344
- package/build/protos/protos.js +1165 -980
- package/build/protos/protos.json +168 -108
- package/build/src/instance.d.ts +1 -1
- package/build/src/v1/database_admin_client.d.ts +9 -4
- package/build/src/v1/database_admin_client.js +7 -7
- package/build/src/v1/instance_admin_client.js +2 -3
- package/build/src/v1/spanner_client.d.ts +1 -31
- package/build/src/v1/spanner_client.js +11 -9
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,20 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/nodejs-spanner?activeTab=versions
|
|
6
6
|
|
|
7
|
+
## [5.17.0](https://github.com/googleapis/nodejs-spanner/compare/v5.16.3...v5.17.0) (2022-03-09)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* Refactor create database options schema to accept array ([#1578](https://github.com/googleapis/nodejs-spanner/issues/1578)) ([b1c88ac](https://github.com/googleapis/nodejs-spanner/commit/b1c88accee3770bb94e6a7d73e767eaa426a86a3))
|
|
13
|
+
|
|
14
|
+
### [5.16.3](https://github.com/googleapis/nodejs-spanner/compare/v5.16.3...v5.16.3) (2022-01-31)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Miscellaneous Chores
|
|
18
|
+
|
|
19
|
+
* Release-As: 5.16.3 ([#1556](https://github.com/googleapis/nodejs-spanner/issues/1556)) ([31f5fbc](https://github.com/googleapis/nodejs-spanner/commit/31f5fbc6d890fd7296497d6992a7d186ea786476))
|
|
20
|
+
|
|
7
21
|
### [5.16.3](https://github.com/googleapis/nodejs-spanner/compare/v5.16.3...v5.16.3) (2022-01-21)
|
|
8
22
|
|
|
9
23
|
|
package/README.md
CHANGED
|
@@ -148,21 +148,21 @@ also contains samples.
|
|
|
148
148
|
Our client libraries follow the [Node.js release schedule](https://nodejs.org/en/about/releases/).
|
|
149
149
|
Libraries are compatible with all current _active_ and _maintenance_ versions of
|
|
150
150
|
Node.js.
|
|
151
|
+
If you are using an end-of-life version of Node.js, we recommend that you update
|
|
152
|
+
as soon as possible to an actively supported LTS version.
|
|
151
153
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
The dist-tags follow the naming convention `legacy-(version)`.
|
|
155
|
-
|
|
156
|
-
_Legacy Node.js versions are supported as a best effort:_
|
|
154
|
+
Google's client libraries support legacy versions of Node.js runtimes on a
|
|
155
|
+
best-efforts basis with the following warnings:
|
|
157
156
|
|
|
158
|
-
* Legacy versions
|
|
159
|
-
* Some security patches
|
|
160
|
-
* Dependencies
|
|
157
|
+
* Legacy versions are not tested in continuous integration.
|
|
158
|
+
* Some security patches and features cannot be backported.
|
|
159
|
+
* Dependencies cannot be kept up-to-date.
|
|
161
160
|
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
161
|
+
Client libraries targeting some end-of-life versions of Node.js are available, and
|
|
162
|
+
can be installed through npm [dist-tags](https://docs.npmjs.com/cli/dist-tag).
|
|
163
|
+
The dist-tags follow the naming convention `legacy-(version)`.
|
|
164
|
+
For example, `npm install @google-cloud/spanner@legacy-8` installs client libraries
|
|
165
|
+
for versions compatible with Node.js 8.
|
|
166
166
|
|
|
167
167
|
## Versioning
|
|
168
168
|
|
|
@@ -16,13 +16,13 @@ syntax = "proto3";
|
|
|
16
16
|
|
|
17
17
|
package google.spanner.admin.database.v1;
|
|
18
18
|
|
|
19
|
+
import "google/api/annotations.proto";
|
|
19
20
|
import "google/api/field_behavior.proto";
|
|
20
21
|
import "google/api/resource.proto";
|
|
21
22
|
import "google/longrunning/operations.proto";
|
|
22
23
|
import "google/protobuf/field_mask.proto";
|
|
23
24
|
import "google/protobuf/timestamp.proto";
|
|
24
25
|
import "google/spanner/admin/database/v1/common.proto";
|
|
25
|
-
import "google/api/annotations.proto";
|
|
26
26
|
|
|
27
27
|
option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1";
|
|
28
28
|
option go_package = "google.golang.org/genproto/googleapis/spanner/admin/database/v1;database";
|
|
@@ -117,6 +117,9 @@ message Backup {
|
|
|
117
117
|
|
|
118
118
|
// Output only. The encryption information for the backup.
|
|
119
119
|
EncryptionInfo encryption_info = 8 [(google.api.field_behavior) = OUTPUT_ONLY];
|
|
120
|
+
|
|
121
|
+
// Output only. The database dialect information for the backup.
|
|
122
|
+
DatabaseDialect database_dialect = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
|
|
120
123
|
}
|
|
121
124
|
|
|
122
125
|
// The request for [CreateBackup][google.spanner.admin.database.v1.DatabaseAdmin.CreateBackup].
|
|
@@ -16,11 +16,11 @@ syntax = "proto3";
|
|
|
16
16
|
|
|
17
17
|
package google.spanner.admin.database.v1;
|
|
18
18
|
|
|
19
|
+
import "google/api/annotations.proto";
|
|
19
20
|
import "google/api/field_behavior.proto";
|
|
20
21
|
import "google/api/resource.proto";
|
|
21
22
|
import "google/protobuf/timestamp.proto";
|
|
22
23
|
import "google/rpc/status.proto";
|
|
23
|
-
import "google/api/annotations.proto";
|
|
24
24
|
|
|
25
25
|
option csharp_namespace = "Google.Cloud.Spanner.Admin.Database.V1";
|
|
26
26
|
option go_package = "google.golang.org/genproto/googleapis/spanner/admin/database/v1;database";
|
|
@@ -98,3 +98,16 @@ message EncryptionInfo {
|
|
|
98
98
|
}
|
|
99
99
|
];
|
|
100
100
|
}
|
|
101
|
+
|
|
102
|
+
// Indicates the dialect type of a database.
|
|
103
|
+
enum DatabaseDialect {
|
|
104
|
+
// Default value. This value will create a database with the
|
|
105
|
+
// GOOGLE_STANDARD_SQL dialect.
|
|
106
|
+
DATABASE_DIALECT_UNSPECIFIED = 0;
|
|
107
|
+
|
|
108
|
+
// Google standard SQL.
|
|
109
|
+
GOOGLE_STANDARD_SQL = 1;
|
|
110
|
+
|
|
111
|
+
// PostgreSQL supported SQL.
|
|
112
|
+
POSTGRESQL = 2;
|
|
113
|
+
}
|
|
@@ -24,6 +24,7 @@ import "google/iam/v1/iam_policy.proto";
|
|
|
24
24
|
import "google/iam/v1/policy.proto";
|
|
25
25
|
import "google/longrunning/operations.proto";
|
|
26
26
|
import "google/protobuf/empty.proto";
|
|
27
|
+
import "google/protobuf/field_mask.proto";
|
|
27
28
|
import "google/protobuf/timestamp.proto";
|
|
28
29
|
import "google/spanner/admin/database/v1/backup.proto";
|
|
29
30
|
import "google/spanner/admin/database/v1/common.proto";
|
|
@@ -42,10 +43,11 @@ option (google.api.resource_definition) = {
|
|
|
42
43
|
|
|
43
44
|
// Cloud Spanner Database Admin API
|
|
44
45
|
//
|
|
45
|
-
// The Cloud Spanner Database Admin API can be used to
|
|
46
|
-
//
|
|
47
|
-
//
|
|
48
|
-
//
|
|
46
|
+
// The Cloud Spanner Database Admin API can be used to:
|
|
47
|
+
// * create, drop, and list databases
|
|
48
|
+
// * update the schema of pre-existing databases
|
|
49
|
+
// * create, delete and list backups for a database
|
|
50
|
+
// * restore a database from an existing backup
|
|
49
51
|
service DatabaseAdmin {
|
|
50
52
|
option (google.api.default_host) = "spanner.googleapis.com";
|
|
51
53
|
option (google.api.oauth_scopes) =
|
|
@@ -110,6 +112,8 @@ service DatabaseAdmin {
|
|
|
110
112
|
// Drops (aka deletes) a Cloud Spanner database.
|
|
111
113
|
// Completed backups for the database will be retained according to their
|
|
112
114
|
// `expire_time`.
|
|
115
|
+
// Note: Cloud Spanner might continue to accept requests for a few seconds
|
|
116
|
+
// after the database has been deleted.
|
|
113
117
|
rpc DropDatabase(DropDatabaseRequest) returns (google.protobuf.Empty) {
|
|
114
118
|
option (google.api.http) = {
|
|
115
119
|
delete: "/v1/{database=projects/*/instances/*/databases/*}"
|
|
@@ -407,6 +411,9 @@ message Database {
|
|
|
407
411
|
// database option set using DatabaseAdmin.CreateDatabase or
|
|
408
412
|
// DatabaseAdmin.UpdateDatabaseDdl. If not explicitly set, this is empty.
|
|
409
413
|
string default_leader = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
|
|
414
|
+
|
|
415
|
+
// Output only. The dialect of the Cloud Spanner Database.
|
|
416
|
+
DatabaseDialect database_dialect = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
|
|
410
417
|
}
|
|
411
418
|
|
|
412
419
|
// The request for [ListDatabases][google.spanner.admin.database.v1.DatabaseAdmin.ListDatabases].
|
|
@@ -469,6 +476,9 @@ message CreateDatabaseRequest {
|
|
|
469
476
|
// specified, Cloud Spanner will encrypt/decrypt all data at rest using
|
|
470
477
|
// Google default encryption.
|
|
471
478
|
EncryptionConfig encryption_config = 4 [(google.api.field_behavior) = OPTIONAL];
|
|
479
|
+
|
|
480
|
+
// Optional. The dialect of the Cloud Spanner Database.
|
|
481
|
+
DatabaseDialect database_dialect = 5 [(google.api.field_behavior) = OPTIONAL];
|
|
472
482
|
}
|
|
473
483
|
|
|
474
484
|
// Metadata type for the operation returned by
|
|
@@ -350,19 +350,22 @@ message Instance {
|
|
|
350
350
|
// after the instance is created. Values are of the form
|
|
351
351
|
// `projects/<project>/instances/[a-z][-a-z0-9]*[a-z0-9]`. The final
|
|
352
352
|
// segment of the name must be between 2 and 64 characters in length.
|
|
353
|
-
string name = 1;
|
|
353
|
+
string name = 1 [(google.api.field_behavior) = REQUIRED];
|
|
354
354
|
|
|
355
355
|
// Required. The name of the instance's configuration. Values are of the form
|
|
356
356
|
// `projects/<project>/instanceConfigs/<configuration>`. See
|
|
357
357
|
// also [InstanceConfig][google.spanner.admin.instance.v1.InstanceConfig] and
|
|
358
358
|
// [ListInstanceConfigs][google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs].
|
|
359
|
-
string config = 2 [
|
|
360
|
-
|
|
361
|
-
|
|
359
|
+
string config = 2 [
|
|
360
|
+
(google.api.field_behavior) = REQUIRED,
|
|
361
|
+
(google.api.resource_reference) = {
|
|
362
|
+
type: "spanner.googleapis.com/InstanceConfig"
|
|
363
|
+
}
|
|
364
|
+
];
|
|
362
365
|
|
|
363
366
|
// Required. The descriptive name for this instance as it appears in UIs.
|
|
364
367
|
// Must be unique per project and between 4 and 30 characters in length.
|
|
365
|
-
string display_name = 3;
|
|
368
|
+
string display_name = 3 [(google.api.field_behavior) = REQUIRED];
|
|
366
369
|
|
|
367
370
|
// Required. The number of nodes allocated to this instance. This may be zero
|
|
368
371
|
// in API responses for instances that are not yet in state `READY`.
|
|
@@ -16,9 +16,9 @@ syntax = "proto3";
|
|
|
16
16
|
|
|
17
17
|
package google.spanner.v1;
|
|
18
18
|
|
|
19
|
+
import "google/api/annotations.proto";
|
|
19
20
|
import "google/protobuf/duration.proto";
|
|
20
21
|
import "google/protobuf/timestamp.proto";
|
|
21
|
-
import "google/api/annotations.proto";
|
|
22
22
|
|
|
23
23
|
option csharp_namespace = "Google.Cloud.Spanner.V1";
|
|
24
24
|
option go_package = "google.golang.org/genproto/googleapis/spanner/v1;spanner";
|
|
@@ -36,9 +36,9 @@ message CommitResponse {
|
|
|
36
36
|
// `mutation_count` value can help you maximize the number of mutations
|
|
37
37
|
// in a transaction and minimize the number of API round trips. You can
|
|
38
38
|
// also monitor this value to prevent transactions from exceeding the system
|
|
39
|
-
// [limit](
|
|
39
|
+
// [limit](https://cloud.google.com/spanner/quotas#limits_for_creating_reading_updating_and_deleting_data).
|
|
40
40
|
// If the number of mutations exceeds the limit, the server returns
|
|
41
|
-
// [INVALID_ARGUMENT](
|
|
41
|
+
// [INVALID_ARGUMENT](https://cloud.google.com/spanner/docs/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT).
|
|
42
42
|
int64 mutation_count = 1;
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -16,8 +16,8 @@ syntax = "proto3";
|
|
|
16
16
|
|
|
17
17
|
package google.spanner.v1;
|
|
18
18
|
|
|
19
|
-
import "google/protobuf/struct.proto";
|
|
20
19
|
import "google/api/annotations.proto";
|
|
20
|
+
import "google/protobuf/struct.proto";
|
|
21
21
|
|
|
22
22
|
option csharp_namespace = "Google.Cloud.Spanner.V1";
|
|
23
23
|
option go_package = "google.golang.org/genproto/googleapis/spanner/v1;spanner";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2021 Google LLC
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -16,9 +16,10 @@ syntax = "proto3";
|
|
|
16
16
|
|
|
17
17
|
package google.spanner.v1;
|
|
18
18
|
|
|
19
|
+
import "google/api/annotations.proto";
|
|
20
|
+
import "google/api/field_behavior.proto";
|
|
19
21
|
import "google/protobuf/struct.proto";
|
|
20
22
|
import "google/spanner/v1/keys.proto";
|
|
21
|
-
import "google/api/annotations.proto";
|
|
22
23
|
|
|
23
24
|
option csharp_namespace = "Google.Cloud.Spanner.V1";
|
|
24
25
|
option go_package = "google.golang.org/genproto/googleapis/spanner/v1;spanner";
|
|
@@ -36,7 +37,7 @@ message Mutation {
|
|
|
36
37
|
// [replace][google.spanner.v1.Mutation.replace] operations.
|
|
37
38
|
message Write {
|
|
38
39
|
// Required. The table whose rows will be written.
|
|
39
|
-
string table = 1;
|
|
40
|
+
string table = 1 [(google.api.field_behavior) = REQUIRED];
|
|
40
41
|
|
|
41
42
|
// The names of the columns in [table][google.spanner.v1.Mutation.Write.table] to be written.
|
|
42
43
|
//
|
|
@@ -59,7 +60,7 @@ message Mutation {
|
|
|
59
60
|
// Arguments to [delete][google.spanner.v1.Mutation.delete] operations.
|
|
60
61
|
message Delete {
|
|
61
62
|
// Required. The table whose rows will be deleted.
|
|
62
|
-
string table = 1;
|
|
63
|
+
string table = 1 [(google.api.field_behavior) = REQUIRED];
|
|
63
64
|
|
|
64
65
|
// Required. The primary keys of the rows within [table][google.spanner.v1.Mutation.Delete.table] to delete. The
|
|
65
66
|
// primary keys must be specified in the order in which they appear in the
|
|
@@ -67,7 +68,7 @@ message Mutation {
|
|
|
67
68
|
// statement used to create the table).
|
|
68
69
|
// Delete is idempotent. The transaction will succeed even if some or all
|
|
69
70
|
// rows do not exist.
|
|
70
|
-
KeySet key_set = 2;
|
|
71
|
+
KeySet key_set = 2 [(google.api.field_behavior) = REQUIRED];
|
|
71
72
|
}
|
|
72
73
|
|
|
73
74
|
// Required. The operation to perform.
|
|
@@ -16,8 +16,8 @@ syntax = "proto3";
|
|
|
16
16
|
|
|
17
17
|
package google.spanner.v1;
|
|
18
18
|
|
|
19
|
-
import "google/protobuf/struct.proto";
|
|
20
19
|
import "google/api/annotations.proto";
|
|
20
|
+
import "google/protobuf/struct.proto";
|
|
21
21
|
|
|
22
22
|
option csharp_namespace = "Google.Cloud.Spanner.V1";
|
|
23
23
|
option go_package = "google.golang.org/genproto/googleapis/spanner/v1;spanner";
|
|
@@ -29,6 +29,24 @@ option ruby_package = "Google::Cloud::Spanner::V1";
|
|
|
29
29
|
|
|
30
30
|
// Node information for nodes appearing in a [QueryPlan.plan_nodes][google.spanner.v1.QueryPlan.plan_nodes].
|
|
31
31
|
message PlanNode {
|
|
32
|
+
// The kind of [PlanNode][google.spanner.v1.PlanNode]. Distinguishes between the two different kinds of
|
|
33
|
+
// nodes that can appear in a query plan.
|
|
34
|
+
enum Kind {
|
|
35
|
+
// Not specified.
|
|
36
|
+
KIND_UNSPECIFIED = 0;
|
|
37
|
+
|
|
38
|
+
// Denotes a Relational operator node in the expression tree. Relational
|
|
39
|
+
// operators represent iterative processing of rows during query execution.
|
|
40
|
+
// For example, a `TableScan` operation that reads rows from a table.
|
|
41
|
+
RELATIONAL = 1;
|
|
42
|
+
|
|
43
|
+
// Denotes a Scalar node in the expression tree. Scalar nodes represent
|
|
44
|
+
// non-iterable entities in the query plan. For example, constants or
|
|
45
|
+
// arithmetic operators appearing inside predicate expressions or references
|
|
46
|
+
// to column names.
|
|
47
|
+
SCALAR = 2;
|
|
48
|
+
}
|
|
49
|
+
|
|
32
50
|
// Metadata associated with a parent-child relationship appearing in a
|
|
33
51
|
// [PlanNode][google.spanner.v1.PlanNode].
|
|
34
52
|
message ChildLink {
|
|
@@ -66,24 +84,6 @@ message PlanNode {
|
|
|
66
84
|
map<string, int32> subqueries = 2;
|
|
67
85
|
}
|
|
68
86
|
|
|
69
|
-
// The kind of [PlanNode][google.spanner.v1.PlanNode]. Distinguishes between the two different kinds of
|
|
70
|
-
// nodes that can appear in a query plan.
|
|
71
|
-
enum Kind {
|
|
72
|
-
// Not specified.
|
|
73
|
-
KIND_UNSPECIFIED = 0;
|
|
74
|
-
|
|
75
|
-
// Denotes a Relational operator node in the expression tree. Relational
|
|
76
|
-
// operators represent iterative processing of rows during query execution.
|
|
77
|
-
// For example, a `TableScan` operation that reads rows from a table.
|
|
78
|
-
RELATIONAL = 1;
|
|
79
|
-
|
|
80
|
-
// Denotes a Scalar node in the expression tree. Scalar nodes represent
|
|
81
|
-
// non-iterable entities in the query plan. For example, constants or
|
|
82
|
-
// arithmetic operators appearing inside predicate expressions or references
|
|
83
|
-
// to column names.
|
|
84
|
-
SCALAR = 2;
|
|
85
|
-
}
|
|
86
|
-
|
|
87
87
|
// The `PlanNode`'s index in [node list][google.spanner.v1.QueryPlan.plan_nodes].
|
|
88
88
|
int32 index = 1;
|
|
89
89
|
|
|
@@ -16,11 +16,12 @@ syntax = "proto3";
|
|
|
16
16
|
|
|
17
17
|
package google.spanner.v1;
|
|
18
18
|
|
|
19
|
+
import "google/api/annotations.proto";
|
|
19
20
|
import "google/protobuf/struct.proto";
|
|
21
|
+
import "google/spanner/v1/commit_response.proto";
|
|
20
22
|
import "google/spanner/v1/query_plan.proto";
|
|
21
23
|
import "google/spanner/v1/transaction.proto";
|
|
22
24
|
import "google/spanner/v1/type.proto";
|
|
23
|
-
import "google/api/annotations.proto";
|
|
24
25
|
|
|
25
26
|
option cc_enable_arenas = true;
|
|
26
27
|
option csharp_namespace = "Google.Cloud.Spanner.V1";
|
|
@@ -16,7 +16,6 @@ syntax = "proto3";
|
|
|
16
16
|
|
|
17
17
|
package google.spanner.v1;
|
|
18
18
|
|
|
19
|
-
import public "google/spanner/v1/commit_response.proto";
|
|
20
19
|
import "google/api/annotations.proto";
|
|
21
20
|
import "google/api/client.proto";
|
|
22
21
|
import "google/api/field_behavior.proto";
|
|
@@ -25,6 +24,7 @@ import "google/protobuf/empty.proto";
|
|
|
25
24
|
import "google/protobuf/struct.proto";
|
|
26
25
|
import "google/protobuf/timestamp.proto";
|
|
27
26
|
import "google/rpc/status.proto";
|
|
27
|
+
import public "google/spanner/v1/commit_response.proto";
|
|
28
28
|
import "google/spanner/v1/keys.proto";
|
|
29
29
|
import "google/spanner/v1/mutation.proto";
|
|
30
30
|
import "google/spanner/v1/result_set.proto";
|
|
@@ -300,8 +300,8 @@ message CreateSessionRequest {
|
|
|
300
300
|
}
|
|
301
301
|
];
|
|
302
302
|
|
|
303
|
-
// The session to create.
|
|
304
|
-
Session session = 2;
|
|
303
|
+
// Required. The session to create.
|
|
304
|
+
Session session = 2 [(google.api.field_behavior) = REQUIRED];
|
|
305
305
|
}
|
|
306
306
|
|
|
307
307
|
// The request for [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions].
|
|
@@ -469,6 +469,7 @@ message RequestOptions {
|
|
|
469
469
|
// Legal characters for `request_tag` values are all printable characters
|
|
470
470
|
// (ASCII 32 - 126) and the length of a request_tag is limited to 50
|
|
471
471
|
// characters. Values that exceed this limit are truncated.
|
|
472
|
+
// Any leading underscore (_) characters will be removed from the string.
|
|
472
473
|
string request_tag = 2;
|
|
473
474
|
|
|
474
475
|
// A tag used for statistics collection about this transaction.
|
|
@@ -476,17 +477,32 @@ message RequestOptions {
|
|
|
476
477
|
// that belongs to a transaction.
|
|
477
478
|
// The value of transaction_tag should be the same for all requests belonging
|
|
478
479
|
// to the same transaction.
|
|
479
|
-
// If this request doesn
|
|
480
|
+
// If this request doesn't belong to any transaction, transaction_tag will be
|
|
480
481
|
// ignored.
|
|
481
482
|
// Legal characters for `transaction_tag` values are all printable characters
|
|
482
483
|
// (ASCII 32 - 126) and the length of a transaction_tag is limited to 50
|
|
483
484
|
// characters. Values that exceed this limit are truncated.
|
|
485
|
+
// Any leading underscore (_) characters will be removed from the string.
|
|
484
486
|
string transaction_tag = 3;
|
|
485
487
|
}
|
|
486
488
|
|
|
487
489
|
// The request for [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql] and
|
|
488
490
|
// [ExecuteStreamingSql][google.spanner.v1.Spanner.ExecuteStreamingSql].
|
|
489
491
|
message ExecuteSqlRequest {
|
|
492
|
+
// Mode in which the statement must be processed.
|
|
493
|
+
enum QueryMode {
|
|
494
|
+
// The default mode. Only the statement results are returned.
|
|
495
|
+
NORMAL = 0;
|
|
496
|
+
|
|
497
|
+
// This mode returns only the query plan, without any results or
|
|
498
|
+
// execution statistics information.
|
|
499
|
+
PLAN = 1;
|
|
500
|
+
|
|
501
|
+
// This mode returns both the query plan and the execution statistics along
|
|
502
|
+
// with the results.
|
|
503
|
+
PROFILE = 2;
|
|
504
|
+
}
|
|
505
|
+
|
|
490
506
|
// Query optimizer configuration.
|
|
491
507
|
message QueryOptions {
|
|
492
508
|
// An option to control the selection of optimizer version.
|
|
@@ -540,20 +556,6 @@ message ExecuteSqlRequest {
|
|
|
540
556
|
string optimizer_statistics_package = 2;
|
|
541
557
|
}
|
|
542
558
|
|
|
543
|
-
// Mode in which the statement must be processed.
|
|
544
|
-
enum QueryMode {
|
|
545
|
-
// The default mode. Only the statement results are returned.
|
|
546
|
-
NORMAL = 0;
|
|
547
|
-
|
|
548
|
-
// This mode returns only the query plan, without any results or
|
|
549
|
-
// execution statistics information.
|
|
550
|
-
PLAN = 1;
|
|
551
|
-
|
|
552
|
-
// This mode returns both the query plan and the execution statistics along
|
|
553
|
-
// with the results.
|
|
554
|
-
PROFILE = 2;
|
|
555
|
-
}
|
|
556
|
-
|
|
557
559
|
// Required. The session in which the SQL query should be performed.
|
|
558
560
|
string session = 1 [
|
|
559
561
|
(google.api.field_behavior) = REQUIRED,
|
|
@@ -645,7 +647,7 @@ message ExecuteBatchDmlRequest {
|
|
|
645
647
|
// A single DML statement.
|
|
646
648
|
message Statement {
|
|
647
649
|
// Required. The DML string.
|
|
648
|
-
string sql = 1;
|
|
650
|
+
string sql = 1 [(google.api.field_behavior) = REQUIRED];
|
|
649
651
|
|
|
650
652
|
// Parameter names and values that bind to placeholders in the DML string.
|
|
651
653
|
//
|
|
@@ -16,9 +16,9 @@ syntax = "proto3";
|
|
|
16
16
|
|
|
17
17
|
package google.spanner.v1;
|
|
18
18
|
|
|
19
|
+
import "google/api/annotations.proto";
|
|
19
20
|
import "google/protobuf/duration.proto";
|
|
20
21
|
import "google/protobuf/timestamp.proto";
|
|
21
|
-
import "google/api/annotations.proto";
|
|
22
22
|
|
|
23
23
|
option csharp_namespace = "Google.Cloud.Spanner.V1";
|
|
24
24
|
option go_package = "google.golang.org/genproto/googleapis/spanner/v1;spanner";
|
|
@@ -28,8 +28,7 @@ option java_package = "com.google.spanner.v1";
|
|
|
28
28
|
option php_namespace = "Google\\Cloud\\Spanner\\V1";
|
|
29
29
|
option ruby_package = "Google::Cloud::Spanner::V1";
|
|
30
30
|
|
|
31
|
-
//
|
|
32
|
-
//
|
|
31
|
+
// Transactions:
|
|
33
32
|
//
|
|
34
33
|
// Each session can have at most one active transaction at a time (note that
|
|
35
34
|
// standalone reads and queries use a transaction internally and do count
|
|
@@ -37,8 +36,7 @@ option ruby_package = "Google::Cloud::Spanner::V1";
|
|
|
37
36
|
// completed, the session can immediately be re-used for the next transaction.
|
|
38
37
|
// It is not necessary to create a new session for each transaction.
|
|
39
38
|
//
|
|
40
|
-
//
|
|
41
|
-
//
|
|
39
|
+
// Transaction Modes:
|
|
42
40
|
// Cloud Spanner supports three transaction modes:
|
|
43
41
|
//
|
|
44
42
|
// 1. Locking read-write. This type of transaction is the only way
|
|
@@ -70,8 +68,7 @@ option ruby_package = "Google::Cloud::Spanner::V1";
|
|
|
70
68
|
// may, however, read/write data in different tables within that
|
|
71
69
|
// database.
|
|
72
70
|
//
|
|
73
|
-
//
|
|
74
|
-
//
|
|
71
|
+
// Locking Read-Write Transactions:
|
|
75
72
|
// Locking transactions may be used to atomically read-modify-write
|
|
76
73
|
// data anywhere in a database. This type of transaction is externally
|
|
77
74
|
// consistent.
|
|
@@ -93,8 +90,7 @@ option ruby_package = "Google::Cloud::Spanner::V1";
|
|
|
93
90
|
// [Rollback][google.spanner.v1.Spanner.Rollback] request to abort the
|
|
94
91
|
// transaction.
|
|
95
92
|
//
|
|
96
|
-
//
|
|
97
|
-
//
|
|
93
|
+
// Semantics:
|
|
98
94
|
// Cloud Spanner can commit the transaction if all read locks it acquired
|
|
99
95
|
// are still valid at commit time, and it is able to acquire write
|
|
100
96
|
// locks for all writes. Cloud Spanner can abort the transaction for any
|
|
@@ -106,8 +102,7 @@ option ruby_package = "Google::Cloud::Spanner::V1";
|
|
|
106
102
|
// use Cloud Spanner locks for any sort of mutual exclusion other than
|
|
107
103
|
// between Cloud Spanner transactions themselves.
|
|
108
104
|
//
|
|
109
|
-
//
|
|
110
|
-
//
|
|
105
|
+
// Retrying Aborted Transactions:
|
|
111
106
|
// When a transaction aborts, the application can choose to retry the
|
|
112
107
|
// whole transaction again. To maximize the chances of successfully
|
|
113
108
|
// committing the retry, the client should execute the retry in the
|
|
@@ -115,27 +110,25 @@ option ruby_package = "Google::Cloud::Spanner::V1";
|
|
|
115
110
|
// priority increases with each consecutive abort, meaning that each
|
|
116
111
|
// attempt has a slightly better chance of success than the previous.
|
|
117
112
|
//
|
|
118
|
-
// Under some circumstances (
|
|
113
|
+
// Under some circumstances (for example, many transactions attempting to
|
|
119
114
|
// modify the same row(s)), a transaction can abort many times in a
|
|
120
115
|
// short period before successfully committing. Thus, it is not a good
|
|
121
116
|
// idea to cap the number of retries a transaction can attempt;
|
|
122
|
-
// instead, it is better to limit the total amount of
|
|
117
|
+
// instead, it is better to limit the total amount of time spent
|
|
123
118
|
// retrying.
|
|
124
119
|
//
|
|
125
|
-
//
|
|
126
|
-
//
|
|
120
|
+
// Idle Transactions:
|
|
127
121
|
// A transaction is considered idle if it has no outstanding reads or
|
|
128
122
|
// SQL queries and has not started a read or SQL query within the last 10
|
|
129
123
|
// seconds. Idle transactions can be aborted by Cloud Spanner so that they
|
|
130
|
-
// don't hold on to locks indefinitely.
|
|
131
|
-
// fail with error `ABORTED`.
|
|
124
|
+
// don't hold on to locks indefinitely. If an idle transaction is aborted, the
|
|
125
|
+
// commit will fail with error `ABORTED`.
|
|
132
126
|
//
|
|
133
127
|
// If this behavior is undesirable, periodically executing a simple
|
|
134
|
-
// SQL query in the transaction (
|
|
128
|
+
// SQL query in the transaction (for example, `SELECT 1`) prevents the
|
|
135
129
|
// transaction from becoming idle.
|
|
136
130
|
//
|
|
137
|
-
//
|
|
138
|
-
//
|
|
131
|
+
// Snapshot Read-Only Transactions:
|
|
139
132
|
// Snapshot read-only transactions provides a simpler method than
|
|
140
133
|
// locking read-write transactions for doing several consistent
|
|
141
134
|
// reads. However, this type of transaction does not support writes.
|
|
@@ -172,8 +165,7 @@ option ruby_package = "Google::Cloud::Spanner::V1";
|
|
|
172
165
|
//
|
|
173
166
|
// Each type of timestamp bound is discussed in detail below.
|
|
174
167
|
//
|
|
175
|
-
//
|
|
176
|
-
//
|
|
168
|
+
// Strong:
|
|
177
169
|
// Strong reads are guaranteed to see the effects of all transactions
|
|
178
170
|
// that have committed before the start of the read. Furthermore, all
|
|
179
171
|
// rows yielded by a single read are consistent with each other -- if
|
|
@@ -188,13 +180,12 @@ option ruby_package = "Google::Cloud::Spanner::V1";
|
|
|
188
180
|
//
|
|
189
181
|
// See [TransactionOptions.ReadOnly.strong][google.spanner.v1.TransactionOptions.ReadOnly.strong].
|
|
190
182
|
//
|
|
191
|
-
//
|
|
192
|
-
//
|
|
183
|
+
// Exact Staleness:
|
|
193
184
|
// These timestamp bounds execute reads at a user-specified
|
|
194
185
|
// timestamp. Reads at a timestamp are guaranteed to see a consistent
|
|
195
186
|
// prefix of the global transaction history: they observe
|
|
196
|
-
// modifications done by all transactions with a commit timestamp
|
|
197
|
-
// the read timestamp, and observe none of the modifications done by
|
|
187
|
+
// modifications done by all transactions with a commit timestamp less than or
|
|
188
|
+
// equal to the read timestamp, and observe none of the modifications done by
|
|
198
189
|
// transactions with a larger commit timestamp. They will block until
|
|
199
190
|
// all conflicting transactions that may be assigned commit timestamps
|
|
200
191
|
// <= the read timestamp have finished.
|
|
@@ -210,8 +201,7 @@ option ruby_package = "Google::Cloud::Spanner::V1";
|
|
|
210
201
|
// See [TransactionOptions.ReadOnly.read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.read_timestamp] and
|
|
211
202
|
// [TransactionOptions.ReadOnly.exact_staleness][google.spanner.v1.TransactionOptions.ReadOnly.exact_staleness].
|
|
212
203
|
//
|
|
213
|
-
//
|
|
214
|
-
//
|
|
204
|
+
// Bounded Staleness:
|
|
215
205
|
// Bounded staleness modes allow Cloud Spanner to pick the read timestamp,
|
|
216
206
|
// subject to a user-provided staleness bound. Cloud Spanner chooses the
|
|
217
207
|
// newest timestamp within the staleness bound that allows execution
|
|
@@ -240,8 +230,7 @@ option ruby_package = "Google::Cloud::Spanner::V1";
|
|
|
240
230
|
// See [TransactionOptions.ReadOnly.max_staleness][google.spanner.v1.TransactionOptions.ReadOnly.max_staleness] and
|
|
241
231
|
// [TransactionOptions.ReadOnly.min_read_timestamp][google.spanner.v1.TransactionOptions.ReadOnly.min_read_timestamp].
|
|
242
232
|
//
|
|
243
|
-
//
|
|
244
|
-
//
|
|
233
|
+
// Old Read Timestamps and Garbage Collection:
|
|
245
234
|
// Cloud Spanner continuously garbage collects deleted and overwritten data
|
|
246
235
|
// in the background to reclaim storage space. This process is known
|
|
247
236
|
// as "version GC". By default, version GC reclaims versions after they
|
|
@@ -251,8 +240,7 @@ option ruby_package = "Google::Cloud::Spanner::V1";
|
|
|
251
240
|
// timestamp become too old while executing. Reads and SQL queries with
|
|
252
241
|
// too-old read timestamps fail with the error `FAILED_PRECONDITION`.
|
|
253
242
|
//
|
|
254
|
-
//
|
|
255
|
-
//
|
|
243
|
+
// Partitioned DML Transactions:
|
|
256
244
|
// Partitioned DML transactions are used to execute DML statements with a
|
|
257
245
|
// different execution strategy that provides different, and often better,
|
|
258
246
|
// scalability properties for large, table-wide operations than DML in a
|