@google-cloud/spanner 8.10.0 → 8.12.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.
Files changed (71) hide show
  1. package/build/protos/status.json +243 -0
  2. package/build/src/backup.d.ts +2 -1
  3. package/build/src/batch-transaction.d.ts +2 -1
  4. package/build/src/codec.d.ts +2 -1
  5. package/build/src/codec.js +21 -20
  6. package/build/src/common-grpc/service.js +9 -10
  7. package/build/src/common.d.ts +3 -2
  8. package/build/src/database.d.ts +7 -2
  9. package/build/src/database.js +58 -37
  10. package/build/src/index.d.ts +3 -2
  11. package/build/src/index.js +7 -16
  12. package/build/src/instance-config.d.ts +3 -3
  13. package/build/src/instance-config.js +1 -1
  14. package/build/src/instance.d.ts +5 -5
  15. package/build/src/instance.js +3 -2
  16. package/build/src/instrument.js +5 -4
  17. package/build/src/multiplexed-session.d.ts +3 -0
  18. package/build/src/multiplexed-session.js +28 -2
  19. package/build/src/partial-result-stream.d.ts +2 -1
  20. package/build/src/partial-result-stream.js +161 -35
  21. package/build/src/protos.d.ts +21 -0
  22. package/build/src/protos.js +52 -0
  23. package/build/src/session-factory.d.ts +4 -2
  24. package/build/src/session-factory.js +14 -3
  25. package/build/src/session.d.ts +2 -1
  26. package/build/src/table.d.ts +3 -2
  27. package/build/src/table.js +4 -3
  28. package/build/src/transaction-runner.d.ts +2 -1
  29. package/build/src/transaction-runner.js +6 -8
  30. package/build/src/transaction.d.ts +45 -4
  31. package/build/src/transaction.js +105 -6
  32. package/build/src/v1/index.d.ts +1 -4
  33. package/build/src/v1/index.js +5 -8
  34. package/package.json +4 -9
  35. package/build/protos/google/spanner/admin/database/v1/backup.proto +0 -773
  36. package/build/protos/google/spanner/admin/database/v1/backup_schedule.proto +0 -230
  37. package/build/protos/google/spanner/admin/database/v1/common.proto +0 -132
  38. package/build/protos/google/spanner/admin/database/v1/spanner_database_admin.proto +0 -1314
  39. package/build/protos/google/spanner/admin/instance/v1/common.proto +0 -64
  40. package/build/protos/google/spanner/admin/instance/v1/spanner_instance_admin.proto +0 -2184
  41. package/build/protos/google/spanner/executor/v1/cloud_executor.proto +0 -1604
  42. package/build/protos/google/spanner/v1/change_stream.proto +0 -451
  43. package/build/protos/google/spanner/v1/commit_response.proto +0 -80
  44. package/build/protos/google/spanner/v1/keys.proto +0 -163
  45. package/build/protos/google/spanner/v1/location.proto +0 -388
  46. package/build/protos/google/spanner/v1/mutation.proto +0 -156
  47. package/build/protos/google/spanner/v1/query_plan.proto +0 -156
  48. package/build/protos/google/spanner/v1/result_set.proto +0 -260
  49. package/build/protos/google/spanner/v1/spanner.proto +0 -1472
  50. package/build/protos/google/spanner/v1/transaction.proto +0 -329
  51. package/build/protos/google/spanner/v1/type.proto +0 -214
  52. package/build/protos/protos.d.ts +0 -44031
  53. package/build/protos/protos.js +0 -122630
  54. package/build/protos/protos.json +0 -11631
  55. package/build/src/v1/database_admin_client.d.ts +0 -2367
  56. package/build/src/v1/database_admin_client.js +0 -2914
  57. package/build/src/v1/database_admin_client_config.json +0 -169
  58. package/build/src/v1/database_admin_proto_list.json +0 -6
  59. package/build/src/v1/gapic_metadata.json +0 -27
  60. package/build/src/v1/instance_admin_client.d.ts +0 -2106
  61. package/build/src/v1/instance_admin_client.js +0 -2387
  62. package/build/src/v1/instance_admin_client_config.json +0 -129
  63. package/build/src/v1/instance_admin_proto_list.json +0 -4
  64. package/build/src/v1/spanner_client.d.ts +0 -1319
  65. package/build/src/v1/spanner_client.js +0 -1446
  66. package/build/src/v1/spanner_client_config.json +0 -123
  67. package/build/src/v1/spanner_executor_proxy_client.d.ts +0 -419
  68. package/build/src/v1/spanner_executor_proxy_client.js +0 -728
  69. package/build/src/v1/spanner_executor_proxy_client_config.json +0 -30
  70. package/build/src/v1/spanner_executor_proxy_proto_list.json +0 -15
  71. package/build/src/v1/spanner_proto_list.json +0 -12
@@ -1,1319 +0,0 @@
1
- import type * as gax from 'google-gax';
2
- import type { Callback, CallOptions, Descriptors, ClientOptions, PaginationCallback } from 'google-gax';
3
- import { Transform } from 'stream';
4
- import * as protos from '../../protos/protos';
5
- /**
6
- * Cloud Spanner API
7
- *
8
- * The Cloud Spanner API can be used to manage sessions and execute
9
- * transactions on data stored in Cloud Spanner databases.
10
- * @class
11
- * @memberof v1
12
- */
13
- export declare class SpannerClient {
14
- private _terminated;
15
- private _opts;
16
- private _providedCustomServicePath;
17
- private _gaxModule;
18
- private _gaxGrpc;
19
- private _protos;
20
- private _defaults;
21
- private _universeDomain;
22
- private _servicePath;
23
- private _log;
24
- auth: gax.GoogleAuth;
25
- descriptors: Descriptors;
26
- warn: (code: string, message: string, warnType?: string) => void;
27
- innerApiCalls: {
28
- [name: string]: Function;
29
- };
30
- pathTemplates: {
31
- [name: string]: gax.PathTemplate;
32
- };
33
- spannerStub?: Promise<{
34
- [name: string]: Function;
35
- }>;
36
- /**
37
- * Construct an instance of SpannerClient.
38
- *
39
- * @param {object} [options] - The configuration object.
40
- * The options accepted by the constructor are described in detail
41
- * in [this document](https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#creating-the-client-instance).
42
- * The common options are:
43
- * @param {object} [options.credentials] - Credentials object.
44
- * @param {string} [options.credentials.client_email]
45
- * @param {string} [options.credentials.private_key]
46
- * @param {string} [options.email] - Account email address. Required when
47
- * using a .pem or .p12 keyFilename.
48
- * @param {string} [options.keyFilename] - Full path to the a .json, .pem, or
49
- * .p12 key downloaded from the Google Developers Console. If you provide
50
- * a path to a JSON file, the projectId option below is not necessary.
51
- * NOTE: .pem and .p12 require you to specify options.email as well.
52
- * @param {number} [options.port] - The port on which to connect to
53
- * the remote host.
54
- * @param {string} [options.projectId] - The project ID from the Google
55
- * Developer's Console, e.g. 'grape-spaceship-123'. We will also check
56
- * the environment variable GCLOUD_PROJECT for your project ID. If your
57
- * app is running in an environment which supports
58
- * {@link https://cloud.google.com/docs/authentication/application-default-credentials Application Default Credentials},
59
- * your project ID will be detected automatically.
60
- * @param {string} [options.apiEndpoint] - The domain name of the
61
- * API remote host.
62
- * @param {gax.ClientConfig} [options.clientConfig] - Client configuration override.
63
- * Follows the structure of {@link gapicConfig}.
64
- * @param {boolean} [options.fallback] - Use HTTP/1.1 REST mode.
65
- * For more information, please check the
66
- * {@link https://github.com/googleapis/gax-nodejs/blob/main/client-libraries.md#http11-rest-api-mode documentation}.
67
- * @param {gax} [gaxInstance]: loaded instance of `google-gax`. Useful if you
68
- * need to avoid loading the default gRPC version and want to use the fallback
69
- * HTTP implementation. Load only fallback version and pass it to the constructor:
70
- * ```
71
- * const gax = require('google-gax/build/src/fallback'); // avoids loading google-gax with gRPC
72
- * const client = new SpannerClient({fallback: true}, gax);
73
- * ```
74
- */
75
- constructor(opts?: ClientOptions, gaxInstance?: typeof gax | typeof gax.fallback);
76
- /**
77
- * Initialize the client.
78
- * Performs asynchronous operations (such as authentication) and prepares the client.
79
- * This function will be called automatically when any class method is called for the
80
- * first time, but if you need to initialize it before calling an actual method,
81
- * feel free to call initialize() directly.
82
- *
83
- * You can await on this method if you want to make sure the client is initialized.
84
- *
85
- * @returns {Promise} A promise that resolves to an authenticated service stub.
86
- */
87
- initialize(): Promise<{
88
- [name: string]: Function;
89
- }>;
90
- /**
91
- * The DNS address for this API service.
92
- * @deprecated Use the apiEndpoint method of the client instance.
93
- * @returns {string} The DNS address for this service.
94
- */
95
- static get servicePath(): string;
96
- /**
97
- * The DNS address for this API service - same as servicePath.
98
- * @deprecated Use the apiEndpoint method of the client instance.
99
- * @returns {string} The DNS address for this service.
100
- */
101
- static get apiEndpoint(): string;
102
- /**
103
- * The DNS address for this API service.
104
- * @returns {string} The DNS address for this service.
105
- */
106
- get apiEndpoint(): string;
107
- get universeDomain(): string;
108
- /**
109
- * The port for this API service.
110
- * @returns {number} The default port for this service.
111
- */
112
- static get port(): number;
113
- /**
114
- * The scopes needed to make gRPC calls for every method defined
115
- * in this service.
116
- * @returns {string[]} List of default scopes.
117
- */
118
- static get scopes(): string[];
119
- getProjectId(): Promise<string>;
120
- getProjectId(callback: Callback<string, undefined, undefined>): void;
121
- /**
122
- * Creates a new session. A session can be used to perform
123
- * transactions that read and/or modify data in a Cloud Spanner database.
124
- * Sessions are meant to be reused for many consecutive
125
- * transactions.
126
- *
127
- * Sessions can only execute one transaction at a time. To execute
128
- * multiple concurrent read-write/write-only transactions, create
129
- * multiple sessions. Note that standalone reads and queries use a
130
- * transaction internally, and count toward the one transaction
131
- * limit.
132
- *
133
- * Active sessions use additional server resources, so it's a good idea to
134
- * delete idle and unneeded sessions.
135
- * Aside from explicit deletes, Cloud Spanner can delete sessions when no
136
- * operations are sent for more than an hour. If a session is deleted,
137
- * requests to it return `NOT_FOUND`.
138
- *
139
- * Idle sessions can be kept alive by sending a trivial SQL query
140
- * periodically, for example, `"SELECT 1"`.
141
- *
142
- * @param {Object} request
143
- * The request object that will be sent.
144
- * @param {string} request.database
145
- * Required. The database in which the new session is created.
146
- * @param {google.spanner.v1.Session} request.session
147
- * Required. The session to create.
148
- * @param {object} [options]
149
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
150
- * @returns {Promise} - The promise which resolves to an array.
151
- * The first element of the array is an object representing {@link protos.google.spanner.v1.Session|Session}.
152
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
153
- * for more details and examples.
154
- */
155
- createSession(request?: protos.google.spanner.v1.ICreateSessionRequest, options?: CallOptions): Promise<[
156
- protos.google.spanner.v1.ISession,
157
- protos.google.spanner.v1.ICreateSessionRequest | undefined,
158
- {} | undefined
159
- ]>;
160
- createSession(request: protos.google.spanner.v1.ICreateSessionRequest, options: CallOptions, callback: Callback<protos.google.spanner.v1.ISession, protos.google.spanner.v1.ICreateSessionRequest | null | undefined, {} | null | undefined>): void;
161
- createSession(request: protos.google.spanner.v1.ICreateSessionRequest, callback: Callback<protos.google.spanner.v1.ISession, protos.google.spanner.v1.ICreateSessionRequest | null | undefined, {} | null | undefined>): void;
162
- /**
163
- * Creates multiple new sessions.
164
- *
165
- * This API can be used to initialize a session cache on the clients.
166
- * See https://goo.gl/TgSFN2 for best practices on session cache management.
167
- *
168
- * @param {Object} request
169
- * The request object that will be sent.
170
- * @param {string} request.database
171
- * Required. The database in which the new sessions are created.
172
- * @param {google.spanner.v1.Session} request.sessionTemplate
173
- * Parameters to apply to each created session.
174
- * @param {number} request.sessionCount
175
- * Required. The number of sessions to be created in this batch call. At least
176
- * one session is created. The API can return fewer than the requested number
177
- * of sessions. If a specific number of sessions are desired, the client can
178
- * make additional calls to `BatchCreateSessions` (adjusting
179
- * {@link protos.google.spanner.v1.BatchCreateSessionsRequest.session_count|session_count}
180
- * as necessary).
181
- * @param {object} [options]
182
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
183
- * @returns {Promise} - The promise which resolves to an array.
184
- * The first element of the array is an object representing {@link protos.google.spanner.v1.BatchCreateSessionsResponse|BatchCreateSessionsResponse}.
185
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
186
- * for more details and examples.
187
- */
188
- batchCreateSessions(request?: protos.google.spanner.v1.IBatchCreateSessionsRequest, options?: CallOptions): Promise<[
189
- protos.google.spanner.v1.IBatchCreateSessionsResponse,
190
- protos.google.spanner.v1.IBatchCreateSessionsRequest | undefined,
191
- {} | undefined
192
- ]>;
193
- batchCreateSessions(request: protos.google.spanner.v1.IBatchCreateSessionsRequest, options: CallOptions, callback: Callback<protos.google.spanner.v1.IBatchCreateSessionsResponse, protos.google.spanner.v1.IBatchCreateSessionsRequest | null | undefined, {} | null | undefined>): void;
194
- batchCreateSessions(request: protos.google.spanner.v1.IBatchCreateSessionsRequest, callback: Callback<protos.google.spanner.v1.IBatchCreateSessionsResponse, protos.google.spanner.v1.IBatchCreateSessionsRequest | null | undefined, {} | null | undefined>): void;
195
- /**
196
- * Gets a session. Returns `NOT_FOUND` if the session doesn't exist.
197
- * This is mainly useful for determining whether a session is still
198
- * alive.
199
- *
200
- * @param {Object} request
201
- * The request object that will be sent.
202
- * @param {string} request.name
203
- * Required. The name of the session to retrieve.
204
- * @param {object} [options]
205
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
206
- * @returns {Promise} - The promise which resolves to an array.
207
- * The first element of the array is an object representing {@link protos.google.spanner.v1.Session|Session}.
208
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
209
- * for more details and examples.
210
- */
211
- getSession(request?: protos.google.spanner.v1.IGetSessionRequest, options?: CallOptions): Promise<[
212
- protos.google.spanner.v1.ISession,
213
- protos.google.spanner.v1.IGetSessionRequest | undefined,
214
- {} | undefined
215
- ]>;
216
- getSession(request: protos.google.spanner.v1.IGetSessionRequest, options: CallOptions, callback: Callback<protos.google.spanner.v1.ISession, protos.google.spanner.v1.IGetSessionRequest | null | undefined, {} | null | undefined>): void;
217
- getSession(request: protos.google.spanner.v1.IGetSessionRequest, callback: Callback<protos.google.spanner.v1.ISession, protos.google.spanner.v1.IGetSessionRequest | null | undefined, {} | null | undefined>): void;
218
- /**
219
- * Ends a session, releasing server resources associated with it. This
220
- * asynchronously triggers the cancellation of any operations that are running
221
- * with this session.
222
- *
223
- * @param {Object} request
224
- * The request object that will be sent.
225
- * @param {string} request.name
226
- * Required. The name of the session to delete.
227
- * @param {object} [options]
228
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
229
- * @returns {Promise} - The promise which resolves to an array.
230
- * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}.
231
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
232
- * for more details and examples.
233
- */
234
- deleteSession(request?: protos.google.spanner.v1.IDeleteSessionRequest, options?: CallOptions): Promise<[
235
- protos.google.protobuf.IEmpty,
236
- protos.google.spanner.v1.IDeleteSessionRequest | undefined,
237
- {} | undefined
238
- ]>;
239
- deleteSession(request: protos.google.spanner.v1.IDeleteSessionRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.v1.IDeleteSessionRequest | null | undefined, {} | null | undefined>): void;
240
- deleteSession(request: protos.google.spanner.v1.IDeleteSessionRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.v1.IDeleteSessionRequest | null | undefined, {} | null | undefined>): void;
241
- /**
242
- * Executes an SQL statement, returning all results in a single reply. This
243
- * method can't be used to return a result set larger than 10 MiB;
244
- * if the query yields more data than that, the query fails with
245
- * a `FAILED_PRECONDITION` error.
246
- *
247
- * Operations inside read-write transactions might return `ABORTED`. If
248
- * this occurs, the application should restart the transaction from
249
- * the beginning. See {@link protos.google.spanner.v1.Transaction|Transaction} for more
250
- * details.
251
- *
252
- * Larger result sets can be fetched in streaming fashion by calling
253
- * {@link protos.google.spanner.v1.Spanner.ExecuteStreamingSql|ExecuteStreamingSql}
254
- * instead.
255
- *
256
- * The query string can be SQL or [Graph Query Language
257
- * (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro).
258
- *
259
- * @param {Object} request
260
- * The request object that will be sent.
261
- * @param {string} request.session
262
- * Required. The session in which the SQL query should be performed.
263
- * @param {google.spanner.v1.TransactionSelector} request.transaction
264
- * The transaction to use.
265
- *
266
- * For queries, if none is provided, the default is a temporary read-only
267
- * transaction with strong concurrency.
268
- *
269
- * Standard DML statements require a read-write transaction. To protect
270
- * against replays, single-use transactions are not supported. The caller
271
- * must either supply an existing transaction ID or begin a new transaction.
272
- *
273
- * Partitioned DML requires an existing Partitioned DML transaction ID.
274
- * @param {string} request.sql
275
- * Required. The SQL string.
276
- * @param {google.protobuf.Struct} request.params
277
- * Parameter names and values that bind to placeholders in the SQL string.
278
- *
279
- * A parameter placeholder consists of the `@` character followed by the
280
- * parameter name (for example, `@firstName`). Parameter names must conform
281
- * to the naming requirements of identifiers as specified at
282
- * https://cloud.google.com/spanner/docs/lexical#identifiers.
283
- *
284
- * Parameters can appear anywhere that a literal value is expected. The same
285
- * parameter name can be used more than once, for example:
286
- *
287
- * `"WHERE id > @msg_id AND id < @msg_id + 100"`
288
- *
289
- * It's an error to execute a SQL statement with unbound parameters.
290
- * @param {number[]} request.paramTypes
291
- * It isn't always possible for Cloud Spanner to infer the right SQL type
292
- * from a JSON value. For example, values of type `BYTES` and values
293
- * of type `STRING` both appear in
294
- * {@link protos.google.spanner.v1.ExecuteSqlRequest.params|params} as JSON strings.
295
- *
296
- * In these cases, you can use `param_types` to specify the exact
297
- * SQL type for some or all of the SQL statement parameters. See the
298
- * definition of {@link protos.google.spanner.v1.Type|Type} for more information
299
- * about SQL types.
300
- * @param {Buffer} request.resumeToken
301
- * If this request is resuming a previously interrupted SQL statement
302
- * execution, `resume_token` should be copied from the last
303
- * {@link protos.google.spanner.v1.PartialResultSet|PartialResultSet} yielded before the
304
- * interruption. Doing this enables the new SQL statement execution to resume
305
- * where the last one left off. The rest of the request parameters must
306
- * exactly match the request that yielded this token.
307
- * @param {google.spanner.v1.ExecuteSqlRequest.QueryMode} request.queryMode
308
- * Used to control the amount of debugging information returned in
309
- * {@link protos.google.spanner.v1.ResultSetStats|ResultSetStats}. If
310
- * {@link protos.google.spanner.v1.ExecuteSqlRequest.partition_token|partition_token} is
311
- * set, {@link protos.google.spanner.v1.ExecuteSqlRequest.query_mode|query_mode} can only
312
- * be set to
313
- * {@link protos.google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL|QueryMode.NORMAL}.
314
- * @param {Buffer} request.partitionToken
315
- * If present, results are restricted to the specified partition
316
- * previously created using `PartitionQuery`. There must be an exact
317
- * match for the values of fields common to this message and the
318
- * `PartitionQueryRequest` message used to create this `partition_token`.
319
- * @param {number} request.seqno
320
- * A per-transaction sequence number used to identify this request. This field
321
- * makes each request idempotent such that if the request is received multiple
322
- * times, at most one succeeds.
323
- *
324
- * The sequence number must be monotonically increasing within the
325
- * transaction. If a request arrives for the first time with an out-of-order
326
- * sequence number, the transaction can be aborted. Replays of previously
327
- * handled requests yield the same response as the first execution.
328
- *
329
- * Required for DML statements. Ignored for queries.
330
- * @param {google.spanner.v1.ExecuteSqlRequest.QueryOptions} request.queryOptions
331
- * Query optimizer configuration to use for the given query.
332
- * @param {google.spanner.v1.RequestOptions} request.requestOptions
333
- * Common options for this request.
334
- * @param {google.spanner.v1.DirectedReadOptions} request.directedReadOptions
335
- * Directed read options for this request.
336
- * @param {boolean} request.dataBoostEnabled
337
- * If this is for a partitioned query and this field is set to `true`, the
338
- * request is executed with Spanner Data Boost independent compute resources.
339
- *
340
- * If the field is set to `true` but the request doesn't set
341
- * `partition_token`, the API returns an `INVALID_ARGUMENT` error.
342
- * @param {boolean} [request.lastStatement]
343
- * Optional. If set to `true`, this statement marks the end of the
344
- * transaction. After this statement executes, you must commit or abort the
345
- * transaction. Attempts to execute any other requests against this
346
- * transaction (including reads and queries) are rejected.
347
- *
348
- * For DML statements, setting this option might cause some error reporting to
349
- * be deferred until commit time (for example, validation of unique
350
- * constraints). Given this, successful execution of a DML statement shouldn't
351
- * be assumed until a subsequent `Commit` call completes successfully.
352
- * @param {google.spanner.v1.RoutingHint} [request.routingHint]
353
- * Optional. Makes the Spanner requests location-aware if present.
354
- *
355
- * It gives the server hints that can be used to route the request
356
- * to an appropriate server, potentially significantly decreasing latency and
357
- * improving throughput. To achieve improved performance, most fields must be
358
- * filled in with accurate values.
359
- * @param {object} [options]
360
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
361
- * @returns {Promise} - The promise which resolves to an array.
362
- * The first element of the array is an object representing {@link protos.google.spanner.v1.ResultSet|ResultSet}.
363
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
364
- * for more details and examples.
365
- */
366
- executeSql(request?: protos.google.spanner.v1.IExecuteSqlRequest, options?: CallOptions): Promise<[
367
- protos.google.spanner.v1.IResultSet,
368
- protos.google.spanner.v1.IExecuteSqlRequest | undefined,
369
- {} | undefined
370
- ]>;
371
- executeSql(request: protos.google.spanner.v1.IExecuteSqlRequest, options: CallOptions, callback: Callback<protos.google.spanner.v1.IResultSet, protos.google.spanner.v1.IExecuteSqlRequest | null | undefined, {} | null | undefined>): void;
372
- executeSql(request: protos.google.spanner.v1.IExecuteSqlRequest, callback: Callback<protos.google.spanner.v1.IResultSet, protos.google.spanner.v1.IExecuteSqlRequest | null | undefined, {} | null | undefined>): void;
373
- /**
374
- * Executes a batch of SQL DML statements. This method allows many statements
375
- * to be run with lower latency than submitting them sequentially with
376
- * {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql}.
377
- *
378
- * Statements are executed in sequential order. A request can succeed even if
379
- * a statement fails. The
380
- * {@link protos.google.spanner.v1.ExecuteBatchDmlResponse.status|ExecuteBatchDmlResponse.status}
381
- * field in the response provides information about the statement that failed.
382
- * Clients must inspect this field to determine whether an error occurred.
383
- *
384
- * Execution stops after the first failed statement; the remaining statements
385
- * are not executed.
386
- *
387
- * @param {Object} request
388
- * The request object that will be sent.
389
- * @param {string} request.session
390
- * Required. The session in which the DML statements should be performed.
391
- * @param {google.spanner.v1.TransactionSelector} request.transaction
392
- * Required. The transaction to use. Must be a read-write transaction.
393
- *
394
- * To protect against replays, single-use transactions are not supported. The
395
- * caller must either supply an existing transaction ID or begin a new
396
- * transaction.
397
- * @param {number[]} request.statements
398
- * Required. The list of statements to execute in this batch. Statements are
399
- * executed serially, such that the effects of statement `i` are visible to
400
- * statement `i+1`. Each statement must be a DML statement. Execution stops at
401
- * the first failed statement; the remaining statements are not executed.
402
- *
403
- * Callers must provide at least one statement.
404
- * @param {number} request.seqno
405
- * Required. A per-transaction sequence number used to identify this request.
406
- * This field makes each request idempotent such that if the request is
407
- * received multiple times, at most one succeeds.
408
- *
409
- * The sequence number must be monotonically increasing within the
410
- * transaction. If a request arrives for the first time with an out-of-order
411
- * sequence number, the transaction might be aborted. Replays of previously
412
- * handled requests yield the same response as the first execution.
413
- * @param {google.spanner.v1.RequestOptions} request.requestOptions
414
- * Common options for this request.
415
- * @param {boolean} [request.lastStatements]
416
- * Optional. If set to `true`, this request marks the end of the transaction.
417
- * After these statements execute, you must commit or abort the transaction.
418
- * Attempts to execute any other requests against this transaction
419
- * (including reads and queries) are rejected.
420
- *
421
- * Setting this option might cause some error reporting to be deferred until
422
- * commit time (for example, validation of unique constraints). Given this,
423
- * successful execution of statements shouldn't be assumed until a subsequent
424
- * `Commit` call completes successfully.
425
- * @param {object} [options]
426
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
427
- * @returns {Promise} - The promise which resolves to an array.
428
- * The first element of the array is an object representing {@link protos.google.spanner.v1.ExecuteBatchDmlResponse|ExecuteBatchDmlResponse}.
429
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
430
- * for more details and examples.
431
- */
432
- executeBatchDml(request?: protos.google.spanner.v1.IExecuteBatchDmlRequest, options?: CallOptions): Promise<[
433
- protos.google.spanner.v1.IExecuteBatchDmlResponse,
434
- protos.google.spanner.v1.IExecuteBatchDmlRequest | undefined,
435
- {} | undefined
436
- ]>;
437
- executeBatchDml(request: protos.google.spanner.v1.IExecuteBatchDmlRequest, options: CallOptions, callback: Callback<protos.google.spanner.v1.IExecuteBatchDmlResponse, protos.google.spanner.v1.IExecuteBatchDmlRequest | null | undefined, {} | null | undefined>): void;
438
- executeBatchDml(request: protos.google.spanner.v1.IExecuteBatchDmlRequest, callback: Callback<protos.google.spanner.v1.IExecuteBatchDmlResponse, protos.google.spanner.v1.IExecuteBatchDmlRequest | null | undefined, {} | null | undefined>): void;
439
- /**
440
- * Reads rows from the database using key lookups and scans, as a
441
- * simple key/value style alternative to
442
- * {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql}. This method can't be
443
- * used to return a result set larger than 10 MiB; if the read matches more
444
- * data than that, the read fails with a `FAILED_PRECONDITION`
445
- * error.
446
- *
447
- * Reads inside read-write transactions might return `ABORTED`. If
448
- * this occurs, the application should restart the transaction from
449
- * the beginning. See {@link protos.google.spanner.v1.Transaction|Transaction} for more
450
- * details.
451
- *
452
- * Larger result sets can be yielded in streaming fashion by calling
453
- * {@link protos.google.spanner.v1.Spanner.StreamingRead|StreamingRead} instead.
454
- *
455
- * @param {Object} request
456
- * The request object that will be sent.
457
- * @param {string} request.session
458
- * Required. The session in which the read should be performed.
459
- * @param {google.spanner.v1.TransactionSelector} request.transaction
460
- * The transaction to use. If none is provided, the default is a
461
- * temporary read-only transaction with strong concurrency.
462
- * @param {string} request.table
463
- * Required. The name of the table in the database to be read.
464
- * @param {string} request.index
465
- * If non-empty, the name of an index on
466
- * {@link protos.google.spanner.v1.ReadRequest.table|table}. This index is used instead of
467
- * the table primary key when interpreting
468
- * {@link protos.google.spanner.v1.ReadRequest.key_set|key_set} and sorting result rows.
469
- * See {@link protos.google.spanner.v1.ReadRequest.key_set|key_set} for further
470
- * information.
471
- * @param {string[]} request.columns
472
- * Required. The columns of {@link protos.google.spanner.v1.ReadRequest.table|table} to be
473
- * returned for each row matching this request.
474
- * @param {google.spanner.v1.KeySet} request.keySet
475
- * Required. `key_set` identifies the rows to be yielded. `key_set` names the
476
- * primary keys of the rows in {@link protos.google.spanner.v1.ReadRequest.table|table} to
477
- * be yielded, unless {@link protos.google.spanner.v1.ReadRequest.index|index} is present.
478
- * If {@link protos.google.spanner.v1.ReadRequest.index|index} is present, then
479
- * {@link protos.google.spanner.v1.ReadRequest.key_set|key_set} instead names index keys
480
- * in {@link protos.google.spanner.v1.ReadRequest.index|index}.
481
- *
482
- * If the {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token}
483
- * field is empty, rows are yielded in table primary key order (if
484
- * {@link protos.google.spanner.v1.ReadRequest.index|index} is empty) or index key order
485
- * (if {@link protos.google.spanner.v1.ReadRequest.index|index} is non-empty). If the
486
- * {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token} field
487
- * isn't empty, rows are yielded in an unspecified order.
488
- *
489
- * It isn't an error for the `key_set` to name rows that don't
490
- * exist in the database. Read yields nothing for nonexistent rows.
491
- * @param {number} request.limit
492
- * If greater than zero, only the first `limit` rows are yielded. If `limit`
493
- * is zero, the default is no limit. A limit can't be specified if
494
- * `partition_token` is set.
495
- * @param {Buffer} request.resumeToken
496
- * If this request is resuming a previously interrupted read,
497
- * `resume_token` should be copied from the last
498
- * {@link protos.google.spanner.v1.PartialResultSet|PartialResultSet} yielded before the
499
- * interruption. Doing this enables the new read to resume where the last read
500
- * left off. The rest of the request parameters must exactly match the request
501
- * that yielded this token.
502
- * @param {Buffer} request.partitionToken
503
- * If present, results are restricted to the specified partition
504
- * previously created using `PartitionRead`. There must be an exact
505
- * match for the values of fields common to this message and the
506
- * PartitionReadRequest message used to create this partition_token.
507
- * @param {google.spanner.v1.RequestOptions} request.requestOptions
508
- * Common options for this request.
509
- * @param {google.spanner.v1.DirectedReadOptions} request.directedReadOptions
510
- * Directed read options for this request.
511
- * @param {boolean} request.dataBoostEnabled
512
- * If this is for a partitioned read and this field is set to `true`, the
513
- * request is executed with Spanner Data Boost independent compute resources.
514
- *
515
- * If the field is set to `true` but the request doesn't set
516
- * `partition_token`, the API returns an `INVALID_ARGUMENT` error.
517
- * @param {google.spanner.v1.ReadRequest.OrderBy} [request.orderBy]
518
- * Optional. Order for the returned rows.
519
- *
520
- * By default, Spanner returns result rows in primary key order except for
521
- * PartitionRead requests. For applications that don't require rows to be
522
- * returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting
523
- * `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval,
524
- * resulting in lower latencies in certain cases (for example, bulk point
525
- * lookups).
526
- * @param {google.spanner.v1.ReadRequest.LockHint} [request.lockHint]
527
- * Optional. Lock Hint for the request, it can only be used with read-write
528
- * transactions.
529
- * @param {google.spanner.v1.RoutingHint} [request.routingHint]
530
- * Optional. Makes the Spanner requests location-aware if present.
531
- *
532
- * It gives the server hints that can be used to route the request
533
- * to an appropriate server, potentially significantly decreasing latency and
534
- * improving throughput. To achieve improved performance, most fields must be
535
- * filled in with accurate values.
536
- * @param {object} [options]
537
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
538
- * @returns {Promise} - The promise which resolves to an array.
539
- * The first element of the array is an object representing {@link protos.google.spanner.v1.ResultSet|ResultSet}.
540
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
541
- * for more details and examples.
542
- */
543
- read(request?: protos.google.spanner.v1.IReadRequest, options?: CallOptions): Promise<[
544
- protos.google.spanner.v1.IResultSet,
545
- protos.google.spanner.v1.IReadRequest | undefined,
546
- {} | undefined
547
- ]>;
548
- read(request: protos.google.spanner.v1.IReadRequest, options: CallOptions, callback: Callback<protos.google.spanner.v1.IResultSet, protos.google.spanner.v1.IReadRequest | null | undefined, {} | null | undefined>): void;
549
- read(request: protos.google.spanner.v1.IReadRequest, callback: Callback<protos.google.spanner.v1.IResultSet, protos.google.spanner.v1.IReadRequest | null | undefined, {} | null | undefined>): void;
550
- /**
551
- * Begins a new transaction. This step can often be skipped:
552
- * {@link protos.google.spanner.v1.Spanner.Read|Read},
553
- * {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql} and
554
- * {@link protos.google.spanner.v1.Spanner.Commit|Commit} can begin a new transaction as a
555
- * side-effect.
556
- *
557
- * @param {Object} request
558
- * The request object that will be sent.
559
- * @param {string} request.session
560
- * Required. The session in which the transaction runs.
561
- * @param {google.spanner.v1.TransactionOptions} request.options
562
- * Required. Options for the new transaction.
563
- * @param {google.spanner.v1.RequestOptions} request.requestOptions
564
- * Common options for this request.
565
- * Priority is ignored for this request. Setting the priority in this
566
- * `request_options` struct doesn't do anything. To set the priority for a
567
- * transaction, set it on the reads and writes that are part of this
568
- * transaction instead.
569
- * @param {google.spanner.v1.Mutation} [request.mutationKey]
570
- * Optional. Required for read-write transactions on a multiplexed session
571
- * that commit mutations but don't perform any reads or queries. You must
572
- * randomly select one of the mutations from the mutation set and send it as a
573
- * part of this request.
574
- * @param {google.spanner.v1.RoutingHint} [request.routingHint]
575
- * Optional. Makes the Spanner requests location-aware if present.
576
- *
577
- * It gives the server hints that can be used to route the request
578
- * to an appropriate server, potentially significantly decreasing latency and
579
- * improving throughput. To achieve improved performance, most fields must be
580
- * filled in with accurate values.
581
- * @param {object} [options]
582
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
583
- * @returns {Promise} - The promise which resolves to an array.
584
- * The first element of the array is an object representing {@link protos.google.spanner.v1.Transaction|Transaction}.
585
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
586
- * for more details and examples.
587
- */
588
- beginTransaction(request?: protos.google.spanner.v1.IBeginTransactionRequest, options?: CallOptions): Promise<[
589
- protos.google.spanner.v1.ITransaction,
590
- protos.google.spanner.v1.IBeginTransactionRequest | undefined,
591
- {} | undefined
592
- ]>;
593
- beginTransaction(request: protos.google.spanner.v1.IBeginTransactionRequest, options: CallOptions, callback: Callback<protos.google.spanner.v1.ITransaction, protos.google.spanner.v1.IBeginTransactionRequest | null | undefined, {} | null | undefined>): void;
594
- beginTransaction(request: protos.google.spanner.v1.IBeginTransactionRequest, callback: Callback<protos.google.spanner.v1.ITransaction, protos.google.spanner.v1.IBeginTransactionRequest | null | undefined, {} | null | undefined>): void;
595
- /**
596
- * Commits a transaction. The request includes the mutations to be
597
- * applied to rows in the database.
598
- *
599
- * `Commit` might return an `ABORTED` error. This can occur at any time;
600
- * commonly, the cause is conflicts with concurrent
601
- * transactions. However, it can also happen for a variety of other
602
- * reasons. If `Commit` returns `ABORTED`, the caller should retry
603
- * the transaction from the beginning, reusing the same session.
604
- *
605
- * On very rare occasions, `Commit` might return `UNKNOWN`. This can happen,
606
- * for example, if the client job experiences a 1+ hour networking failure.
607
- * At that point, Cloud Spanner has lost track of the transaction outcome and
608
- * we recommend that you perform another read from the database to see the
609
- * state of things as they are now.
610
- *
611
- * @param {Object} request
612
- * The request object that will be sent.
613
- * @param {string} request.session
614
- * Required. The session in which the transaction to be committed is running.
615
- * @param {Buffer} request.transactionId
616
- * Commit a previously-started transaction.
617
- * @param {google.spanner.v1.TransactionOptions} request.singleUseTransaction
618
- * Execute mutations in a temporary transaction. Note that unlike
619
- * commit of a previously-started transaction, commit with a
620
- * temporary transaction is non-idempotent. That is, if the
621
- * `CommitRequest` is sent to Cloud Spanner more than once (for
622
- * instance, due to retries in the application, or in the
623
- * transport library), it's possible that the mutations are
624
- * executed more than once. If this is undesirable, use
625
- * {@link protos.google.spanner.v1.Spanner.BeginTransaction|BeginTransaction} and
626
- * {@link protos.google.spanner.v1.Spanner.Commit|Commit} instead.
627
- * @param {number[]} request.mutations
628
- * The mutations to be executed when this transaction commits. All
629
- * mutations are applied atomically, in the order they appear in
630
- * this list.
631
- * @param {boolean} request.returnCommitStats
632
- * If `true`, then statistics related to the transaction is included in
633
- * the {@link protos.google.spanner.v1.CommitResponse.commit_stats|CommitResponse}.
634
- * Default value is `false`.
635
- * @param {google.protobuf.Duration} [request.maxCommitDelay]
636
- * Optional. The amount of latency this request is configured to incur in
637
- * order to improve throughput. If this field isn't set, Spanner assumes
638
- * requests are relatively latency sensitive and automatically determines an
639
- * appropriate delay time. You can specify a commit delay value between 0 and
640
- * 500 ms.
641
- * @param {google.spanner.v1.RequestOptions} request.requestOptions
642
- * Common options for this request.
643
- * @param {google.spanner.v1.MultiplexedSessionPrecommitToken} [request.precommitToken]
644
- * Optional. If the read-write transaction was executed on a multiplexed
645
- * session, then you must include the precommit token with the highest
646
- * sequence number received in this transaction attempt. Failing to do so
647
- * results in a `FailedPrecondition` error.
648
- * @param {google.spanner.v1.RoutingHint} [request.routingHint]
649
- * Optional. Makes the Spanner requests location-aware if present.
650
- *
651
- * It gives the server hints that can be used to route the request
652
- * to an appropriate server, potentially significantly decreasing latency and
653
- * improving throughput. To achieve improved performance, most fields must be
654
- * filled in with accurate values.
655
- * @param {object} [options]
656
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
657
- * @returns {Promise} - The promise which resolves to an array.
658
- * The first element of the array is an object representing {@link protos.google.spanner.v1.CommitResponse|CommitResponse}.
659
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
660
- * for more details and examples.
661
- */
662
- commit(request?: protos.google.spanner.v1.ICommitRequest, options?: CallOptions): Promise<[
663
- protos.google.spanner.v1.ICommitResponse,
664
- protos.google.spanner.v1.ICommitRequest | undefined,
665
- {} | undefined
666
- ]>;
667
- commit(request: protos.google.spanner.v1.ICommitRequest, options: CallOptions, callback: Callback<protos.google.spanner.v1.ICommitResponse, protos.google.spanner.v1.ICommitRequest | null | undefined, {} | null | undefined>): void;
668
- commit(request: protos.google.spanner.v1.ICommitRequest, callback: Callback<protos.google.spanner.v1.ICommitResponse, protos.google.spanner.v1.ICommitRequest | null | undefined, {} | null | undefined>): void;
669
- /**
670
- * Rolls back a transaction, releasing any locks it holds. It's a good
671
- * idea to call this for any transaction that includes one or more
672
- * {@link protos.google.spanner.v1.Spanner.Read|Read} or
673
- * {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql} requests and ultimately
674
- * decides not to commit.
675
- *
676
- * `Rollback` returns `OK` if it successfully aborts the transaction, the
677
- * transaction was already aborted, or the transaction isn't
678
- * found. `Rollback` never returns `ABORTED`.
679
- *
680
- * @param {Object} request
681
- * The request object that will be sent.
682
- * @param {string} request.session
683
- * Required. The session in which the transaction to roll back is running.
684
- * @param {Buffer} request.transactionId
685
- * Required. The transaction to roll back.
686
- * @param {object} [options]
687
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
688
- * @returns {Promise} - The promise which resolves to an array.
689
- * The first element of the array is an object representing {@link protos.google.protobuf.Empty|Empty}.
690
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
691
- * for more details and examples.
692
- */
693
- rollback(request?: protos.google.spanner.v1.IRollbackRequest, options?: CallOptions): Promise<[
694
- protos.google.protobuf.IEmpty,
695
- protos.google.spanner.v1.IRollbackRequest | undefined,
696
- {} | undefined
697
- ]>;
698
- rollback(request: protos.google.spanner.v1.IRollbackRequest, options: CallOptions, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.v1.IRollbackRequest | null | undefined, {} | null | undefined>): void;
699
- rollback(request: protos.google.spanner.v1.IRollbackRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.v1.IRollbackRequest | null | undefined, {} | null | undefined>): void;
700
- /**
701
- * Creates a set of partition tokens that can be used to execute a query
702
- * operation in parallel. Each of the returned partition tokens can be used
703
- * by {@link protos.google.spanner.v1.Spanner.ExecuteStreamingSql|ExecuteStreamingSql} to
704
- * specify a subset of the query result to read. The same session and
705
- * read-only transaction must be used by the `PartitionQueryRequest` used to
706
- * create the partition tokens and the `ExecuteSqlRequests` that use the
707
- * partition tokens.
708
- *
709
- * Partition tokens become invalid when the session used to create them
710
- * is deleted, is idle for too long, begins a new transaction, or becomes too
711
- * old. When any of these happen, it isn't possible to resume the query, and
712
- * the whole operation must be restarted from the beginning.
713
- *
714
- * @param {Object} request
715
- * The request object that will be sent.
716
- * @param {string} request.session
717
- * Required. The session used to create the partitions.
718
- * @param {google.spanner.v1.TransactionSelector} request.transaction
719
- * Read-only snapshot transactions are supported, read and write and
720
- * single-use transactions are not.
721
- * @param {string} request.sql
722
- * Required. The query request to generate partitions for. The request fails
723
- * if the query isn't root partitionable. For a query to be root
724
- * partitionable, it needs to satisfy a few conditions. For example, if the
725
- * query execution plan contains a distributed union operator, then it must be
726
- * the first operator in the plan. For more information about other
727
- * conditions, see [Read data in
728
- * parallel](https://cloud.google.com/spanner/docs/reads#read_data_in_parallel).
729
- *
730
- * The query request must not contain DML commands, such as `INSERT`,
731
- * `UPDATE`, or `DELETE`. Use
732
- * {@link protos.google.spanner.v1.Spanner.ExecuteStreamingSql|`ExecuteStreamingSql`} with
733
- * a `PartitionedDml` transaction for large, partition-friendly DML
734
- * operations.
735
- * @param {google.protobuf.Struct} [request.params]
736
- * Optional. Parameter names and values that bind to placeholders in the SQL
737
- * string.
738
- *
739
- * A parameter placeholder consists of the `@` character followed by the
740
- * parameter name (for example, `@firstName`). Parameter names can contain
741
- * letters, numbers, and underscores.
742
- *
743
- * Parameters can appear anywhere that a literal value is expected. The same
744
- * parameter name can be used more than once, for example:
745
- *
746
- * `"WHERE id > @msg_id AND id < @msg_id + 100"`
747
- *
748
- * It's an error to execute a SQL statement with unbound parameters.
749
- * @param {number[]} [request.paramTypes]
750
- * Optional. It isn't always possible for Cloud Spanner to infer the right SQL
751
- * type from a JSON value. For example, values of type `BYTES` and values of
752
- * type `STRING` both appear in
753
- * {@link protos.google.spanner.v1.PartitionQueryRequest.params|params} as JSON strings.
754
- *
755
- * In these cases, `param_types` can be used to specify the exact
756
- * SQL type for some or all of the SQL query parameters. See the
757
- * definition of {@link protos.google.spanner.v1.Type|Type} for more information
758
- * about SQL types.
759
- * @param {google.spanner.v1.PartitionOptions} request.partitionOptions
760
- * Additional options that affect how many partitions are created.
761
- * @param {object} [options]
762
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
763
- * @returns {Promise} - The promise which resolves to an array.
764
- * The first element of the array is an object representing {@link protos.google.spanner.v1.PartitionResponse|PartitionResponse}.
765
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
766
- * for more details and examples.
767
- */
768
- partitionQuery(request?: protos.google.spanner.v1.IPartitionQueryRequest, options?: CallOptions): Promise<[
769
- protos.google.spanner.v1.IPartitionResponse,
770
- protos.google.spanner.v1.IPartitionQueryRequest | undefined,
771
- {} | undefined
772
- ]>;
773
- partitionQuery(request: protos.google.spanner.v1.IPartitionQueryRequest, options: CallOptions, callback: Callback<protos.google.spanner.v1.IPartitionResponse, protos.google.spanner.v1.IPartitionQueryRequest | null | undefined, {} | null | undefined>): void;
774
- partitionQuery(request: protos.google.spanner.v1.IPartitionQueryRequest, callback: Callback<protos.google.spanner.v1.IPartitionResponse, protos.google.spanner.v1.IPartitionQueryRequest | null | undefined, {} | null | undefined>): void;
775
- /**
776
- * Creates a set of partition tokens that can be used to execute a read
777
- * operation in parallel. Each of the returned partition tokens can be used
778
- * by {@link protos.google.spanner.v1.Spanner.StreamingRead|StreamingRead} to specify a
779
- * subset of the read result to read. The same session and read-only
780
- * transaction must be used by the `PartitionReadRequest` used to create the
781
- * partition tokens and the `ReadRequests` that use the partition tokens.
782
- * There are no ordering guarantees on rows returned among the returned
783
- * partition tokens, or even within each individual `StreamingRead` call
784
- * issued with a `partition_token`.
785
- *
786
- * Partition tokens become invalid when the session used to create them
787
- * is deleted, is idle for too long, begins a new transaction, or becomes too
788
- * old. When any of these happen, it isn't possible to resume the read, and
789
- * the whole operation must be restarted from the beginning.
790
- *
791
- * @param {Object} request
792
- * The request object that will be sent.
793
- * @param {string} request.session
794
- * Required. The session used to create the partitions.
795
- * @param {google.spanner.v1.TransactionSelector} request.transaction
796
- * Read only snapshot transactions are supported, read/write and single use
797
- * transactions are not.
798
- * @param {string} request.table
799
- * Required. The name of the table in the database to be read.
800
- * @param {string} request.index
801
- * If non-empty, the name of an index on
802
- * {@link protos.google.spanner.v1.PartitionReadRequest.table|table}. This index is used
803
- * instead of the table primary key when interpreting
804
- * {@link protos.google.spanner.v1.PartitionReadRequest.key_set|key_set} and sorting
805
- * result rows. See {@link protos.google.spanner.v1.PartitionReadRequest.key_set|key_set}
806
- * for further information.
807
- * @param {string[]} request.columns
808
- * The columns of {@link protos.google.spanner.v1.PartitionReadRequest.table|table} to be
809
- * returned for each row matching this request.
810
- * @param {google.spanner.v1.KeySet} request.keySet
811
- * Required. `key_set` identifies the rows to be yielded. `key_set` names the
812
- * primary keys of the rows in
813
- * {@link protos.google.spanner.v1.PartitionReadRequest.table|table} to be yielded, unless
814
- * {@link protos.google.spanner.v1.PartitionReadRequest.index|index} is present. If
815
- * {@link protos.google.spanner.v1.PartitionReadRequest.index|index} is present, then
816
- * {@link protos.google.spanner.v1.PartitionReadRequest.key_set|key_set} instead names
817
- * index keys in {@link protos.google.spanner.v1.PartitionReadRequest.index|index}.
818
- *
819
- * It isn't an error for the `key_set` to name rows that don't
820
- * exist in the database. Read yields nothing for nonexistent rows.
821
- * @param {google.spanner.v1.PartitionOptions} request.partitionOptions
822
- * Additional options that affect how many partitions are created.
823
- * @param {object} [options]
824
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
825
- * @returns {Promise} - The promise which resolves to an array.
826
- * The first element of the array is an object representing {@link protos.google.spanner.v1.PartitionResponse|PartitionResponse}.
827
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#regular-methods | documentation }
828
- * for more details and examples.
829
- */
830
- partitionRead(request?: protos.google.spanner.v1.IPartitionReadRequest, options?: CallOptions): Promise<[
831
- protos.google.spanner.v1.IPartitionResponse,
832
- protos.google.spanner.v1.IPartitionReadRequest | undefined,
833
- {} | undefined
834
- ]>;
835
- partitionRead(request: protos.google.spanner.v1.IPartitionReadRequest, options: CallOptions, callback: Callback<protos.google.spanner.v1.IPartitionResponse, protos.google.spanner.v1.IPartitionReadRequest | null | undefined, {} | null | undefined>): void;
836
- partitionRead(request: protos.google.spanner.v1.IPartitionReadRequest, callback: Callback<protos.google.spanner.v1.IPartitionResponse, protos.google.spanner.v1.IPartitionReadRequest | null | undefined, {} | null | undefined>): void;
837
- /**
838
- * Like {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql}, except returns the
839
- * result set as a stream. Unlike
840
- * {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql}, there is no limit on
841
- * the size of the returned result set. However, no individual row in the
842
- * result set can exceed 100 MiB, and no column value can exceed 10 MiB.
843
- *
844
- * The query string can be SQL or [Graph Query Language
845
- * (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro).
846
- *
847
- * @param {Object} request
848
- * The request object that will be sent.
849
- * @param {string} request.session
850
- * Required. The session in which the SQL query should be performed.
851
- * @param {google.spanner.v1.TransactionSelector} request.transaction
852
- * The transaction to use.
853
- *
854
- * For queries, if none is provided, the default is a temporary read-only
855
- * transaction with strong concurrency.
856
- *
857
- * Standard DML statements require a read-write transaction. To protect
858
- * against replays, single-use transactions are not supported. The caller
859
- * must either supply an existing transaction ID or begin a new transaction.
860
- *
861
- * Partitioned DML requires an existing Partitioned DML transaction ID.
862
- * @param {string} request.sql
863
- * Required. The SQL string.
864
- * @param {google.protobuf.Struct} request.params
865
- * Parameter names and values that bind to placeholders in the SQL string.
866
- *
867
- * A parameter placeholder consists of the `@` character followed by the
868
- * parameter name (for example, `@firstName`). Parameter names must conform
869
- * to the naming requirements of identifiers as specified at
870
- * https://cloud.google.com/spanner/docs/lexical#identifiers.
871
- *
872
- * Parameters can appear anywhere that a literal value is expected. The same
873
- * parameter name can be used more than once, for example:
874
- *
875
- * `"WHERE id > @msg_id AND id < @msg_id + 100"`
876
- *
877
- * It's an error to execute a SQL statement with unbound parameters.
878
- * @param {number[]} request.paramTypes
879
- * It isn't always possible for Cloud Spanner to infer the right SQL type
880
- * from a JSON value. For example, values of type `BYTES` and values
881
- * of type `STRING` both appear in
882
- * {@link protos.google.spanner.v1.ExecuteSqlRequest.params|params} as JSON strings.
883
- *
884
- * In these cases, you can use `param_types` to specify the exact
885
- * SQL type for some or all of the SQL statement parameters. See the
886
- * definition of {@link protos.google.spanner.v1.Type|Type} for more information
887
- * about SQL types.
888
- * @param {Buffer} request.resumeToken
889
- * If this request is resuming a previously interrupted SQL statement
890
- * execution, `resume_token` should be copied from the last
891
- * {@link protos.google.spanner.v1.PartialResultSet|PartialResultSet} yielded before the
892
- * interruption. Doing this enables the new SQL statement execution to resume
893
- * where the last one left off. The rest of the request parameters must
894
- * exactly match the request that yielded this token.
895
- * @param {google.spanner.v1.ExecuteSqlRequest.QueryMode} request.queryMode
896
- * Used to control the amount of debugging information returned in
897
- * {@link protos.google.spanner.v1.ResultSetStats|ResultSetStats}. If
898
- * {@link protos.google.spanner.v1.ExecuteSqlRequest.partition_token|partition_token} is
899
- * set, {@link protos.google.spanner.v1.ExecuteSqlRequest.query_mode|query_mode} can only
900
- * be set to
901
- * {@link protos.google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL|QueryMode.NORMAL}.
902
- * @param {Buffer} request.partitionToken
903
- * If present, results are restricted to the specified partition
904
- * previously created using `PartitionQuery`. There must be an exact
905
- * match for the values of fields common to this message and the
906
- * `PartitionQueryRequest` message used to create this `partition_token`.
907
- * @param {number} request.seqno
908
- * A per-transaction sequence number used to identify this request. This field
909
- * makes each request idempotent such that if the request is received multiple
910
- * times, at most one succeeds.
911
- *
912
- * The sequence number must be monotonically increasing within the
913
- * transaction. If a request arrives for the first time with an out-of-order
914
- * sequence number, the transaction can be aborted. Replays of previously
915
- * handled requests yield the same response as the first execution.
916
- *
917
- * Required for DML statements. Ignored for queries.
918
- * @param {google.spanner.v1.ExecuteSqlRequest.QueryOptions} request.queryOptions
919
- * Query optimizer configuration to use for the given query.
920
- * @param {google.spanner.v1.RequestOptions} request.requestOptions
921
- * Common options for this request.
922
- * @param {google.spanner.v1.DirectedReadOptions} request.directedReadOptions
923
- * Directed read options for this request.
924
- * @param {boolean} request.dataBoostEnabled
925
- * If this is for a partitioned query and this field is set to `true`, the
926
- * request is executed with Spanner Data Boost independent compute resources.
927
- *
928
- * If the field is set to `true` but the request doesn't set
929
- * `partition_token`, the API returns an `INVALID_ARGUMENT` error.
930
- * @param {boolean} [request.lastStatement]
931
- * Optional. If set to `true`, this statement marks the end of the
932
- * transaction. After this statement executes, you must commit or abort the
933
- * transaction. Attempts to execute any other requests against this
934
- * transaction (including reads and queries) are rejected.
935
- *
936
- * For DML statements, setting this option might cause some error reporting to
937
- * be deferred until commit time (for example, validation of unique
938
- * constraints). Given this, successful execution of a DML statement shouldn't
939
- * be assumed until a subsequent `Commit` call completes successfully.
940
- * @param {google.spanner.v1.RoutingHint} [request.routingHint]
941
- * Optional. Makes the Spanner requests location-aware if present.
942
- *
943
- * It gives the server hints that can be used to route the request
944
- * to an appropriate server, potentially significantly decreasing latency and
945
- * improving throughput. To achieve improved performance, most fields must be
946
- * filled in with accurate values.
947
- * @param {object} [options]
948
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
949
- * @returns {Stream}
950
- * An object stream which emits {@link protos.google.spanner.v1.PartialResultSet|PartialResultSet} on 'data' event.
951
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation }
952
- * for more details and examples.
953
- */
954
- executeStreamingSql(request?: protos.google.spanner.v1.IExecuteSqlRequest, options?: CallOptions): gax.CancellableStream;
955
- /**
956
- * Like {@link protos.google.spanner.v1.Spanner.Read|Read}, except returns the result set
957
- * as a stream. Unlike {@link protos.google.spanner.v1.Spanner.Read|Read}, there is no
958
- * limit on the size of the returned result set. However, no individual row in
959
- * the result set can exceed 100 MiB, and no column value can exceed
960
- * 10 MiB.
961
- *
962
- * @param {Object} request
963
- * The request object that will be sent.
964
- * @param {string} request.session
965
- * Required. The session in which the read should be performed.
966
- * @param {google.spanner.v1.TransactionSelector} request.transaction
967
- * The transaction to use. If none is provided, the default is a
968
- * temporary read-only transaction with strong concurrency.
969
- * @param {string} request.table
970
- * Required. The name of the table in the database to be read.
971
- * @param {string} request.index
972
- * If non-empty, the name of an index on
973
- * {@link protos.google.spanner.v1.ReadRequest.table|table}. This index is used instead of
974
- * the table primary key when interpreting
975
- * {@link protos.google.spanner.v1.ReadRequest.key_set|key_set} and sorting result rows.
976
- * See {@link protos.google.spanner.v1.ReadRequest.key_set|key_set} for further
977
- * information.
978
- * @param {string[]} request.columns
979
- * Required. The columns of {@link protos.google.spanner.v1.ReadRequest.table|table} to be
980
- * returned for each row matching this request.
981
- * @param {google.spanner.v1.KeySet} request.keySet
982
- * Required. `key_set` identifies the rows to be yielded. `key_set` names the
983
- * primary keys of the rows in {@link protos.google.spanner.v1.ReadRequest.table|table} to
984
- * be yielded, unless {@link protos.google.spanner.v1.ReadRequest.index|index} is present.
985
- * If {@link protos.google.spanner.v1.ReadRequest.index|index} is present, then
986
- * {@link protos.google.spanner.v1.ReadRequest.key_set|key_set} instead names index keys
987
- * in {@link protos.google.spanner.v1.ReadRequest.index|index}.
988
- *
989
- * If the {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token}
990
- * field is empty, rows are yielded in table primary key order (if
991
- * {@link protos.google.spanner.v1.ReadRequest.index|index} is empty) or index key order
992
- * (if {@link protos.google.spanner.v1.ReadRequest.index|index} is non-empty). If the
993
- * {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token} field
994
- * isn't empty, rows are yielded in an unspecified order.
995
- *
996
- * It isn't an error for the `key_set` to name rows that don't
997
- * exist in the database. Read yields nothing for nonexistent rows.
998
- * @param {number} request.limit
999
- * If greater than zero, only the first `limit` rows are yielded. If `limit`
1000
- * is zero, the default is no limit. A limit can't be specified if
1001
- * `partition_token` is set.
1002
- * @param {Buffer} request.resumeToken
1003
- * If this request is resuming a previously interrupted read,
1004
- * `resume_token` should be copied from the last
1005
- * {@link protos.google.spanner.v1.PartialResultSet|PartialResultSet} yielded before the
1006
- * interruption. Doing this enables the new read to resume where the last read
1007
- * left off. The rest of the request parameters must exactly match the request
1008
- * that yielded this token.
1009
- * @param {Buffer} request.partitionToken
1010
- * If present, results are restricted to the specified partition
1011
- * previously created using `PartitionRead`. There must be an exact
1012
- * match for the values of fields common to this message and the
1013
- * PartitionReadRequest message used to create this partition_token.
1014
- * @param {google.spanner.v1.RequestOptions} request.requestOptions
1015
- * Common options for this request.
1016
- * @param {google.spanner.v1.DirectedReadOptions} request.directedReadOptions
1017
- * Directed read options for this request.
1018
- * @param {boolean} request.dataBoostEnabled
1019
- * If this is for a partitioned read and this field is set to `true`, the
1020
- * request is executed with Spanner Data Boost independent compute resources.
1021
- *
1022
- * If the field is set to `true` but the request doesn't set
1023
- * `partition_token`, the API returns an `INVALID_ARGUMENT` error.
1024
- * @param {google.spanner.v1.ReadRequest.OrderBy} [request.orderBy]
1025
- * Optional. Order for the returned rows.
1026
- *
1027
- * By default, Spanner returns result rows in primary key order except for
1028
- * PartitionRead requests. For applications that don't require rows to be
1029
- * returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting
1030
- * `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval,
1031
- * resulting in lower latencies in certain cases (for example, bulk point
1032
- * lookups).
1033
- * @param {google.spanner.v1.ReadRequest.LockHint} [request.lockHint]
1034
- * Optional. Lock Hint for the request, it can only be used with read-write
1035
- * transactions.
1036
- * @param {google.spanner.v1.RoutingHint} [request.routingHint]
1037
- * Optional. Makes the Spanner requests location-aware if present.
1038
- *
1039
- * It gives the server hints that can be used to route the request
1040
- * to an appropriate server, potentially significantly decreasing latency and
1041
- * improving throughput. To achieve improved performance, most fields must be
1042
- * filled in with accurate values.
1043
- * @param {object} [options]
1044
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1045
- * @returns {Stream}
1046
- * An object stream which emits {@link protos.google.spanner.v1.PartialResultSet|PartialResultSet} on 'data' event.
1047
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation }
1048
- * for more details and examples.
1049
- */
1050
- streamingRead(request?: protos.google.spanner.v1.IReadRequest, options?: CallOptions): gax.CancellableStream;
1051
- /**
1052
- * Batches the supplied mutation groups in a collection of efficient
1053
- * transactions. All mutations in a group are committed atomically. However,
1054
- * mutations across groups can be committed non-atomically in an unspecified
1055
- * order and thus, they must be independent of each other. Partial failure is
1056
- * possible, that is, some groups might have been committed successfully,
1057
- * while some might have failed. The results of individual batches are
1058
- * streamed into the response as the batches are applied.
1059
- *
1060
- * `BatchWrite` requests are not replay protected, meaning that each mutation
1061
- * group can be applied more than once. Replays of non-idempotent mutations
1062
- * can have undesirable effects. For example, replays of an insert mutation
1063
- * can produce an already exists error or if you use generated or commit
1064
- * timestamp-based keys, it can result in additional rows being added to the
1065
- * mutation's table. We recommend structuring your mutation groups to be
1066
- * idempotent to avoid this issue.
1067
- *
1068
- * @param {Object} request
1069
- * The request object that will be sent.
1070
- * @param {string} request.session
1071
- * Required. The session in which the batch request is to be run.
1072
- * @param {google.spanner.v1.RequestOptions} request.requestOptions
1073
- * Common options for this request.
1074
- * @param {number[]} request.mutationGroups
1075
- * Required. The groups of mutations to be applied.
1076
- * @param {boolean} [request.excludeTxnFromChangeStreams]
1077
- * Optional. If you don't set the `exclude_txn_from_change_streams` option or
1078
- * if it's set to `false`, then any change streams monitoring columns modified
1079
- * by transactions will capture the updates made within that transaction.
1080
- * @param {object} [options]
1081
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1082
- * @returns {Stream}
1083
- * An object stream which emits {@link protos.google.spanner.v1.BatchWriteResponse|BatchWriteResponse} on 'data' event.
1084
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation }
1085
- * for more details and examples.
1086
- */
1087
- batchWrite(request?: protos.google.spanner.v1.IBatchWriteRequest, options?: CallOptions): gax.CancellableStream;
1088
- /**
1089
- * Retrieves a cache update for a given database.
1090
- *
1091
- * This RPC can be used to warm up the client cache by fetching key recipes
1092
- * and server information for a given database. It is recommended to call
1093
- * this RPC at the beginning of the client's lifecycle, prior to any other
1094
- * data plane operations.
1095
- *
1096
- * The cache update is returned as a stream because the response can be too
1097
- * large to fit into a single `CacheUpdate` message.
1098
- *
1099
- * @param {Object} request
1100
- * The request object that will be sent.
1101
- * @param {string} request.database
1102
- * Required. The database for which to retrieve the cache update.
1103
- * @param {number} [request.maxRecipeCount]
1104
- * Optional. The maximum number of key recipes to return in the response.
1105
- * If not set, a default limit of 100 will be used.
1106
- * @param {number} [request.maxRangeCount]
1107
- * Optional. The maximum number of ranges to return in the response.
1108
- * If not set, a default limit of 10000 will be used.
1109
- * @param {object} [options]
1110
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1111
- * @returns {Stream}
1112
- * An object stream which emits {@link protos.google.spanner.v1.CacheUpdate|CacheUpdate} on 'data' event.
1113
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation }
1114
- * for more details and examples.
1115
- */
1116
- fetchCacheUpdate(request?: protos.google.spanner.v1.IFetchCacheUpdateRequest, options?: CallOptions): gax.CancellableStream;
1117
- /**
1118
- * Lists all sessions in a given database.
1119
- *
1120
- * @param {Object} request
1121
- * The request object that will be sent.
1122
- * @param {string} request.database
1123
- * Required. The database in which to list sessions.
1124
- * @param {number} request.pageSize
1125
- * Number of sessions to be returned in the response. If 0 or less, defaults
1126
- * to the server's maximum allowed page size.
1127
- * @param {string} request.pageToken
1128
- * If non-empty, `page_token` should contain a
1129
- * {@link protos.google.spanner.v1.ListSessionsResponse.next_page_token|next_page_token}
1130
- * from a previous
1131
- * {@link protos.google.spanner.v1.ListSessionsResponse|ListSessionsResponse}.
1132
- * @param {string} request.filter
1133
- * An expression for filtering the results of the request. Filter rules are
1134
- * case insensitive. The fields eligible for filtering are:
1135
- *
1136
- * * `labels.key` where key is the name of a label
1137
- *
1138
- * Some examples of using filters are:
1139
- *
1140
- * * `labels.env:*` --> The session has the label "env".
1141
- * * `labels.env:dev` --> The session has the label "env" and the value of
1142
- * the label contains the string "dev".
1143
- * @param {object} [options]
1144
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1145
- * @returns {Promise} - The promise which resolves to an array.
1146
- * The first element of the array is Array of {@link protos.google.spanner.v1.Session|Session}.
1147
- * The client library will perform auto-pagination by default: it will call the API as many
1148
- * times as needed and will merge results from all the pages into this array.
1149
- * Note that it can affect your quota.
1150
- * We recommend using `listSessionsAsync()`
1151
- * method described below for async iteration which you can stop as needed.
1152
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1153
- * for more details and examples.
1154
- */
1155
- listSessions(request?: protos.google.spanner.v1.IListSessionsRequest, options?: CallOptions): Promise<[
1156
- protos.google.spanner.v1.ISession[],
1157
- protos.google.spanner.v1.IListSessionsRequest | null,
1158
- protos.google.spanner.v1.IListSessionsResponse
1159
- ]>;
1160
- listSessions(request: protos.google.spanner.v1.IListSessionsRequest, options: CallOptions, callback: PaginationCallback<protos.google.spanner.v1.IListSessionsRequest, protos.google.spanner.v1.IListSessionsResponse | null | undefined, protos.google.spanner.v1.ISession>): void;
1161
- listSessions(request: protos.google.spanner.v1.IListSessionsRequest, callback: PaginationCallback<protos.google.spanner.v1.IListSessionsRequest, protos.google.spanner.v1.IListSessionsResponse | null | undefined, protos.google.spanner.v1.ISession>): void;
1162
- /**
1163
- * Equivalent to `listSessions`, but returns a NodeJS Stream object.
1164
- * @param {Object} request
1165
- * The request object that will be sent.
1166
- * @param {string} request.database
1167
- * Required. The database in which to list sessions.
1168
- * @param {number} request.pageSize
1169
- * Number of sessions to be returned in the response. If 0 or less, defaults
1170
- * to the server's maximum allowed page size.
1171
- * @param {string} request.pageToken
1172
- * If non-empty, `page_token` should contain a
1173
- * {@link protos.google.spanner.v1.ListSessionsResponse.next_page_token|next_page_token}
1174
- * from a previous
1175
- * {@link protos.google.spanner.v1.ListSessionsResponse|ListSessionsResponse}.
1176
- * @param {string} request.filter
1177
- * An expression for filtering the results of the request. Filter rules are
1178
- * case insensitive. The fields eligible for filtering are:
1179
- *
1180
- * * `labels.key` where key is the name of a label
1181
- *
1182
- * Some examples of using filters are:
1183
- *
1184
- * * `labels.env:*` --> The session has the label "env".
1185
- * * `labels.env:dev` --> The session has the label "env" and the value of
1186
- * the label contains the string "dev".
1187
- * @param {object} [options]
1188
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1189
- * @returns {Stream}
1190
- * An object stream which emits an object representing {@link protos.google.spanner.v1.Session|Session} on 'data' event.
1191
- * The client library will perform auto-pagination by default: it will call the API as many
1192
- * times as needed. Note that it can affect your quota.
1193
- * We recommend using `listSessionsAsync()`
1194
- * method described below for async iteration which you can stop as needed.
1195
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1196
- * for more details and examples.
1197
- */
1198
- listSessionsStream(request?: protos.google.spanner.v1.IListSessionsRequest, options?: CallOptions): Transform;
1199
- /**
1200
- * Equivalent to `listSessions`, but returns an iterable object.
1201
- *
1202
- * `for`-`await`-`of` syntax is used with the iterable to get response elements on-demand.
1203
- * @param {Object} request
1204
- * The request object that will be sent.
1205
- * @param {string} request.database
1206
- * Required. The database in which to list sessions.
1207
- * @param {number} request.pageSize
1208
- * Number of sessions to be returned in the response. If 0 or less, defaults
1209
- * to the server's maximum allowed page size.
1210
- * @param {string} request.pageToken
1211
- * If non-empty, `page_token` should contain a
1212
- * {@link protos.google.spanner.v1.ListSessionsResponse.next_page_token|next_page_token}
1213
- * from a previous
1214
- * {@link protos.google.spanner.v1.ListSessionsResponse|ListSessionsResponse}.
1215
- * @param {string} request.filter
1216
- * An expression for filtering the results of the request. Filter rules are
1217
- * case insensitive. The fields eligible for filtering are:
1218
- *
1219
- * * `labels.key` where key is the name of a label
1220
- *
1221
- * Some examples of using filters are:
1222
- *
1223
- * * `labels.env:*` --> The session has the label "env".
1224
- * * `labels.env:dev` --> The session has the label "env" and the value of
1225
- * the label contains the string "dev".
1226
- * @param {object} [options]
1227
- * Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
1228
- * @returns {Object}
1229
- * An iterable Object that allows {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols | async iteration }.
1230
- * When you iterate the returned iterable, each element will be an object representing
1231
- * {@link protos.google.spanner.v1.Session|Session}. The API will be called under the hood as needed, once per the page,
1232
- * so you can stop the iteration when you don't need more results.
1233
- * Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#auto-pagination | documentation }
1234
- * for more details and examples.
1235
- */
1236
- listSessionsAsync(request?: protos.google.spanner.v1.IListSessionsRequest, options?: CallOptions): AsyncIterable<protos.google.spanner.v1.ISession>;
1237
- /**
1238
- * Return a fully-qualified database resource name string.
1239
- *
1240
- * @param {string} project
1241
- * @param {string} instance
1242
- * @param {string} database
1243
- * @returns {string} Resource name string.
1244
- */
1245
- databasePath(project: string, instance: string, database: string): string;
1246
- /**
1247
- * Parse the project from Database resource.
1248
- *
1249
- * @param {string} databaseName
1250
- * A fully-qualified path representing Database resource.
1251
- * @returns {string} A string representing the project.
1252
- */
1253
- matchProjectFromDatabaseName(databaseName: string): string | number;
1254
- /**
1255
- * Parse the instance from Database resource.
1256
- *
1257
- * @param {string} databaseName
1258
- * A fully-qualified path representing Database resource.
1259
- * @returns {string} A string representing the instance.
1260
- */
1261
- matchInstanceFromDatabaseName(databaseName: string): string | number;
1262
- /**
1263
- * Parse the database from Database resource.
1264
- *
1265
- * @param {string} databaseName
1266
- * A fully-qualified path representing Database resource.
1267
- * @returns {string} A string representing the database.
1268
- */
1269
- matchDatabaseFromDatabaseName(databaseName: string): string | number;
1270
- /**
1271
- * Return a fully-qualified session resource name string.
1272
- *
1273
- * @param {string} project
1274
- * @param {string} instance
1275
- * @param {string} database
1276
- * @param {string} session
1277
- * @returns {string} Resource name string.
1278
- */
1279
- sessionPath(project: string, instance: string, database: string, session: string): string;
1280
- /**
1281
- * Parse the project from Session resource.
1282
- *
1283
- * @param {string} sessionName
1284
- * A fully-qualified path representing Session resource.
1285
- * @returns {string} A string representing the project.
1286
- */
1287
- matchProjectFromSessionName(sessionName: string): string | number;
1288
- /**
1289
- * Parse the instance from Session resource.
1290
- *
1291
- * @param {string} sessionName
1292
- * A fully-qualified path representing Session resource.
1293
- * @returns {string} A string representing the instance.
1294
- */
1295
- matchInstanceFromSessionName(sessionName: string): string | number;
1296
- /**
1297
- * Parse the database from Session resource.
1298
- *
1299
- * @param {string} sessionName
1300
- * A fully-qualified path representing Session resource.
1301
- * @returns {string} A string representing the database.
1302
- */
1303
- matchDatabaseFromSessionName(sessionName: string): string | number;
1304
- /**
1305
- * Parse the session from Session resource.
1306
- *
1307
- * @param {string} sessionName
1308
- * A fully-qualified path representing Session resource.
1309
- * @returns {string} A string representing the session.
1310
- */
1311
- matchSessionFromSessionName(sessionName: string): string | number;
1312
- /**
1313
- * Terminate the gRPC channel and close the client.
1314
- *
1315
- * The client will no longer be usable and all future behavior is undefined.
1316
- * @returns {Promise} A promise that resolves when the client is closed.
1317
- */
1318
- close(): Promise<void>;
1319
- }