@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,1195 +0,0 @@
1
- /*!
2
- * Copyright 2016 Google Inc. All Rights Reserved.
3
- *
4
- * Licensed under the Apache License, Version 2.0 (the "License");
5
- * you may not use this file except in compliance with the License.
6
- * You may obtain a copy of the License at
7
- *
8
- * http://www.apache.org/licenses/LICENSE-2.0
9
- *
10
- * Unless required by applicable law or agreed to in writing, software
11
- * distributed under the License is distributed on an "AS IS" BASIS,
12
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
- * See the License for the specific language governing permissions and
14
- * limitations under the License.
15
- */
16
- import { GrpcService } from './common-grpc/service';
17
- import { PreciseDate } from '@google-cloud/precise-date';
18
- import { GoogleAuth, GoogleAuthOptions } from 'google-auth-library';
19
- import { common as p } from 'protobufjs';
20
- import { Float32, Float, Int, Numeric, PGNumeric, PGJsonb, SpannerDate, Struct, ProtoMessage, ProtoEnum, IProtoMessageParams, IProtoEnumParams } from './codec';
21
- import { Backup } from './backup';
22
- import { Database } from './database';
23
- import { Instance, CreateInstanceCallback, CreateInstanceResponse } from './instance';
24
- import { InstanceConfig, CreateInstanceConfigCallback, CreateInstanceConfigResponse } from './instance-config';
25
- import { grpc, GrpcClientOptions, CallOptions } from 'google-gax';
26
- import { google, google as instanceAdmin } from '../protos/protos';
27
- import { PagedOptions, PagedResponse, PagedCallback, PagedOptionsWithFilter, NormalCallback } from './common';
28
- import { Session } from './session';
29
- import { SessionPool } from './session-pool';
30
- import { Table } from './table';
31
- import { MutationGroup, MutationSet, PartitionedDml, Snapshot, Transaction } from './transaction';
32
- import * as v1 from './v1';
33
- import { ObservabilityOptions } from './instrument';
34
- export type IOperation = instanceAdmin.longrunning.IOperation;
35
- export type GetInstancesOptions = PagedOptionsWithFilter;
36
- export type GetInstancesResponse = PagedResponse<Instance, instanceAdmin.spanner.admin.instance.v1.IListInstancesResponse>;
37
- export type GetInstancesCallback = PagedCallback<Instance, instanceAdmin.spanner.admin.instance.v1.IListInstancesResponse>;
38
- export type GetInstanceConfigsOptions = PagedOptions;
39
- export type GetInstanceConfigsResponse = PagedResponse<instanceAdmin.spanner.admin.instance.v1.IInstanceConfig, instanceAdmin.spanner.admin.instance.v1.IListInstanceConfigsResponse>;
40
- export type GetInstanceConfigsCallback = PagedCallback<instanceAdmin.spanner.admin.instance.v1.IInstanceConfig, instanceAdmin.spanner.admin.instance.v1.IListInstanceConfigsResponse>;
41
- export interface GetInstanceConfigOptions {
42
- gaxOptions?: CallOptions;
43
- }
44
- export type GetInstanceConfigResponse = [IInstanceConfig];
45
- export type GetInstanceConfigCallback = NormalCallback<IInstanceConfig>;
46
- export type GetInstanceConfigOperationsOptions = PagedOptionsWithFilter;
47
- export type GetInstanceConfigOperationsResponse = PagedResponse<IOperation, instanceAdmin.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse>;
48
- export type GetInstanceConfigOperationsCallback = PagedCallback<IOperation, instanceAdmin.spanner.admin.instance.v1.IListInstanceConfigOperationsResponse>;
49
- /**
50
- * Session pool configuration options.
51
- * @property {boolean} [routeToLeaderEnabled=True] If set to false leader aware routing will be disabled.
52
- * Disabling leader aware routing would route all requests in RW/PDML transactions to any region.
53
- * @property {google.spanner.v1.IDirectedReadOptions} [directedReadOptions] Sets the DirectedReadOptions for all ReadRequests and ExecuteSqlRequests for the Client.
54
- * Indicates which replicas or regions should be used for non-transactional reads or queries.
55
- * DirectedReadOptions won't be set for readWrite transactions"
56
- * @property {ObservabilityOptions} [observabilityOptions] Sets the observability options to be used for OpenTelemetry tracing
57
- */
58
- export interface SpannerOptions extends GrpcClientOptions {
59
- apiEndpoint?: string;
60
- servicePath?: string;
61
- port?: number;
62
- sslCreds?: grpc.ChannelCredentials;
63
- routeToLeaderEnabled?: boolean;
64
- directedReadOptions?: google.spanner.v1.IDirectedReadOptions | null;
65
- observabilityOptions?: ObservabilityOptions;
66
- }
67
- export interface RequestConfig {
68
- client: string;
69
- method: string;
70
- reqOpts: any;
71
- gaxOpts?: CallOptions;
72
- headers: {
73
- [k: string]: string;
74
- };
75
- }
76
- export interface CreateInstanceRequest {
77
- config?: string;
78
- nodes?: number;
79
- processingUnits?: number;
80
- displayName?: string;
81
- labels?: {
82
- [k: string]: string;
83
- } | null;
84
- gaxOptions?: CallOptions;
85
- }
86
- export interface CreateInstanceConfigRequest {
87
- displayName?: string;
88
- replicas?: google.spanner.admin.instance.v1.IReplicaInfo[];
89
- baseConfig?: string;
90
- labels?: {
91
- [k: string]: string;
92
- } | null;
93
- etag?: string;
94
- validateOnly?: boolean;
95
- gaxOptions?: CallOptions;
96
- }
97
- /**
98
- * Translates enum values to string keys.
99
- *
100
- * @param E enum type.
101
- */
102
- export type EnumKey<E extends {
103
- [index: string]: unknown;
104
- }> = keyof E;
105
- /**
106
- * Translates an enum property of an object from enum value to enum key, leaving
107
- * all other properties as-is.
108
- *
109
- * @param T type containing properties to translate.
110
- * @param U name of the enum property.
111
- * @param E enum type to translate.
112
- */
113
- export type TranslateEnumKeys<T, U extends keyof T, E extends {
114
- [index: string]: unknown;
115
- }> = {
116
- [P in keyof T]: P extends U ? EnumKey<E> | null | undefined : T[P];
117
- };
118
- /**
119
- * [Cloud Spanner](https://cloud.google.com/spanner) is a highly scalable,
120
- * transactional, managed, NewSQL database service. Cloud Spanner solves the
121
- * need for a horizontally-scaling database with consistent global transaction
122
- * and SQL semantics. With Cloud Spanner you don't need to choose between
123
- * consistency and horizontal scaling — you get both.
124
- *
125
- * @class
126
- *
127
- * @see [Cloud Spanner Documentation](https://cloud.google.com/spanner/docs)
128
- * @see [Cloud Spanner Concepts](https://cloud.google.com/spanner/docs/concepts)
129
- *
130
- * @example Install the client library with <a
131
- * href="https://www.npmjs.com/">npm</a>:
132
- * ```
133
- * npm install --save @google-cloud/spanner
134
- * ```
135
- *
136
- * @example Create a client that uses <a
137
- * href="https://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application">Application
138
- * Default Credentials (ADC)</a>:
139
- * ```
140
- * const client = new Spanner();
141
- * ```
142
- *
143
- * @example Create a client with <a
144
- * href="https://cloud.google.com/docs/authentication/production#obtaining_and_providing_service_account_credentials_manually">explicit
145
- * credentials</a>:
146
- * ```
147
- * const client = new Spanner({ projectId:
148
- * 'your-project-id', keyFilename: '/path/to/keyfile.json'
149
- * });
150
- * ```
151
- *
152
- * @example <caption>include:samples/quickstart.js</caption>
153
- * region_tag:spanner_quickstart
154
- * Full quickstart example:
155
- *
156
- * @param {ClientConfig} [options] Configuration options.
157
- */
158
- declare class Spanner extends GrpcService {
159
- options: GoogleAuthOptions;
160
- auth: GoogleAuth;
161
- clients_: Map<string, {}>;
162
- instances_: Map<string, Instance>;
163
- instanceConfigs_: Map<string, InstanceConfig>;
164
- projectIdReplaced_: boolean;
165
- projectFormattedName_: string;
166
- commonHeaders_: {
167
- [k: string]: string;
168
- };
169
- routeToLeaderEnabled: boolean;
170
- directedReadOptions: google.spanner.v1.IDirectedReadOptions | null;
171
- _observabilityOptions: ObservabilityOptions | undefined;
172
- /**
173
- * Placeholder used to auto populate a column with the commit timestamp.
174
- * This can only be used for timestamp columns that have set the option
175
- * "(allow_commit_timestamp=true)" in the schema.
176
- *
177
- * @type {string}
178
- */
179
- static COMMIT_TIMESTAMP: string;
180
- static POSTGRESQL: google.spanner.admin.database.v1.DatabaseDialect;
181
- static GOOGLE_STANDARD_SQL: google.spanner.admin.database.v1.DatabaseDialect;
182
- /**
183
- * Gets the configured Spanner emulator host from an environment variable.
184
- */
185
- static getSpannerEmulatorHost(): {
186
- endpoint: string;
187
- port?: number;
188
- } | undefined;
189
- constructor(options?: SpannerOptions);
190
- /**
191
- * Gets the InstanceAdminClient object.
192
- * The returned InstanceAdminClient object is a shared, managed instance and should not be manually closed.
193
- * @returns {v1.InstanceAdminClient} The InstanceAdminClient object
194
- * @example
195
- * ```
196
- * const {Spanner} = require('@google-cloud/spanner');
197
- * const spanner = new Spanner({
198
- * projectId: projectId,
199
- * });
200
- * const instanceAdminClient = spanner.getInstanceAdminClient();
201
- * ```
202
- */
203
- getInstanceAdminClient(): v1.InstanceAdminClient;
204
- /**
205
- * Gets the DatabaseAdminClient object.
206
- * The returned DatabaseAdminClient object is a managed, shared instance and should not be manually closed.
207
- * @returns {v1.DatabaseAdminClient} The DatabaseAdminClient object.
208
- * @example
209
- * ```
210
- * const {Spanner} = require('@google-cloud/spanner');
211
- * const spanner = new Spanner({
212
- * projectId: projectId,
213
- * });
214
- * const databaseAdminClient = spanner.getDatabaseAdminClient();
215
- * ```
216
- */
217
- getDatabaseAdminClient(): v1.DatabaseAdminClient;
218
- /** Closes this Spanner client and cleans up all resources used by it. */
219
- close(): void;
220
- /**
221
- * Config for the new instance.
222
- *
223
- * @typedef {object} CreateInstanceRequest
224
- * @property {string} config The name of the instance's configuration.
225
- * @property {number} [nodes=1] The number of nodes allocated to this instance.
226
- * Defaults to 1.
227
- * @property {Object.<string, string>} [labels] Labels are a flexible and
228
- * lightweight mechanism for organizing cloud resources into groups that
229
- * reflect a customer's organizational needs and deployment strategies.
230
- * Cloud Labels can be used to filter collections of resources. They can
231
- * be used to control how resource metrics are aggregated. And they can
232
- * be used as arguments to policy management rules (e.g. route,
233
- * firewall, load balancing, etc.).
234
- * @property {string} [displayName] The descriptive name for this instance
235
- * as it appears in UIs. Must be unique per project and between 4 and 30
236
- * characters in length.
237
- * Defaults to the instance unique identifier '<instance>' of the full
238
- * instance name of the form 'projects/<project>/instances/<instance>'.
239
- */
240
- /**
241
- * @typedef {array} CreateInstanceResponse
242
- * @property {Instance} 0 The new {@link Instance}.
243
- * @property {google.longrunning.Operation} 1 An operation object that can be used to check
244
- * the status of the request.
245
- * @property {google.longrunning.IOperation} 2 The full API response.
246
- */
247
- /**
248
- * @callback CreateInstanceCallback
249
- * @param {?Error} err Request error, if any.
250
- * @param {Instance} instance The new {@link Instance}.
251
- * @param {google.longrunning.Operation} operation An operation object that can be used to
252
- * check the status of the request.
253
- * @param {google.longrunning.IOperation} apiResponse The full API response.
254
- */
255
- /**
256
- * Create an instance.
257
- *
258
- * Wrapper around {@link v1.InstanceAdminClient#createInstance}.
259
- *
260
- * @see {@link v1.InstanceAdminClient#createInstance}
261
- * @see [CreateInstance API Documentation](https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.admin.instance.v1#google.spanner.admin.instance.v1.InstanceAdmin.CreateInstance)
262
- *
263
- * @throws {GoogleError} If a name is not provided.
264
- * @throws {GoogleError} If a configuration object is not provided.
265
- *
266
- * @param {string} name The name of the instance to be created.
267
- * @param {CreateInstanceRequest} config Configuration object.
268
- * @param {CreateInstanceCallback} [callback] Callback function.
269
- * @returns {Promise<CreateInstanceResponse>}
270
- *
271
- * @example
272
- * ```
273
- * const {Spanner} = require('@google-cloud/spanner');
274
- * const spanner = new Spanner();
275
- *
276
- * const config = {
277
- * config: 'regional-us-central1',
278
- * nodes: 1
279
- * };
280
- *
281
- * function callback(err, instance, operation, apiResponse) {
282
- * if (err) {
283
- * // Error handling omitted.
284
- * }
285
- *
286
- * operation
287
- * .on('error', function(err) {})
288
- * .on('complete', function() {
289
- * // Instance created successfully.
290
- * });
291
- * }
292
- *
293
- * spanner.createInstance('new-instance-name', config, callback);
294
- *
295
- * //-
296
- * // If the callback is omitted, we'll return a Promise.
297
- * //-
298
- * spanner.createInstance('new-instance-name', config)
299
- * .then(function(data) {
300
- * const instance = data[0];
301
- * const operation = data[1];
302
- * return operation.promise();
303
- * })
304
- * .then(function() {
305
- * // Instance created successfully.
306
- * });
307
- * ```
308
- */
309
- createInstance(name: string, config: CreateInstanceRequest): Promise<CreateInstanceResponse>;
310
- createInstance(name: string, config: CreateInstanceRequest, callback: CreateInstanceCallback): void;
311
- /**
312
- * Query object for listing instances.
313
- *
314
- * @typedef {object} GetInstancesOptions
315
- * @property {object} [gaxOptions] Request configuration options,
316
- * See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions}
317
- * for more details.
318
- * @property {string} [filter] An expression for filtering the results of the
319
- * request. Filter rules are case insensitive. The fields eligible for
320
- * filtering are:
321
- * - **`name`**
322
- * - **`display_name`**
323
- * - **`labels.key`** where key is the name of a label
324
- *
325
- * Some examples of using filters are:
326
- * - **`name:*`** The instance has a name.
327
- * - **`name:Howl`** The instance's name is howl.
328
- * - **`labels.env:*`** The instance has the label env.
329
- * - **`labels.env:dev`** The instance's label env has the value dev.
330
- * - **`name:howl labels.env:dev`** The instance's name is howl and it has
331
- * the label env with value dev.
332
- * @property {number} [pageSize] Maximum number of results per page.
333
- * @property {string} [pageToken] A previously-returned page token
334
- * representing part of the larger set of results to view.
335
- */
336
- /**
337
- * @typedef {array} GetInstancesResponse
338
- * @property {Instance[]} 0 Array of {@link Instance} instances.
339
- * @property {object} 1 A query object to receive more results.
340
- * @property {object} 2 The full API response.
341
- */
342
- /**
343
- * @callback GetInstancesCallback
344
- * @param {?Error} err Request error, if any.
345
- * @param {Instance[]} instances Array of {@link Instance} instances.
346
- * @param {string} nextQuery A query object to receive more results.
347
- * @param {object} apiResponse The full API response.
348
- */
349
- /**
350
- * Get a list of instances.
351
- *
352
- * Wrapper around {@link v1.InstanceAdminClient#listInstances}.
353
- *
354
- * @see {@link v1.InstanceAdminClient#listInstances}
355
- * @see [ListInstances API Documentation](https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.admin.instance.v1#google.spanner.admin.instance.v1.InstanceAdmin.ListInstances)
356
- *
357
- * @param {GetInstancesOptions} [options] Query object for listing instances.
358
- * @param {GetInstancesCallback} [callback] Callback function.
359
- * @returns {Promise<GetInstancesResponse>}
360
- *
361
- * @example
362
- * ```
363
- * const {Spanner} = require('@google-cloud/spanner');
364
- * const spanner = new Spanner();
365
- *
366
- * spanner.getInstances(function(err, instances) {
367
- * // `instances` is an array of `Instance` objects.
368
- * });
369
- *
370
- * //-
371
- * // To control how many API requests are made and page through the results
372
- * // manually, set `autoPaginate` to `false`.
373
- * //-
374
- * function callback(err, instances, nextQuery, apiResponse) {
375
- * if (nextQuery) {
376
- * // More results exist.
377
- * spanner.getInstances(nextQuery, callback);
378
- * }
379
- * }
380
- *
381
- * spanner.getInstances({
382
- * gaxOptions: {
383
- * autoPaginate: false,
384
- * }
385
- * }, callback);
386
- *
387
- * //-
388
- * // If the callback is omitted, we'll return a Promise.
389
- * //-
390
- * spanner.getInstances().then(function(data) {
391
- * const instances = data[0];
392
- * });
393
- * ```
394
- */
395
- getInstances(options?: GetInstancesOptions): Promise<GetInstancesResponse>;
396
- getInstances(callback: GetInstancesCallback): void;
397
- getInstances(query: GetInstancesOptions, callback: GetInstancesCallback): void;
398
- /**
399
- * Get a list of {@link Instance} objects as a readable object stream.
400
- *
401
- * Wrapper around {@link v1.InstanceAdminClient#listInstances}.
402
- *
403
- * @see {@link v1.InstanceAdminClient#listInstances}
404
- * @see [ListInstances API Documentation](https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.admin.instance.v1#google.spanner.admin.instance.v1.InstanceAdmin.ListInstances)
405
- *
406
- * @method Spanner#getInstancesStream
407
- * @param {GetInstancesOptions} [options] Query object for listing instances.
408
- * @returns {ReadableStream} A readable stream that emits {@link Instance}
409
- * instances.
410
- *
411
- * @example
412
- * ```
413
- * const {Spanner} = require('@google-cloud/spanner');
414
- * const spanner = new Spanner();
415
- *
416
- * spanner.getInstancesStream()
417
- * .on('error', console.error)
418
- * .on('data', function(instance) {
419
- * // `instance` is an `Instance` object.
420
- * })
421
- * .on('end', function() {
422
- * // All instances retrieved.
423
- * });
424
- *
425
- * //-
426
- * // If you anticipate many results, you can end a stream early to prevent
427
- * // unnecessary processing and API requests.
428
- * //-
429
- * spanner.getInstancesStream()
430
- * .on('data', function(instance) {
431
- * this.end();
432
- * });
433
- * ```
434
- */
435
- getInstancesStream(options?: GetInstancesOptions): NodeJS.ReadableStream;
436
- /**
437
- * Config for the new instance config.
438
- *
439
- * @typedef {object} CreateInstanceConfigRequest
440
- * @property {string} [displayName] The name of this instance configuration as
441
- * it appears in the user interface.
442
- * @property {google.spanner.admin.instance.v1.IReplicaInfo[]} [replicas] The
443
- * geographic placement of nodes in this instance configuration and their
444
- * replication properties.
445
- * @property {string} [baseConfig] Base configuration name,
446
- * e.g. projects/<project_name>/instanceConfigs/nam3 based on which this
447
- * configuration is created.
448
- * @property {Object.<string, string>} [labels] Cloud Labels are a flexible
449
- * and lightweight mechanism for organizing cloud resources into groups
450
- * that reflect a customer's organizational needs and deployment
451
- * strategies. Cloud Labels can be used to filter collections of
452
- * resources. They can be used to control how resource metrics are
453
- * aggregated. And they can be used as arguments to policy management
454
- * rules (e.g. route, firewall, load balancing, etc.).
455
- * @property {string} [etag] etag is used for optimistic concurrency control
456
- * as a way to help prevent simultaneous updates of a instance config from
457
- * overwriting each other.
458
- * @property {boolean} [validateOnly] An option to validate, but not actually
459
- * execute, a request, and provide the same response.
460
- */
461
- /**
462
- * @typedef {array} CreateInstanceConfigResponse
463
- * @property {InstanceConfig} 0 The new {@link google.spanner.admin.instance.v1.InstanceConfig}.
464
- * @property {google.longrunning.Operation} 1 An operation object that can be
465
- * used to check the status of the request.
466
- * @property {google.longrunning.IOperation} 2 The full API response.
467
- */
468
- /**
469
- * @callback CreateInstanceConfigCallback
470
- * @param {?Error} err Request error, if any.
471
- * @param {InstanceConfig} instanceConfig The new {@link google.spanner.admin.instance.v1.InstanceConfig}.
472
- * @param {google.longrunning.Operation} operation An operation object that
473
- * can be used to check the status of the request.
474
- * @param {google.longrunning.IOperation} apiResponse The full API response.
475
- */
476
- /**
477
- * Create an instance config.
478
- *
479
- * Wrapper around {@link v1.InstanceAdminClient#createInstanceConfig}.
480
- *
481
- * @see {@link v1.InstanceAdminClient#createInstanceConfig}
482
- * @see [CreateInstanceConfig API Documentation](https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.admin.instance.v1#google.spanner.admin.instance.v1.InstanceAdmin.CreateInstanceConfig)
483
- *
484
- * @throws {GoogleError} If a name is not provided.
485
- * @throws {GoogleError} If a configuration object is not provided.
486
- * @throws {GoogleError} If a base config is not provided in the configuration
487
- * object.
488
- *
489
- * @param {string} name The name of the instance config to be created.
490
- * @param {CreateInstanceConfigRequest} config Configuration object.
491
- * @param {CreateInstanceConfigCallback} [callback] Callback function.
492
- * @returns {Promise<CreateInstanceConfigResponse>}
493
- *
494
- * @example
495
- * ```
496
- * const {Spanner} = require('@google-cloud/spanner');
497
- * const spanner = new Spanner();
498
- *
499
- * const [baseInstanceConfig] =
500
- * await spanner.getInstanceConfig(baseInstanceConfigId);
501
- * const config = {
502
- * baseConfig: baseInstanceConfig.name,
503
- * replicas: baseInstanceConfig.replicas.concat(baseInstanceConfig.optionalReplicas[0])
504
- * };
505
- *
506
- * function callback(err, instance, operation, apiResponse) {
507
- * if (err) {
508
- * // Error handling omitted.
509
- * }
510
- *
511
- * operation
512
- * .on('error', function(err) {})
513
- * .on('complete', function() {
514
- * // Instance created successfully.
515
- * });
516
- * }
517
- *
518
- * spanner.createInstanceConfig('custom-new-instance-config', config, callback);
519
- *
520
- * //-
521
- * // If the callback is omitted, we'll return a Promise.
522
- * //-
523
- * spanner.createInstanceConfig('custom-new-instance-config', config)
524
- * .then(function(data) {
525
- * const instanceConfig = data[0];
526
- * const operation = data[1];
527
- * return operation.promise();
528
- * })
529
- * .then(function() {
530
- * // Instance config created successfully.
531
- * });
532
- * ```
533
- */
534
- createInstanceConfig(name: string, config: CreateInstanceConfigRequest): Promise<CreateInstanceConfigResponse>;
535
- createInstanceConfig(name: string, config: CreateInstanceConfigRequest, callback: CreateInstanceConfigCallback): void;
536
- /**
537
- * Lists the supported instance configurations for a given project.
538
- *
539
- * @typedef {object} GetInstanceConfigsOptions
540
- * @property {number} [pageSize] Maximum number of results per page.
541
- * @property {string} [pageToken] A previously-returned page token
542
- * representing part of the larger set of results to view.
543
- * @property {object} [gaxOptions] Request configuration options,
544
- * See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions}
545
- * for more details.
546
- */
547
- /**
548
- * @typedef {array} GetInstanceConfigsResponse
549
- * @property {object[]} 0 List of all available instance configs.
550
- * @property {string} 0.name The unique identifier for the instance config.
551
- * @property {string} 0.displayName The name of the instance config as it
552
- * appears in UIs.
553
- * @property {google.spanner.admin.instance.v1.IReplicaInfo[]} 0.replicas The replicas used by
554
- * this instance config.
555
- * @property {string[]} 0.leaderOptions The possible leader options for this instance config.
556
- * @property {object} 1 A query object to receive more results.
557
- * @property {object} 2 The full API response.
558
- */
559
- /**
560
- * @callback GetInstanceConfigsCallback
561
- * @param {?Error} err Request error, if any.
562
- * @param {object[]} instanceConfigs List of all available instance configs.
563
- * @param {string} instanceConfigs.name The unique identifier for the instance
564
- * config.
565
- * @param {string} instanceConfigs.displayName The name of the instance config
566
- * as it appears in UIs.
567
- * @param {google.spanner.admin.instance.v1.IReplicaInfo[]} instanceConfigs.replicas The replicas used by
568
- * this instance config.
569
- * @param {string[]} instanceConfigs.leaderOptions The possible leader options for this instance config.
570
- * @param {object} nextQuery A query object to receive more results.
571
- * @param {object} apiResponse The full API response.
572
- */
573
- /**
574
- * Get a list of instance configs.
575
- *
576
- * Wrapper around {@link v1.InstanceAdminClient#listInstanceConfigs}.
577
- *
578
- * @see {@link v1.InstanceAdminClient#listInstanceConfigs}
579
- * @see [ListInstanceConfigs API Documentation](https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.admin.instance.v1#google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs)
580
- *
581
- * @param {GetInstanceConfigsOptions} [options] Query object for listing instance
582
- * configs.
583
- * @param {GetInstanceConfigsCallback} [callback] Callback function.
584
- * @returns {Promise<GetInstanceConfigsResponse>}
585
- *
586
- * @example
587
- * ```
588
- * const {Spanner} = require('@google-cloud/spanner');
589
- * const spanner = new Spanner();
590
- *
591
- * spanner.getInstanceConfigs(function(err, instanceConfigs) {
592
- * // `instanceConfigs` is an array of instance configuration descriptors.
593
- * });
594
- *
595
- * //-
596
- * // To control how many API requests are made and page through the results
597
- * // manually, set `autoPaginate` to `false`.
598
- * //-
599
- * function callback(err, instanceConfigs, nextQuery, apiResponse) {
600
- * if (nextQuery) {
601
- * // More results exist.
602
- * spanner.getInstanceConfigs(nextQuery, callback);
603
- * }
604
- * }
605
- *
606
- * spanner.getInstanceConfigs({
607
- * gaxOptions: {
608
- * autoPaginate: false,
609
- * }
610
- * }, callback);
611
- *
612
- * //-
613
- * // If the callback is omitted, we'll return a Promise.
614
- * //-
615
- * spanner.getInstanceConfigs().then(function(data) {
616
- * const instanceConfigs = data[0];
617
- * });
618
- * ```
619
- */
620
- getInstanceConfigs(query?: GetInstanceConfigsOptions): Promise<GetInstanceConfigsResponse>;
621
- getInstanceConfigs(callback: GetInstanceConfigsCallback): void;
622
- getInstanceConfigs(query: GetInstanceConfigsOptions, callback: GetInstanceConfigsCallback): void;
623
- /**
624
- * Get a list of instance configs as a readable object stream.
625
- *
626
- * Wrapper around {@link v1.InstanceAdminClient#listInstanceConfigsStream}.
627
- *
628
- * @see {@link v1.InstanceAdminClient#listInstanceConfigsStream}
629
- * @see [ListInstanceConfigs API Documentation](https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.admin.instance.v1#google.spanner.admin.instance.v1.InstanceAdmin.ListInstanceConfigs)
630
- *
631
- * @method Spanner#getInstanceConfigsStream
632
- * @param {GetInstanceConfigsOptions} [options] Query object for listing instance
633
- * configs.
634
- * @returns {ReadableStream} A readable stream that emits instance configs.
635
- *
636
- * @example
637
- * ```
638
- * const {Spanner} = require('@google-cloud/spanner');
639
- * const spanner = new Spanner();
640
- *
641
- * spanner.getInstanceConfigsStream()
642
- * .on('error', console.error)
643
- * .on('data', function(instanceConfig) {})
644
- * .on('end', function() {
645
- * // All instances retrieved.
646
- * });
647
- *
648
- * //-
649
- * // If you anticipate many results, you can end a stream early to prevent
650
- * // unnecessary processing and API requests.
651
- * //-
652
- * spanner.getInstanceConfigsStream()
653
- * .on('data', function(instanceConfig) {
654
- * this.end();
655
- * });
656
- * ```
657
- */
658
- getInstanceConfigsStream(options?: GetInstanceConfigsOptions): NodeJS.ReadableStream;
659
- /**
660
- * Gets the instance configuration with the specified name.
661
- */
662
- /**
663
- * @typedef {array} GetInstanceConfigResponse
664
- * @property {object[]} 0 The metadata of the instance config.
665
- * @property {string} 0.name The unique identifier for the instance config.
666
- * @property {string} 0.displayName The name of the instance config as it
667
- * appears in UIs.
668
- * @property {google.spanner.admin.instance.v1.IReplicaInfo[]} 0.replicas The replicas used by
669
- * this instance config.
670
- * @property {string[]} 0.leaderOptions The possible leader options for this instance config.
671
- */
672
- /**
673
- * @callback GetInstanceConfigCallback
674
- * @param {?Error} err Request error, if any.
675
- * @param {object} instanceConfig The metadata of the instance config.
676
- * @param {string} instanceConfig.name The unique identifier for the instance
677
- * config.
678
- * @param {string} instanceConfig.displayName The name of the instance config
679
- * as it appears in UIs.
680
- * @param {google.spanner.admin.instance.v1.IReplicaInfo[]} instanceConfig.replicas The replicas used by
681
- * this instance config.
682
- * @param {string[]} 0.leaderOptions The possible leader options for this instance config.
683
- */
684
- /**
685
- * Get a specific instance config.
686
- *
687
- * Wrapper around {@link v1.InstanceAdminClient#getInstanceConfig}.
688
- *
689
- * @see {@link v1.InstanceAdminClient#getInstanceConfig}
690
- * @see [GetInstanceConfig API Documentation](https://cloud.google.com/spanner/docs/reference/rpc/google.spanner.admin.instance.v1#google.spanner.admin.instance.v1.InstanceAdmin.GetInstanceConfig)
691
- *
692
- * @param {string} [name] The name of the instance config to get.
693
- * @param {GetInstanceConfigCallback} [callback] Callback function.
694
- * @returns {Promise<GetInstanceConfigResponse>}
695
- *
696
- * @example
697
- * ```
698
- * const {Spanner} = require('@google-cloud/spanner');
699
- * const spanner = new Spanner();
700
- *
701
- * spanner.getInstanceConfig('nam6', function(err, instanceConfig) {
702
- * // `instanceConfig` is an instance configuration descriptor.
703
- * });
704
- *
705
- * //-
706
- * // If the callback is omitted, we'll return a Promise.
707
- * //-
708
- * spanner.getInstanceConfig().then(function(data) {
709
- * const instanceConfig = data[0];
710
- * });
711
- * ```
712
- */
713
- getInstanceConfig(name: string): Promise<GetInstanceConfigResponse>;
714
- getInstanceConfig(name: string, options: GetInstanceConfigOptions): Promise<GetInstanceConfigResponse>;
715
- getInstanceConfig(name: string, callback: GetInstanceConfigCallback): void;
716
- getInstanceConfig(name: string, options: GetInstanceConfigOptions, callback: GetInstanceConfigCallback): void;
717
- /**
718
- * Query object for listing instance config operations.
719
- *
720
- * @typedef {object} GetInstanceConfigOperationsOptions
721
- * @property {string} [filter] An expression for filtering the results of the
722
- * request. Filter can be configured as outlined in
723
- * {@link v1.DatabaseAdminClient#listInstanceConfigOperations}.
724
- * @property {number} [pageSize] Maximum number of results per page.
725
- * @property {string} [pageToken] A previously-returned page token
726
- * representing part of the larger set of results to view.
727
- * @property {object} [gaxOptions] Request configuration options,
728
- * See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions}
729
- * for more details.
730
- */
731
- /**
732
- * @typedef {array} GetInstanceConfigOperationsResponse
733
- * @property {google.longrunning.IOperation[]} 0 Array of {@link IOperation} instances.
734
- * @property {object} 1 A query object to receive more results.
735
- * @property {object} 2 The full API response.
736
- */
737
- /**
738
- * @callback GetInstanceConfigOperationsCallback
739
- * @param {?Error} err Request error, if any.
740
- * @param {google.longrunning.IOperation[]} 0 Array of {@link IOperation} instances.
741
- * @param {object} nextQuery A query object to receive more results.
742
- * @param {object} apiResponse The full API response.
743
- */
744
- /**
745
- * List pending and completed instance config operations.
746
- *
747
- * @see {@link #listOperations}
748
- *
749
- * @param {GetInstanceConfigOperationsOptions} [options] The query object for
750
- * listing InstanceConfig operations.
751
- * @param {gax.CallOptions} [options.gaxOptions] The request configuration
752
- * options, See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions}
753
- * for more details.
754
- * @returns {Promise<GetInstanceConfigOperationsResponse>} When resolved,
755
- * contains a paged list of InstanceConfig operations.
756
- *
757
- * @example
758
- * ```
759
- * const {Spanner} = require('@google-cloud/spanner');
760
- * const spanner = new Spanner();
761
- * const [operations] = await spanner.getInstanceConfigOperations();
762
- *
763
- * //-
764
- * // To manually handle pagination, set autoPaginate:false in gaxOptions.
765
- * //-
766
- * let pageToken = undefined;
767
- * do {
768
- * const [operations, , response] = await spanner.getInstanceConfigOperations({
769
- * pageSize: 3,
770
- * pageToken,
771
- * gaxOptions: {autoPaginate: false},
772
- * });
773
- * operations.forEach(operation => {
774
- * // Do something with operation
775
- * });
776
- * pageToken = response.nextPageToken;
777
- * } while (pageToken);
778
- * ```
779
- */
780
- getInstanceConfigOperations(options?: GetInstanceConfigOperationsOptions): Promise<GetInstanceConfigOperationsResponse>;
781
- getInstanceConfigOperations(callback: GetInstanceConfigOperationsCallback): void;
782
- getInstanceConfigOperations(options: GetInstanceConfigOperationsOptions, callback: GetInstanceConfigOperationsCallback): void;
783
- /**
784
- * Get a reference to an Instance object.
785
- *
786
- * @throws {GoogleError} If a name is not provided.
787
- *
788
- * @param {string} name The name of the instance.
789
- * @returns {Instance} An Instance object.
790
- *
791
- * @example
792
- * ```
793
- * const {Spanner} = require('@google-cloud/spanner');
794
- * const spanner = new Spanner();
795
- * const instance = spanner.instance('my-instance');
796
- * ```
797
- */
798
- instance(name: string): Instance;
799
- /**
800
- * Get a reference to an InstanceConfig object.
801
- *
802
- * @throws {GoogleError} If a name is not provided.
803
- *
804
- * @param {string} name The name of the instance config.
805
- * @returns {InstanceConfig} An InstanceConfig object.
806
- *
807
- * @example
808
- * ```
809
- * const {Spanner} = require('@google-cloud/spanner');
810
- * const spanner = new Spanner();
811
- * const instanceConfig = spanner.instanceConfig('my-instance-config');
812
- * ```
813
- */
814
- instanceConfig(name: string): InstanceConfig;
815
- /**
816
- * Prepare a gapic request. This will cache the GAX client and replace
817
- * {{projectId}} placeholders, if necessary.
818
- *
819
- * @private
820
- *
821
- * @param {object} config Request config
822
- * @param {function} callback Callback function
823
- */
824
- prepareGapicRequest_(config: any, callback: any): void;
825
- /**
826
- * Funnel all API requests through this method to be sure we have a project
827
- * ID.
828
- *
829
- * @param {object} config Configuration object.
830
- * @param {object} config.gaxOpts GAX options.
831
- * @param {function} config.method The gax method to call.
832
- * @param {object} config.reqOpts Request options.
833
- * @param {function} [callback] Callback function.
834
- * @returns {Promise}
835
- */
836
- request(config: any, callback?: any): any;
837
- /**
838
- * Funnel all streaming API requests through this method to be sure we have a
839
- * project ID.
840
- *
841
- * @param {object} config Configuration object.
842
- * @param {object} config.gaxOpts GAX options.
843
- * @param {function} config.method The gax method to call.
844
- * @param {object} config.reqOpts Request options.
845
- * @param {function} [callback] Callback function.
846
- * @returns {Stream}
847
- */
848
- requestStream(config: any): any;
849
- static date(dateString?: string): any;
850
- static date(year: number, month: number, date: number): any;
851
- /**
852
- * Date object with nanosecond precision. Supports all standard Date arguments
853
- * in addition to several custom types.
854
- * @external PreciseDate
855
- * @see {@link https://github.com/googleapis/nodejs-precise-date|PreciseDate}
856
- */
857
- /**
858
- * Helper function to get a Cloud Spanner Timestamp object.
859
- *
860
- * String timestamps should have a canonical format of
861
- * `YYYY-[M]M-[D]D[( |T)[H]H:[M]M:[S]S[.DDDDDDDDD]]Z`
862
- *
863
- * **Timestamp values must be expressed in Zulu time and cannot include a UTC
864
- * offset.**
865
- *
866
- * @see https://cloud.google.com/spanner/docs/data-types#timestamp-type
867
- *
868
- * @param {string|number|google.protobuf.Timestamp|external:PreciseDate}
869
- * [timestamp] Either a RFC 3339 timestamp formatted string or a
870
- * {@link google.protobuf.Timestamp} object. If a PreciseDate is given, it
871
- * will return that timestamp as is.
872
- * @returns {external:PreciseDate}
873
- *
874
- * @example
875
- * ```
876
- * const timestamp = Spanner.timestamp('2019-02-08T10:34:29.481145231Z');
877
- *
878
- * ```
879
- * @example With a `google.protobuf.Timestamp` object
880
- * ```
881
- * const [seconds, nanos] = process.hrtime();
882
- * const timestamp = Spanner.timestamp({seconds, nanos});
883
- * ```
884
- *
885
- * @example With a Date timestamp
886
- * ```
887
- * const timestamp = Spanner.timestamp(Date.now());
888
- * ```
889
- */
890
- static timestamp(value?: string | number | p.ITimestamp | PreciseDate): PreciseDate;
891
- /**
892
- * Helper function to get a Cloud Spanner Float32 object.
893
- *
894
- * @param {string|number} value The float as a number or string.
895
- * @returns {Float32}
896
- *
897
- * @example
898
- * ```
899
- * const {Spanner} = require('@google-cloud/spanner');
900
- * const float = Spanner.float32(10);
901
- * ```
902
- */
903
- static float32(value: any): Float32;
904
- /**
905
- * Helper function to get a Cloud Spanner Float64 object.
906
- *
907
- * @param {string|number} value The float as a number or string.
908
- * @returns {Float}
909
- *
910
- * @example
911
- * ```
912
- * const {Spanner} = require('@google-cloud/spanner');
913
- * const float = Spanner.float(10);
914
- * ```
915
- */
916
- static float(value: any): Float;
917
- /**
918
- * Helper function to get a Cloud Spanner Int64 object.
919
- *
920
- * @param {string|number} value The int as a number or string.
921
- * @returns {Int}
922
- *
923
- * @example
924
- * ```
925
- * const {Spanner} = require('@google-cloud/spanner');
926
- * const int = Spanner.int(10);
927
- * ```
928
- */
929
- static int(value: any): Int;
930
- /**
931
- * Helper function to get a Cloud Spanner Numeric object.
932
- *
933
- * @param {string} value The numeric value as a string.
934
- * @returns {Numeric}
935
- *
936
- * @example
937
- * ```
938
- * const {Spanner} = require('@google-cloud/spanner');
939
- * const numeric = Spanner.numeric("3.141592653");
940
- * ```
941
- */
942
- static numeric(value: any): Numeric;
943
- /**
944
- * Helper function to get a Cloud Spanner pgNumeric object.
945
- *
946
- * @param {string} value The pgNumeric value as a string.
947
- * @returns {PGNumeric}
948
- *
949
- * @example
950
- * ```
951
- * const {Spanner} = require('@google-cloud/spanner');
952
- * const pgNumeric = Spanner.pgNumeric("3.141592653");
953
- * ```
954
- */
955
- static pgNumeric(value: any): PGNumeric;
956
- /**
957
- * Helper function to get a Cloud Spanner pgJsonb object.
958
- *
959
- * @param {object|string} value The pgJsonb value as a string or object.
960
- * @returns {PGJsonb}
961
- *
962
- * @example
963
- * ```
964
- * const {Spanner} = require('@google-cloud/spanner');
965
- * const pgJsonb1 = Spanner.pgJsonb({rating: 6});
966
- * const pgJsonb2 = Spanner.pgJsonb(`[
967
- * {
968
- * "name": null,
969
- * "open": true
970
- * }]`)
971
- * ```
972
- */
973
- static pgJsonb(value: any): PGJsonb;
974
- /**
975
- * @typedef IProtoMessageParams
976
- * @property {object} value Proto Message value as serialized-buffer or message object.
977
- * @property {string} fullName Fully-qualified path name of proto message.
978
- * @property {Function} [messageFunction] Function generated by protobufs containing
979
- * helper methods for deserializing and serializing messages.
980
- */
981
- /**
982
- * Helper function to get a Cloud Spanner proto Message object.
983
- *
984
- * @param {IProtoMessageParams} params The proto message value params
985
- * @returns {ProtoMessage}
986
- *
987
- * @example
988
- * ```
989
- * const {Spanner} = require('@google-cloud/spanner');
990
- * const protoMessage = Spanner.protoMessage({
991
- * value: singerInfo,
992
- * messageFunction: music.SingerInfo,
993
- * fullName: "examples.spanner.music.SingerInfo"
994
- * });
995
- * ```
996
- */
997
- static protoMessage(params: IProtoMessageParams): ProtoMessage;
998
- /**
999
- * @typedef IProtoEnumParams
1000
- * @property {string | number} value Proto Enum value as a string constant or
1001
- * an integer constant.
1002
- * @property {string} fullName Fully-qualified path name of proto enum.
1003
- * @property {object} [enumObject] An enum object generated by protobufjs-cli.
1004
- */
1005
- /**
1006
- * Helper function to get a Cloud Spanner proto enum object.
1007
- *
1008
- * @param {IProtoEnumParams} params The proto enum value params in the format of
1009
- * @code{IProtoEnumParams}
1010
- * @returns {ProtoEnum}
1011
- *
1012
- * @example
1013
- * ```
1014
- * const {Spanner} = require('@google-cloud/spanner');
1015
- * const protoEnum = Spanner.protoEnum({
1016
- * value: 'ROCK',
1017
- * enumObject: music.Genre,
1018
- * fullName: "examples.spanner.music.Genre"
1019
- * });
1020
- * ```
1021
- */
1022
- static protoEnum(params: IProtoEnumParams): ProtoEnum;
1023
- /**
1024
- * Helper function to get a Cloud Spanner Struct object.
1025
- *
1026
- * @param {object} value The struct as a JSON object.
1027
- * @returns {Struct}
1028
- *
1029
- * @example
1030
- * ```
1031
- * const {Spanner} = require('@google-cloud/spanner');
1032
- * const struct = Spanner.struct({
1033
- * user: 'bob',
1034
- * age: 32
1035
- * });
1036
- * ```
1037
- */
1038
- static struct(value?: any): Struct;
1039
- }
1040
- /**
1041
- * The default export of the `@google-cloud/spanner` package is the
1042
- * {@link Spanner} class.
1043
- *
1044
- * See {@link Spanner} and {@link ClientConfig} for client methods and
1045
- * configuration options.
1046
- *
1047
- * @module {constructor} @google-cloud/spanner
1048
- * @alias nodejs-spanner
1049
- *
1050
- * @example Install the client library with <a
1051
- * href="https://www.npmjs.com/">npm</a>:
1052
- * ```
1053
- * npm install --save @google-cloud/spanner
1054
- * ```
1055
- *
1056
- * @example Import the client library
1057
- * ```
1058
- * const {Spanner} = require('@google-cloud/spanner');
1059
- * ```
1060
- *
1061
- * @example Create a client that uses <a
1062
- * href="https://cloud.google.com/docs/authentication/production#providing_credentials_to_your_application">Application
1063
- * Default Credentials (ADC)</a>:
1064
- * ```
1065
- * const client = new Spanner();
1066
- * ```
1067
- *
1068
- * @example Create a client with <a
1069
- * href="https://cloud.google.com/docs/authentication/production#obtaining_and_providing_service_account_credentials_manually">explicit
1070
- * credentials</a>:
1071
- * ```
1072
- * const client = new Spanner({ projectId:
1073
- * 'your-project-id', keyFilename: '/path/to/keyfile.json'
1074
- * });
1075
- * ```
1076
- *
1077
- * @example <caption>include:samples/quickstart.js</caption>
1078
- * region_tag:spanner_quickstart
1079
- * Full quickstart example:
1080
- */
1081
- export { Spanner };
1082
- /**
1083
- * {@link Instance} class.
1084
- *
1085
- * @name Spanner.Instance
1086
- * @see Instance
1087
- * @type {Constructor}
1088
- */
1089
- export { Instance };
1090
- /**
1091
- * {@link InstanceConfig} class.
1092
- *
1093
- * @name Spanner.InstanceConfig
1094
- * @see InstanceConfig
1095
- * @type {Constructor}
1096
- */
1097
- export { InstanceConfig };
1098
- /**
1099
- * {@link Database} class.
1100
- *
1101
- * @name Spanner.Database
1102
- * @see Database
1103
- * @type {Constructor}
1104
- */
1105
- export { Database };
1106
- /**
1107
- * {@link Backup} class.
1108
- *
1109
- * @name Spanner.Backup
1110
- * @see Backup
1111
- * @type {Constructor}
1112
- */
1113
- export { Backup };
1114
- /**
1115
- * {@link Session} class.
1116
- *
1117
- * @name Spanner.Session
1118
- * @see Session
1119
- * @type {Constructor}
1120
- */
1121
- export { Session };
1122
- /**
1123
- * {@link SessionPool} class.
1124
- *
1125
- * @name Spanner.SessionPool
1126
- * @see SessionPool
1127
- * @type {Constructor}
1128
- */
1129
- export { SessionPool };
1130
- /**
1131
- * {@link Table} class.
1132
- *
1133
- * @name Spanner.Table
1134
- * @see Table
1135
- * @type {Constructor}
1136
- */
1137
- export { Table };
1138
- /**
1139
- * {@link PartitionedDml} class.
1140
- *
1141
- * @name Spanner.PartitionedDml
1142
- * @see PartitionedDml
1143
- * @type {Constructor}
1144
- */
1145
- export { PartitionedDml };
1146
- /**
1147
- * {@link Snapshot} class.
1148
- *
1149
- * @name Spanner.Snapshot
1150
- * @see Snapshot
1151
- * @type {Constructor}
1152
- */
1153
- export { Snapshot };
1154
- /**
1155
- * {@link Transaction} class.
1156
- *
1157
- * @name Spanner.Transaction
1158
- * @see Transaction
1159
- * @type {Constructor}
1160
- */
1161
- export { Transaction };
1162
- /**
1163
- * {@link MutationGroup} class.
1164
- *
1165
- * @name Spanner.MutationGroup
1166
- * @see MutationGroup
1167
- * @type {Constructor}
1168
- */
1169
- export { MutationGroup };
1170
- /**
1171
- * {@link MutationSet} class.
1172
- *
1173
- * @name Spanner.MutationSet
1174
- * @see MutationSet
1175
- * @type {Constructor}
1176
- */
1177
- export { MutationSet };
1178
- /**
1179
- * @type {object}
1180
- * @property {constructor} DatabaseAdminClient
1181
- * Reference to {@link v1.DatabaseAdminClient}
1182
- * @property {constructor} InstanceAdminClient
1183
- * Reference to {@link v1.InstanceAdminClient}
1184
- * @property {constructor} SpannerClient
1185
- * Reference to {@link v1.SpannerClient}
1186
- */
1187
- import * as protos from '../protos/protos';
1188
- import IInstanceConfig = instanceAdmin.spanner.admin.instance.v1.IInstanceConfig;
1189
- export { v1, protos };
1190
- declare const _default: {
1191
- Spanner: typeof Spanner;
1192
- };
1193
- export default _default;
1194
- export { Float32, Float, Int, Struct, Numeric, PGNumeric, SpannerDate };
1195
- export { ObservabilityOptions };