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