@google-cloud/spanner 7.18.0 → 7.18.1
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 +7 -0
- package/README.md +1 -0
- package/build/protos/google/spanner/admin/database/v1/backup.proto +757 -0
- package/build/protos/google/spanner/admin/database/v1/backup_schedule.proto +230 -0
- package/build/protos/google/spanner/admin/database/v1/common.proto +132 -0
- package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +1209 -0
- package/build/protos/google/spanner/admin/instance/v1/common.proto +64 -0
- package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +2110 -0
- package/build/protos/google/spanner/executor/v1/cloud_executor.proto +1520 -0
- package/build/protos/google/spanner/v1/commit_response.proto +59 -0
- package/build/protos/google/spanner/v1/keys.proto +163 -0
- package/build/protos/google/spanner/v1/mutation.proto +107 -0
- package/build/protos/google/spanner/v1/query_plan.proto +128 -0
- package/build/protos/google/spanner/v1/result_set.proto +237 -0
- package/build/protos/google/spanner/v1/spanner.proto +1389 -0
- package/build/protos/google/spanner/v1/transaction.proto +575 -0
- package/build/protos/google/spanner/v1/type.proto +214 -0
- package/build/protos/protos.d.ts +39317 -0
- package/build/protos/protos.js +100360 -0
- package/build/protos/protos.json +10271 -0
- package/build/src/backup.d.ts +349 -0
- package/build/src/backup.js +246 -0
- package/build/src/batch-transaction.d.ts +247 -0
- package/build/src/batch-transaction.js +384 -0
- package/build/src/codec.d.ts +362 -0
- package/build/src/codec.js +791 -0
- package/build/src/common-grpc/service-object.d.ts +80 -0
- package/build/src/common-grpc/service-object.js +101 -0
- package/build/src/common-grpc/service.d.ts +445 -0
- package/build/src/common-grpc/service.js +826 -0
- package/build/src/common.d.ts +66 -0
- package/build/src/common.js +54 -0
- package/build/src/database.d.ts +2103 -0
- package/build/src/database.js +1655 -0
- package/build/src/extra_proto_list.json +1 -0
- package/build/src/helper.d.ts +45 -0
- package/build/src/helper.js +71 -0
- package/build/src/index.d.ts +1195 -0
- package/build/src/index.js +1059 -0
- package/build/src/instance-config.d.ts +294 -0
- package/build/src/instance-config.js +216 -0
- package/build/src/instance.d.ts +832 -0
- package/build/src/instance.js +781 -0
- package/build/src/instrument.d.ts +85 -0
- package/build/src/instrument.js +215 -0
- package/build/src/multiplexed-session.d.ts +136 -0
- package/build/src/multiplexed-session.js +197 -0
- package/build/src/partial-result-stream.d.ts +253 -0
- package/build/src/partial-result-stream.js +400 -0
- package/build/src/session-factory.d.ts +100 -0
- package/build/src/session-factory.js +93 -0
- package/build/src/session-pool.d.ts +471 -0
- package/build/src/session-pool.js +754 -0
- package/build/src/session.d.ts +258 -0
- package/build/src/session.js +348 -0
- package/build/src/spanner_grpc_config.json +92 -0
- package/build/src/table.d.ts +831 -0
- package/build/src/table.js +277 -0
- package/build/src/transaction-runner.d.ts +185 -0
- package/build/src/transaction-runner.js +282 -0
- package/build/src/transaction.d.ts +1691 -0
- package/build/src/transaction.js +2004 -0
- package/build/src/v1/database_admin_client.d.ts +2301 -0
- package/build/src/v1/database_admin_client.js +2286 -0
- package/build/src/v1/database_admin_client_config.json +160 -0
- package/build/src/v1/database_admin_proto_list.json +6 -0
- package/build/src/v1/gapic_metadata.json +27 -0
- package/build/src/v1/index.d.ts +4 -0
- package/build/src/v1/index.js +29 -0
- package/build/src/v1/instance_admin_client.d.ts +1985 -0
- package/build/src/v1/instance_admin_client.js +1768 -0
- package/build/src/v1/instance_admin_client_config.json +129 -0
- package/build/src/v1/instance_admin_proto_list.json +4 -0
- package/build/src/v1/spanner_client.d.ts +1250 -0
- package/build/src/v1/spanner_client.js +1086 -0
- package/build/src/v1/spanner_client_config.json +119 -0
- package/build/src/v1/spanner_executor_proxy_client.d.ts +418 -0
- package/build/src/v1/spanner_executor_proxy_client.js +706 -0
- package/build/src/v1/spanner_executor_proxy_client_config.json +30 -0
- package/build/src/v1/spanner_executor_proxy_proto_list.json +14 -0
- package/build/src/v1/spanner_proto_list.json +10 -0
- package/package.json +1 -1
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// Copyright 2024 Google LLC
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
syntax = "proto3";
|
|
16
|
+
|
|
17
|
+
package google.spanner.v1;
|
|
18
|
+
|
|
19
|
+
import "google/protobuf/timestamp.proto";
|
|
20
|
+
import "google/spanner/v1/transaction.proto";
|
|
21
|
+
|
|
22
|
+
option csharp_namespace = "Google.Cloud.Spanner.V1";
|
|
23
|
+
option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb";
|
|
24
|
+
option java_multiple_files = true;
|
|
25
|
+
option java_outer_classname = "CommitResponseProto";
|
|
26
|
+
option java_package = "com.google.spanner.v1";
|
|
27
|
+
option php_namespace = "Google\\Cloud\\Spanner\\V1";
|
|
28
|
+
option ruby_package = "Google::Cloud::Spanner::V1";
|
|
29
|
+
|
|
30
|
+
// The response for [Commit][google.spanner.v1.Spanner.Commit].
|
|
31
|
+
message CommitResponse {
|
|
32
|
+
// Additional statistics about a commit.
|
|
33
|
+
message CommitStats {
|
|
34
|
+
// The total number of mutations for the transaction. Knowing the
|
|
35
|
+
// `mutation_count` value can help you maximize the number of mutations
|
|
36
|
+
// in a transaction and minimize the number of API round trips. You can
|
|
37
|
+
// also monitor this value to prevent transactions from exceeding the system
|
|
38
|
+
// [limit](https://cloud.google.com/spanner/quotas#limits_for_creating_reading_updating_and_deleting_data).
|
|
39
|
+
// If the number of mutations exceeds the limit, the server returns
|
|
40
|
+
// [INVALID_ARGUMENT](https://cloud.google.com/spanner/docs/reference/rest/v1/Code#ENUM_VALUES.INVALID_ARGUMENT).
|
|
41
|
+
int64 mutation_count = 1;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// The Cloud Spanner timestamp at which the transaction committed.
|
|
45
|
+
google.protobuf.Timestamp commit_timestamp = 1;
|
|
46
|
+
|
|
47
|
+
// The statistics about this Commit. Not returned by default.
|
|
48
|
+
// For more information, see
|
|
49
|
+
// [CommitRequest.return_commit_stats][google.spanner.v1.CommitRequest.return_commit_stats].
|
|
50
|
+
CommitStats commit_stats = 2;
|
|
51
|
+
|
|
52
|
+
// Clients should examine and retry the commit if any of the following
|
|
53
|
+
// reasons are populated.
|
|
54
|
+
oneof MultiplexedSessionRetry {
|
|
55
|
+
// If specified, transaction has not committed yet.
|
|
56
|
+
// Clients must retry the commit with the new precommit token.
|
|
57
|
+
MultiplexedSessionPrecommitToken precommit_token = 4;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
// Copyright 2024 Google LLC
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
syntax = "proto3";
|
|
16
|
+
|
|
17
|
+
package google.spanner.v1;
|
|
18
|
+
|
|
19
|
+
import "google/protobuf/struct.proto";
|
|
20
|
+
|
|
21
|
+
option csharp_namespace = "Google.Cloud.Spanner.V1";
|
|
22
|
+
option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb";
|
|
23
|
+
option java_multiple_files = true;
|
|
24
|
+
option java_outer_classname = "KeysProto";
|
|
25
|
+
option java_package = "com.google.spanner.v1";
|
|
26
|
+
option php_namespace = "Google\\Cloud\\Spanner\\V1";
|
|
27
|
+
option ruby_package = "Google::Cloud::Spanner::V1";
|
|
28
|
+
|
|
29
|
+
// KeyRange represents a range of rows in a table or index.
|
|
30
|
+
//
|
|
31
|
+
// A range has a start key and an end key. These keys can be open or
|
|
32
|
+
// closed, indicating if the range includes rows with that key.
|
|
33
|
+
//
|
|
34
|
+
// Keys are represented by lists, where the ith value in the list
|
|
35
|
+
// corresponds to the ith component of the table or index primary key.
|
|
36
|
+
// Individual values are encoded as described
|
|
37
|
+
// [here][google.spanner.v1.TypeCode].
|
|
38
|
+
//
|
|
39
|
+
// For example, consider the following table definition:
|
|
40
|
+
//
|
|
41
|
+
// CREATE TABLE UserEvents (
|
|
42
|
+
// UserName STRING(MAX),
|
|
43
|
+
// EventDate STRING(10)
|
|
44
|
+
// ) PRIMARY KEY(UserName, EventDate);
|
|
45
|
+
//
|
|
46
|
+
// The following keys name rows in this table:
|
|
47
|
+
//
|
|
48
|
+
// ["Bob", "2014-09-23"]
|
|
49
|
+
// ["Alfred", "2015-06-12"]
|
|
50
|
+
//
|
|
51
|
+
// Since the `UserEvents` table's `PRIMARY KEY` clause names two
|
|
52
|
+
// columns, each `UserEvents` key has two elements; the first is the
|
|
53
|
+
// `UserName`, and the second is the `EventDate`.
|
|
54
|
+
//
|
|
55
|
+
// Key ranges with multiple components are interpreted
|
|
56
|
+
// lexicographically by component using the table or index key's declared
|
|
57
|
+
// sort order. For example, the following range returns all events for
|
|
58
|
+
// user `"Bob"` that occurred in the year 2015:
|
|
59
|
+
//
|
|
60
|
+
// "start_closed": ["Bob", "2015-01-01"]
|
|
61
|
+
// "end_closed": ["Bob", "2015-12-31"]
|
|
62
|
+
//
|
|
63
|
+
// Start and end keys can omit trailing key components. This affects the
|
|
64
|
+
// inclusion and exclusion of rows that exactly match the provided key
|
|
65
|
+
// components: if the key is closed, then rows that exactly match the
|
|
66
|
+
// provided components are included; if the key is open, then rows
|
|
67
|
+
// that exactly match are not included.
|
|
68
|
+
//
|
|
69
|
+
// For example, the following range includes all events for `"Bob"` that
|
|
70
|
+
// occurred during and after the year 2000:
|
|
71
|
+
//
|
|
72
|
+
// "start_closed": ["Bob", "2000-01-01"]
|
|
73
|
+
// "end_closed": ["Bob"]
|
|
74
|
+
//
|
|
75
|
+
// The next example retrieves all events for `"Bob"`:
|
|
76
|
+
//
|
|
77
|
+
// "start_closed": ["Bob"]
|
|
78
|
+
// "end_closed": ["Bob"]
|
|
79
|
+
//
|
|
80
|
+
// To retrieve events before the year 2000:
|
|
81
|
+
//
|
|
82
|
+
// "start_closed": ["Bob"]
|
|
83
|
+
// "end_open": ["Bob", "2000-01-01"]
|
|
84
|
+
//
|
|
85
|
+
// The following range includes all rows in the table:
|
|
86
|
+
//
|
|
87
|
+
// "start_closed": []
|
|
88
|
+
// "end_closed": []
|
|
89
|
+
//
|
|
90
|
+
// This range returns all users whose `UserName` begins with any
|
|
91
|
+
// character from A to C:
|
|
92
|
+
//
|
|
93
|
+
// "start_closed": ["A"]
|
|
94
|
+
// "end_open": ["D"]
|
|
95
|
+
//
|
|
96
|
+
// This range returns all users whose `UserName` begins with B:
|
|
97
|
+
//
|
|
98
|
+
// "start_closed": ["B"]
|
|
99
|
+
// "end_open": ["C"]
|
|
100
|
+
//
|
|
101
|
+
// Key ranges honor column sort order. For example, suppose a table is
|
|
102
|
+
// defined as follows:
|
|
103
|
+
//
|
|
104
|
+
// CREATE TABLE DescendingSortedTable {
|
|
105
|
+
// Key INT64,
|
|
106
|
+
// ...
|
|
107
|
+
// ) PRIMARY KEY(Key DESC);
|
|
108
|
+
//
|
|
109
|
+
// The following range retrieves all rows with key values between 1
|
|
110
|
+
// and 100 inclusive:
|
|
111
|
+
//
|
|
112
|
+
// "start_closed": ["100"]
|
|
113
|
+
// "end_closed": ["1"]
|
|
114
|
+
//
|
|
115
|
+
// Note that 100 is passed as the start, and 1 is passed as the end,
|
|
116
|
+
// because `Key` is a descending column in the schema.
|
|
117
|
+
message KeyRange {
|
|
118
|
+
// The start key must be provided. It can be either closed or open.
|
|
119
|
+
oneof start_key_type {
|
|
120
|
+
// If the start is closed, then the range includes all rows whose
|
|
121
|
+
// first `len(start_closed)` key columns exactly match `start_closed`.
|
|
122
|
+
google.protobuf.ListValue start_closed = 1;
|
|
123
|
+
|
|
124
|
+
// If the start is open, then the range excludes rows whose first
|
|
125
|
+
// `len(start_open)` key columns exactly match `start_open`.
|
|
126
|
+
google.protobuf.ListValue start_open = 2;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
// The end key must be provided. It can be either closed or open.
|
|
130
|
+
oneof end_key_type {
|
|
131
|
+
// If the end is closed, then the range includes all rows whose
|
|
132
|
+
// first `len(end_closed)` key columns exactly match `end_closed`.
|
|
133
|
+
google.protobuf.ListValue end_closed = 3;
|
|
134
|
+
|
|
135
|
+
// If the end is open, then the range excludes rows whose first
|
|
136
|
+
// `len(end_open)` key columns exactly match `end_open`.
|
|
137
|
+
google.protobuf.ListValue end_open = 4;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// `KeySet` defines a collection of Cloud Spanner keys and/or key ranges. All
|
|
142
|
+
// the keys are expected to be in the same table or index. The keys need
|
|
143
|
+
// not be sorted in any particular way.
|
|
144
|
+
//
|
|
145
|
+
// If the same key is specified multiple times in the set (for example
|
|
146
|
+
// if two ranges, two keys, or a key and a range overlap), Cloud Spanner
|
|
147
|
+
// behaves as if the key were only specified once.
|
|
148
|
+
message KeySet {
|
|
149
|
+
// A list of specific keys. Entries in `keys` should have exactly as
|
|
150
|
+
// many elements as there are columns in the primary or index key
|
|
151
|
+
// with which this `KeySet` is used. Individual key values are
|
|
152
|
+
// encoded as described [here][google.spanner.v1.TypeCode].
|
|
153
|
+
repeated google.protobuf.ListValue keys = 1;
|
|
154
|
+
|
|
155
|
+
// A list of key ranges. See [KeyRange][google.spanner.v1.KeyRange] for more information about
|
|
156
|
+
// key range specifications.
|
|
157
|
+
repeated KeyRange ranges = 2;
|
|
158
|
+
|
|
159
|
+
// For convenience `all` can be set to `true` to indicate that this
|
|
160
|
+
// `KeySet` matches all keys in the table or index. Note that any keys
|
|
161
|
+
// specified in `keys` or `ranges` are only yielded once.
|
|
162
|
+
bool all = 3;
|
|
163
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
// Copyright 2024 Google LLC
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
syntax = "proto3";
|
|
16
|
+
|
|
17
|
+
package google.spanner.v1;
|
|
18
|
+
|
|
19
|
+
import "google/api/field_behavior.proto";
|
|
20
|
+
import "google/protobuf/struct.proto";
|
|
21
|
+
import "google/spanner/v1/keys.proto";
|
|
22
|
+
|
|
23
|
+
option csharp_namespace = "Google.Cloud.Spanner.V1";
|
|
24
|
+
option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb";
|
|
25
|
+
option java_multiple_files = true;
|
|
26
|
+
option java_outer_classname = "MutationProto";
|
|
27
|
+
option java_package = "com.google.spanner.v1";
|
|
28
|
+
option php_namespace = "Google\\Cloud\\Spanner\\V1";
|
|
29
|
+
option ruby_package = "Google::Cloud::Spanner::V1";
|
|
30
|
+
|
|
31
|
+
// A modification to one or more Cloud Spanner rows. Mutations can be
|
|
32
|
+
// applied to a Cloud Spanner database by sending them in a
|
|
33
|
+
// [Commit][google.spanner.v1.Spanner.Commit] call.
|
|
34
|
+
message Mutation {
|
|
35
|
+
// Arguments to [insert][google.spanner.v1.Mutation.insert], [update][google.spanner.v1.Mutation.update], [insert_or_update][google.spanner.v1.Mutation.insert_or_update], and
|
|
36
|
+
// [replace][google.spanner.v1.Mutation.replace] operations.
|
|
37
|
+
message Write {
|
|
38
|
+
// Required. The table whose rows will be written.
|
|
39
|
+
string table = 1 [(google.api.field_behavior) = REQUIRED];
|
|
40
|
+
|
|
41
|
+
// The names of the columns in [table][google.spanner.v1.Mutation.Write.table] to be written.
|
|
42
|
+
//
|
|
43
|
+
// The list of columns must contain enough columns to allow
|
|
44
|
+
// Cloud Spanner to derive values for all primary key columns in the
|
|
45
|
+
// row(s) to be modified.
|
|
46
|
+
repeated string columns = 2;
|
|
47
|
+
|
|
48
|
+
// The values to be written. `values` can contain more than one
|
|
49
|
+
// list of values. If it does, then multiple rows are written, one
|
|
50
|
+
// for each entry in `values`. Each list in `values` must have
|
|
51
|
+
// exactly as many entries as there are entries in [columns][google.spanner.v1.Mutation.Write.columns]
|
|
52
|
+
// above. Sending multiple lists is equivalent to sending multiple
|
|
53
|
+
// `Mutation`s, each containing one `values` entry and repeating
|
|
54
|
+
// [table][google.spanner.v1.Mutation.Write.table] and [columns][google.spanner.v1.Mutation.Write.columns]. Individual values in each list are
|
|
55
|
+
// encoded as described [here][google.spanner.v1.TypeCode].
|
|
56
|
+
repeated google.protobuf.ListValue values = 3;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Arguments to [delete][google.spanner.v1.Mutation.delete] operations.
|
|
60
|
+
message Delete {
|
|
61
|
+
// Required. The table whose rows will be deleted.
|
|
62
|
+
string table = 1 [(google.api.field_behavior) = REQUIRED];
|
|
63
|
+
|
|
64
|
+
// Required. The primary keys of the rows within [table][google.spanner.v1.Mutation.Delete.table] to delete. The
|
|
65
|
+
// primary keys must be specified in the order in which they appear in the
|
|
66
|
+
// `PRIMARY KEY()` clause of the table's equivalent DDL statement (the DDL
|
|
67
|
+
// statement used to create the table).
|
|
68
|
+
// Delete is idempotent. The transaction will succeed even if some or all
|
|
69
|
+
// rows do not exist.
|
|
70
|
+
KeySet key_set = 2 [(google.api.field_behavior) = REQUIRED];
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// Required. The operation to perform.
|
|
74
|
+
oneof operation {
|
|
75
|
+
// Insert new rows in a table. If any of the rows already exist,
|
|
76
|
+
// the write or transaction fails with error `ALREADY_EXISTS`.
|
|
77
|
+
Write insert = 1;
|
|
78
|
+
|
|
79
|
+
// Update existing rows in a table. If any of the rows does not
|
|
80
|
+
// already exist, the transaction fails with error `NOT_FOUND`.
|
|
81
|
+
Write update = 2;
|
|
82
|
+
|
|
83
|
+
// Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, then
|
|
84
|
+
// its column values are overwritten with the ones provided. Any
|
|
85
|
+
// column values not explicitly written are preserved.
|
|
86
|
+
//
|
|
87
|
+
// When using [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as when using [insert][google.spanner.v1.Mutation.insert], all `NOT
|
|
88
|
+
// NULL` columns in the table must be given a value. This holds true
|
|
89
|
+
// even when the row already exists and will therefore actually be updated.
|
|
90
|
+
Write insert_or_update = 3;
|
|
91
|
+
|
|
92
|
+
// Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, it is
|
|
93
|
+
// deleted, and the column values provided are inserted
|
|
94
|
+
// instead. Unlike [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this means any values not
|
|
95
|
+
// explicitly written become `NULL`.
|
|
96
|
+
//
|
|
97
|
+
// In an interleaved table, if you create the child table with the
|
|
98
|
+
// `ON DELETE CASCADE` annotation, then replacing a parent row
|
|
99
|
+
// also deletes the child rows. Otherwise, you must delete the
|
|
100
|
+
// child rows before you replace the parent row.
|
|
101
|
+
Write replace = 4;
|
|
102
|
+
|
|
103
|
+
// Delete rows from a table. Succeeds whether or not the named
|
|
104
|
+
// rows were present.
|
|
105
|
+
Delete delete = 5;
|
|
106
|
+
}
|
|
107
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
// Copyright 2024 Google LLC
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
syntax = "proto3";
|
|
16
|
+
|
|
17
|
+
package google.spanner.v1;
|
|
18
|
+
|
|
19
|
+
import "google/protobuf/struct.proto";
|
|
20
|
+
|
|
21
|
+
option csharp_namespace = "Google.Cloud.Spanner.V1";
|
|
22
|
+
option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb";
|
|
23
|
+
option java_multiple_files = true;
|
|
24
|
+
option java_outer_classname = "QueryPlanProto";
|
|
25
|
+
option java_package = "com.google.spanner.v1";
|
|
26
|
+
option php_namespace = "Google\\Cloud\\Spanner\\V1";
|
|
27
|
+
option ruby_package = "Google::Cloud::Spanner::V1";
|
|
28
|
+
|
|
29
|
+
// Node information for nodes appearing in a [QueryPlan.plan_nodes][google.spanner.v1.QueryPlan.plan_nodes].
|
|
30
|
+
message PlanNode {
|
|
31
|
+
// The kind of [PlanNode][google.spanner.v1.PlanNode]. Distinguishes between the two different kinds of
|
|
32
|
+
// nodes that can appear in a query plan.
|
|
33
|
+
enum Kind {
|
|
34
|
+
// Not specified.
|
|
35
|
+
KIND_UNSPECIFIED = 0;
|
|
36
|
+
|
|
37
|
+
// Denotes a Relational operator node in the expression tree. Relational
|
|
38
|
+
// operators represent iterative processing of rows during query execution.
|
|
39
|
+
// For example, a `TableScan` operation that reads rows from a table.
|
|
40
|
+
RELATIONAL = 1;
|
|
41
|
+
|
|
42
|
+
// Denotes a Scalar node in the expression tree. Scalar nodes represent
|
|
43
|
+
// non-iterable entities in the query plan. For example, constants or
|
|
44
|
+
// arithmetic operators appearing inside predicate expressions or references
|
|
45
|
+
// to column names.
|
|
46
|
+
SCALAR = 2;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// Metadata associated with a parent-child relationship appearing in a
|
|
50
|
+
// [PlanNode][google.spanner.v1.PlanNode].
|
|
51
|
+
message ChildLink {
|
|
52
|
+
// The node to which the link points.
|
|
53
|
+
int32 child_index = 1;
|
|
54
|
+
|
|
55
|
+
// The type of the link. For example, in Hash Joins this could be used to
|
|
56
|
+
// distinguish between the build child and the probe child, or in the case
|
|
57
|
+
// of the child being an output variable, to represent the tag associated
|
|
58
|
+
// with the output variable.
|
|
59
|
+
string type = 2;
|
|
60
|
+
|
|
61
|
+
// Only present if the child node is [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] and corresponds
|
|
62
|
+
// to an output variable of the parent node. The field carries the name of
|
|
63
|
+
// the output variable.
|
|
64
|
+
// For example, a `TableScan` operator that reads rows from a table will
|
|
65
|
+
// have child links to the `SCALAR` nodes representing the output variables
|
|
66
|
+
// created for each column that is read by the operator. The corresponding
|
|
67
|
+
// `variable` fields will be set to the variable names assigned to the
|
|
68
|
+
// columns.
|
|
69
|
+
string variable = 3;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// Condensed representation of a node and its subtree. Only present for
|
|
73
|
+
// `SCALAR` [PlanNode(s)][google.spanner.v1.PlanNode].
|
|
74
|
+
message ShortRepresentation {
|
|
75
|
+
// A string representation of the expression subtree rooted at this node.
|
|
76
|
+
string description = 1;
|
|
77
|
+
|
|
78
|
+
// A mapping of (subquery variable name) -> (subquery node id) for cases
|
|
79
|
+
// where the `description` string of this node references a `SCALAR`
|
|
80
|
+
// subquery contained in the expression subtree rooted at this node. The
|
|
81
|
+
// referenced `SCALAR` subquery may not necessarily be a direct child of
|
|
82
|
+
// this node.
|
|
83
|
+
map<string, int32> subqueries = 2;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
// The `PlanNode`'s index in [node list][google.spanner.v1.QueryPlan.plan_nodes].
|
|
87
|
+
int32 index = 1;
|
|
88
|
+
|
|
89
|
+
// Used to determine the type of node. May be needed for visualizing
|
|
90
|
+
// different kinds of nodes differently. For example, If the node is a
|
|
91
|
+
// [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] node, it will have a condensed representation
|
|
92
|
+
// which can be used to directly embed a description of the node in its
|
|
93
|
+
// parent.
|
|
94
|
+
Kind kind = 2;
|
|
95
|
+
|
|
96
|
+
// The display name for the node.
|
|
97
|
+
string display_name = 3;
|
|
98
|
+
|
|
99
|
+
// List of child node `index`es and their relationship to this parent.
|
|
100
|
+
repeated ChildLink child_links = 4;
|
|
101
|
+
|
|
102
|
+
// Condensed representation for [SCALAR][google.spanner.v1.PlanNode.Kind.SCALAR] nodes.
|
|
103
|
+
ShortRepresentation short_representation = 5;
|
|
104
|
+
|
|
105
|
+
// Attributes relevant to the node contained in a group of key-value pairs.
|
|
106
|
+
// For example, a Parameter Reference node could have the following
|
|
107
|
+
// information in its metadata:
|
|
108
|
+
//
|
|
109
|
+
// {
|
|
110
|
+
// "parameter_reference": "param1",
|
|
111
|
+
// "parameter_type": "array"
|
|
112
|
+
// }
|
|
113
|
+
google.protobuf.Struct metadata = 6;
|
|
114
|
+
|
|
115
|
+
// The execution statistics associated with the node, contained in a group of
|
|
116
|
+
// key-value pairs. Only present if the plan was returned as a result of a
|
|
117
|
+
// profile query. For example, number of executions, number of rows/time per
|
|
118
|
+
// execution etc.
|
|
119
|
+
google.protobuf.Struct execution_stats = 7;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
// Contains an ordered list of nodes appearing in the query plan.
|
|
123
|
+
message QueryPlan {
|
|
124
|
+
// The nodes in the query plan. Plan nodes are returned in pre-order starting
|
|
125
|
+
// with the plan root. Each [PlanNode][google.spanner.v1.PlanNode]'s `id` corresponds to its index in
|
|
126
|
+
// `plan_nodes`.
|
|
127
|
+
repeated PlanNode plan_nodes = 1;
|
|
128
|
+
}
|