@google-cloud/spanner 7.18.0 → 7.19.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 +30 -0
- package/README.md +1 -0
- package/build/protos/google/spanner/admin/database/v1/backup.proto +773 -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 +1279 -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 +622 -0
- package/build/protos/google/spanner/v1/type.proto +214 -0
- package/build/protos/protos.d.ts +39869 -0
- package/build/protos/protos.js +101659 -0
- package/build/protos/protos.json +10391 -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 +1660 -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 +135 -0
- package/build/src/multiplexed-session.js +194 -0
- package/build/src/partial-result-stream.d.ts +253 -0
- package/build/src/partial-result-stream.js +400 -0
- package/build/src/request_id_header.d.ts +41 -0
- package/build/src/request_id_header.js +138 -0
- package/build/src/session-factory.d.ts +115 -0
- package/build/src/session-factory.js +106 -0
- package/build/src/session-pool.d.ts +471 -0
- package/build/src/session-pool.js +765 -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 +2003 -0
- package/build/src/v1/database_admin_client.d.ts +2332 -0
- package/build/src/v1/database_admin_client.js +2364 -0
- package/build/src/v1/database_admin_client_config.json +165 -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,237 @@
|
|
|
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/query_plan.proto";
|
|
22
|
+
import "google/spanner/v1/transaction.proto";
|
|
23
|
+
import "google/spanner/v1/type.proto";
|
|
24
|
+
|
|
25
|
+
option cc_enable_arenas = true;
|
|
26
|
+
option csharp_namespace = "Google.Cloud.Spanner.V1";
|
|
27
|
+
option go_package = "cloud.google.com/go/spanner/apiv1/spannerpb;spannerpb";
|
|
28
|
+
option java_multiple_files = true;
|
|
29
|
+
option java_outer_classname = "ResultSetProto";
|
|
30
|
+
option java_package = "com.google.spanner.v1";
|
|
31
|
+
option php_namespace = "Google\\Cloud\\Spanner\\V1";
|
|
32
|
+
option ruby_package = "Google::Cloud::Spanner::V1";
|
|
33
|
+
|
|
34
|
+
// Results from [Read][google.spanner.v1.Spanner.Read] or
|
|
35
|
+
// [ExecuteSql][google.spanner.v1.Spanner.ExecuteSql].
|
|
36
|
+
message ResultSet {
|
|
37
|
+
// Metadata about the result set, such as row type information.
|
|
38
|
+
ResultSetMetadata metadata = 1;
|
|
39
|
+
|
|
40
|
+
// Each element in `rows` is a row whose format is defined by
|
|
41
|
+
// [metadata.row_type][google.spanner.v1.ResultSetMetadata.row_type]. The ith element
|
|
42
|
+
// in each row matches the ith field in
|
|
43
|
+
// [metadata.row_type][google.spanner.v1.ResultSetMetadata.row_type]. Elements are
|
|
44
|
+
// encoded based on type as described
|
|
45
|
+
// [here][google.spanner.v1.TypeCode].
|
|
46
|
+
repeated google.protobuf.ListValue rows = 2;
|
|
47
|
+
|
|
48
|
+
// Query plan and execution statistics for the SQL statement that
|
|
49
|
+
// produced this result set. These can be requested by setting
|
|
50
|
+
// [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode].
|
|
51
|
+
// DML statements always produce stats containing the number of rows
|
|
52
|
+
// modified, unless executed using the
|
|
53
|
+
// [ExecuteSqlRequest.QueryMode.PLAN][google.spanner.v1.ExecuteSqlRequest.QueryMode.PLAN] [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode].
|
|
54
|
+
// Other fields may or may not be populated, based on the
|
|
55
|
+
// [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode].
|
|
56
|
+
ResultSetStats stats = 3;
|
|
57
|
+
|
|
58
|
+
// Optional. A precommit token will be included if the read-write transaction
|
|
59
|
+
// is on a multiplexed session.
|
|
60
|
+
// The precommit token with the highest sequence number from this transaction
|
|
61
|
+
// attempt should be passed to the
|
|
62
|
+
// [Commit][google.spanner.v1.Spanner.Commit] request for this transaction.
|
|
63
|
+
// This feature is not yet supported and will result in an UNIMPLEMENTED
|
|
64
|
+
// error.
|
|
65
|
+
MultiplexedSessionPrecommitToken precommit_token = 5
|
|
66
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// Partial results from a streaming read or SQL query. Streaming reads and
|
|
70
|
+
// SQL queries better tolerate large result sets, large rows, and large
|
|
71
|
+
// values, but are a little trickier to consume.
|
|
72
|
+
message PartialResultSet {
|
|
73
|
+
// Metadata about the result set, such as row type information.
|
|
74
|
+
// Only present in the first response.
|
|
75
|
+
ResultSetMetadata metadata = 1;
|
|
76
|
+
|
|
77
|
+
// A streamed result set consists of a stream of values, which might
|
|
78
|
+
// be split into many `PartialResultSet` messages to accommodate
|
|
79
|
+
// large rows and/or large values. Every N complete values defines a
|
|
80
|
+
// row, where N is equal to the number of entries in
|
|
81
|
+
// [metadata.row_type.fields][google.spanner.v1.StructType.fields].
|
|
82
|
+
//
|
|
83
|
+
// Most values are encoded based on type as described
|
|
84
|
+
// [here][google.spanner.v1.TypeCode].
|
|
85
|
+
//
|
|
86
|
+
// It is possible that the last value in values is "chunked",
|
|
87
|
+
// meaning that the rest of the value is sent in subsequent
|
|
88
|
+
// `PartialResultSet`(s). This is denoted by the [chunked_value][google.spanner.v1.PartialResultSet.chunked_value]
|
|
89
|
+
// field. Two or more chunked values can be merged to form a
|
|
90
|
+
// complete value as follows:
|
|
91
|
+
//
|
|
92
|
+
// * `bool/number/null`: cannot be chunked
|
|
93
|
+
// * `string`: concatenate the strings
|
|
94
|
+
// * `list`: concatenate the lists. If the last element in a list is a
|
|
95
|
+
// `string`, `list`, or `object`, merge it with the first element in
|
|
96
|
+
// the next list by applying these rules recursively.
|
|
97
|
+
// * `object`: concatenate the (field name, field value) pairs. If a
|
|
98
|
+
// field name is duplicated, then apply these rules recursively
|
|
99
|
+
// to merge the field values.
|
|
100
|
+
//
|
|
101
|
+
// Some examples of merging:
|
|
102
|
+
//
|
|
103
|
+
// # Strings are concatenated.
|
|
104
|
+
// "foo", "bar" => "foobar"
|
|
105
|
+
//
|
|
106
|
+
// # Lists of non-strings are concatenated.
|
|
107
|
+
// [2, 3], [4] => [2, 3, 4]
|
|
108
|
+
//
|
|
109
|
+
// # Lists are concatenated, but the last and first elements are merged
|
|
110
|
+
// # because they are strings.
|
|
111
|
+
// ["a", "b"], ["c", "d"] => ["a", "bc", "d"]
|
|
112
|
+
//
|
|
113
|
+
// # Lists are concatenated, but the last and first elements are merged
|
|
114
|
+
// # because they are lists. Recursively, the last and first elements
|
|
115
|
+
// # of the inner lists are merged because they are strings.
|
|
116
|
+
// ["a", ["b", "c"]], [["d"], "e"] => ["a", ["b", "cd"], "e"]
|
|
117
|
+
//
|
|
118
|
+
// # Non-overlapping object fields are combined.
|
|
119
|
+
// {"a": "1"}, {"b": "2"} => {"a": "1", "b": 2"}
|
|
120
|
+
//
|
|
121
|
+
// # Overlapping object fields are merged.
|
|
122
|
+
// {"a": "1"}, {"a": "2"} => {"a": "12"}
|
|
123
|
+
//
|
|
124
|
+
// # Examples of merging objects containing lists of strings.
|
|
125
|
+
// {"a": ["1"]}, {"a": ["2"]} => {"a": ["12"]}
|
|
126
|
+
//
|
|
127
|
+
// For a more complete example, suppose a streaming SQL query is
|
|
128
|
+
// yielding a result set whose rows contain a single string
|
|
129
|
+
// field. The following `PartialResultSet`s might be yielded:
|
|
130
|
+
//
|
|
131
|
+
// {
|
|
132
|
+
// "metadata": { ... }
|
|
133
|
+
// "values": ["Hello", "W"]
|
|
134
|
+
// "chunked_value": true
|
|
135
|
+
// "resume_token": "Af65..."
|
|
136
|
+
// }
|
|
137
|
+
// {
|
|
138
|
+
// "values": ["orl"]
|
|
139
|
+
// "chunked_value": true
|
|
140
|
+
// "resume_token": "Bqp2..."
|
|
141
|
+
// }
|
|
142
|
+
// {
|
|
143
|
+
// "values": ["d"]
|
|
144
|
+
// "resume_token": "Zx1B..."
|
|
145
|
+
// }
|
|
146
|
+
//
|
|
147
|
+
// This sequence of `PartialResultSet`s encodes two rows, one
|
|
148
|
+
// containing the field value `"Hello"`, and a second containing the
|
|
149
|
+
// field value `"World" = "W" + "orl" + "d"`.
|
|
150
|
+
repeated google.protobuf.Value values = 2;
|
|
151
|
+
|
|
152
|
+
// If true, then the final value in [values][google.spanner.v1.PartialResultSet.values] is chunked, and must
|
|
153
|
+
// be combined with more values from subsequent `PartialResultSet`s
|
|
154
|
+
// to obtain a complete field value.
|
|
155
|
+
bool chunked_value = 3;
|
|
156
|
+
|
|
157
|
+
// Streaming calls might be interrupted for a variety of reasons, such
|
|
158
|
+
// as TCP connection loss. If this occurs, the stream of results can
|
|
159
|
+
// be resumed by re-sending the original request and including
|
|
160
|
+
// `resume_token`. Note that executing any other transaction in the
|
|
161
|
+
// same session invalidates the token.
|
|
162
|
+
bytes resume_token = 4;
|
|
163
|
+
|
|
164
|
+
// Query plan and execution statistics for the statement that produced this
|
|
165
|
+
// streaming result set. These can be requested by setting
|
|
166
|
+
// [ExecuteSqlRequest.query_mode][google.spanner.v1.ExecuteSqlRequest.query_mode] and are sent
|
|
167
|
+
// only once with the last response in the stream.
|
|
168
|
+
// This field will also be present in the last response for DML
|
|
169
|
+
// statements.
|
|
170
|
+
ResultSetStats stats = 5;
|
|
171
|
+
|
|
172
|
+
// Optional. A precommit token will be included if the read-write transaction
|
|
173
|
+
// is on a multiplexed session.
|
|
174
|
+
// The precommit token with the highest sequence number from this transaction
|
|
175
|
+
// attempt should be passed to the
|
|
176
|
+
// [Commit][google.spanner.v1.Spanner.Commit] request for this transaction.
|
|
177
|
+
// This feature is not yet supported and will result in an UNIMPLEMENTED
|
|
178
|
+
// error.
|
|
179
|
+
MultiplexedSessionPrecommitToken precommit_token = 8
|
|
180
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
// Metadata about a [ResultSet][google.spanner.v1.ResultSet] or [PartialResultSet][google.spanner.v1.PartialResultSet].
|
|
184
|
+
message ResultSetMetadata {
|
|
185
|
+
// Indicates the field names and types for the rows in the result
|
|
186
|
+
// set. For example, a SQL query like `"SELECT UserId, UserName FROM
|
|
187
|
+
// Users"` could return a `row_type` value like:
|
|
188
|
+
//
|
|
189
|
+
// "fields": [
|
|
190
|
+
// { "name": "UserId", "type": { "code": "INT64" } },
|
|
191
|
+
// { "name": "UserName", "type": { "code": "STRING" } },
|
|
192
|
+
// ]
|
|
193
|
+
StructType row_type = 1;
|
|
194
|
+
|
|
195
|
+
// If the read or SQL query began a transaction as a side-effect, the
|
|
196
|
+
// information about the new transaction is yielded here.
|
|
197
|
+
Transaction transaction = 2;
|
|
198
|
+
|
|
199
|
+
// A SQL query can be parameterized. In PLAN mode, these parameters can be
|
|
200
|
+
// undeclared. This indicates the field names and types for those undeclared
|
|
201
|
+
// parameters in the SQL query. For example, a SQL query like `"SELECT * FROM
|
|
202
|
+
// Users where UserId = @userId and UserName = @userName "` could return a
|
|
203
|
+
// `undeclared_parameters` value like:
|
|
204
|
+
//
|
|
205
|
+
// "fields": [
|
|
206
|
+
// { "name": "UserId", "type": { "code": "INT64" } },
|
|
207
|
+
// { "name": "UserName", "type": { "code": "STRING" } },
|
|
208
|
+
// ]
|
|
209
|
+
StructType undeclared_parameters = 3;
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// Additional statistics about a [ResultSet][google.spanner.v1.ResultSet] or [PartialResultSet][google.spanner.v1.PartialResultSet].
|
|
213
|
+
message ResultSetStats {
|
|
214
|
+
// [QueryPlan][google.spanner.v1.QueryPlan] for the query associated with this result.
|
|
215
|
+
QueryPlan query_plan = 1;
|
|
216
|
+
|
|
217
|
+
// Aggregated statistics from the execution of the query. Only present when
|
|
218
|
+
// the query is profiled. For example, a query could return the statistics as
|
|
219
|
+
// follows:
|
|
220
|
+
//
|
|
221
|
+
// {
|
|
222
|
+
// "rows_returned": "3",
|
|
223
|
+
// "elapsed_time": "1.22 secs",
|
|
224
|
+
// "cpu_time": "1.19 secs"
|
|
225
|
+
// }
|
|
226
|
+
google.protobuf.Struct query_stats = 2;
|
|
227
|
+
|
|
228
|
+
// The number of rows modified by the DML statement.
|
|
229
|
+
oneof row_count {
|
|
230
|
+
// Standard DML returns an exact count of rows that were modified.
|
|
231
|
+
int64 row_count_exact = 3;
|
|
232
|
+
|
|
233
|
+
// Partitioned DML does not offer exactly-once semantics, so it
|
|
234
|
+
// returns a lower bound of the rows modified.
|
|
235
|
+
int64 row_count_lower_bound = 4;
|
|
236
|
+
}
|
|
237
|
+
}
|