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