@google-cloud/spanner 8.2.0 → 8.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -1
- package/build/protos/google/spanner/v1/keys.proto +2 -2
- package/build/protos/google/spanner/v1/mutation.proto +31 -23
- package/build/protos/google/spanner/v1/query_plan.proto +21 -18
- package/build/protos/google/spanner/v1/spanner.proto +198 -204
- package/build/protos/google/spanner/v1/transaction.proto +3 -2
- package/build/protos/protos.json +3 -1
- package/build/src/index.d.ts +1 -0
- package/build/src/index.js +32 -12
- package/build/src/metrics/interceptor.js +10 -2
- package/build/src/metrics/metrics-tracer-factory.d.ts +2 -3
- package/build/src/metrics/metrics-tracer-factory.js +3 -5
- package/build/src/metrics/metrics-tracer.d.ts +2 -1
- package/build/src/metrics/metrics-tracer.js +4 -2
- package/build/src/metrics/spanner-metrics-exporter.d.ts +2 -1
- package/build/src/metrics/spanner-metrics-exporter.js +16 -23
- package/build/src/metrics/transform.d.ts +2 -2
- package/build/src/metrics/transform.js +7 -7
- package/build/src/v1/spanner_client.d.ts +155 -159
- package/build/src/v1/spanner_client.js +47 -52
- package/package.json +2 -2
|
@@ -130,14 +130,14 @@ export declare class SpannerClient {
|
|
|
130
130
|
* transaction internally, and count toward the one transaction
|
|
131
131
|
* limit.
|
|
132
132
|
*
|
|
133
|
-
* Active sessions use additional server resources, so it
|
|
133
|
+
* Active sessions use additional server resources, so it's a good idea to
|
|
134
134
|
* delete idle and unneeded sessions.
|
|
135
|
-
* Aside from explicit deletes, Cloud Spanner
|
|
135
|
+
* Aside from explicit deletes, Cloud Spanner can delete sessions when no
|
|
136
136
|
* operations are sent for more than an hour. If a session is deleted,
|
|
137
137
|
* requests to it return `NOT_FOUND`.
|
|
138
138
|
*
|
|
139
139
|
* Idle sessions can be kept alive by sending a trivial SQL query
|
|
140
|
-
* periodically,
|
|
140
|
+
* periodically, for example, `"SELECT 1"`.
|
|
141
141
|
*
|
|
142
142
|
* @param {Object} request
|
|
143
143
|
* The request object that will be sent.
|
|
@@ -170,12 +170,12 @@ export declare class SpannerClient {
|
|
|
170
170
|
* @param {string} request.database
|
|
171
171
|
* Required. The database in which the new sessions are created.
|
|
172
172
|
* @param {google.spanner.v1.Session} request.sessionTemplate
|
|
173
|
-
* Parameters to
|
|
173
|
+
* Parameters to apply to each created session.
|
|
174
174
|
* @param {number} request.sessionCount
|
|
175
175
|
* Required. The number of sessions to be created in this batch call.
|
|
176
|
-
* The API
|
|
176
|
+
* The API can return fewer than the requested number of sessions. If a
|
|
177
177
|
* specific number of sessions are desired, the client can make additional
|
|
178
|
-
* calls to BatchCreateSessions (adjusting
|
|
178
|
+
* calls to `BatchCreateSessions` (adjusting
|
|
179
179
|
* {@link protos.google.spanner.v1.BatchCreateSessionsRequest.session_count|session_count}
|
|
180
180
|
* as necessary).
|
|
181
181
|
* @param {object} [options]
|
|
@@ -193,7 +193,7 @@ export declare class SpannerClient {
|
|
|
193
193
|
batchCreateSessions(request: protos.google.spanner.v1.IBatchCreateSessionsRequest, options: CallOptions, callback: Callback<protos.google.spanner.v1.IBatchCreateSessionsResponse, protos.google.spanner.v1.IBatchCreateSessionsRequest | null | undefined, {} | null | undefined>): void;
|
|
194
194
|
batchCreateSessions(request: protos.google.spanner.v1.IBatchCreateSessionsRequest, callback: Callback<protos.google.spanner.v1.IBatchCreateSessionsResponse, protos.google.spanner.v1.IBatchCreateSessionsRequest | null | undefined, {} | null | undefined>): void;
|
|
195
195
|
/**
|
|
196
|
-
* Gets a session. Returns `NOT_FOUND` if the session
|
|
196
|
+
* Gets a session. Returns `NOT_FOUND` if the session doesn't exist.
|
|
197
197
|
* This is mainly useful for determining whether a session is still
|
|
198
198
|
* alive.
|
|
199
199
|
*
|
|
@@ -216,9 +216,9 @@ export declare class SpannerClient {
|
|
|
216
216
|
getSession(request: protos.google.spanner.v1.IGetSessionRequest, options: CallOptions, callback: Callback<protos.google.spanner.v1.ISession, protos.google.spanner.v1.IGetSessionRequest | null | undefined, {} | null | undefined>): void;
|
|
217
217
|
getSession(request: protos.google.spanner.v1.IGetSessionRequest, callback: Callback<protos.google.spanner.v1.ISession, protos.google.spanner.v1.IGetSessionRequest | null | undefined, {} | null | undefined>): void;
|
|
218
218
|
/**
|
|
219
|
-
* Ends a session, releasing server resources associated with it. This
|
|
220
|
-
* asynchronously
|
|
221
|
-
* this session.
|
|
219
|
+
* Ends a session, releasing server resources associated with it. This
|
|
220
|
+
* asynchronously triggers the cancellation of any operations that are running
|
|
221
|
+
* with this session.
|
|
222
222
|
*
|
|
223
223
|
* @param {Object} request
|
|
224
224
|
* The request object that will be sent.
|
|
@@ -240,7 +240,7 @@ export declare class SpannerClient {
|
|
|
240
240
|
deleteSession(request: protos.google.spanner.v1.IDeleteSessionRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.v1.IDeleteSessionRequest | null | undefined, {} | null | undefined>): void;
|
|
241
241
|
/**
|
|
242
242
|
* Executes an SQL statement, returning all results in a single reply. This
|
|
243
|
-
* method
|
|
243
|
+
* method can't be used to return a result set larger than 10 MiB;
|
|
244
244
|
* if the query yields more data than that, the query fails with
|
|
245
245
|
* a `FAILED_PRECONDITION` error.
|
|
246
246
|
*
|
|
@@ -253,6 +253,9 @@ export declare class SpannerClient {
|
|
|
253
253
|
* {@link protos.google.spanner.v1.Spanner.ExecuteStreamingSql|ExecuteStreamingSql}
|
|
254
254
|
* instead.
|
|
255
255
|
*
|
|
256
|
+
* The query string can be SQL or [Graph Query Language
|
|
257
|
+
* (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro).
|
|
258
|
+
*
|
|
256
259
|
* @param {Object} request
|
|
257
260
|
* The request object that will be sent.
|
|
258
261
|
* @param {string} request.session
|
|
@@ -264,7 +267,7 @@ export declare class SpannerClient {
|
|
|
264
267
|
* transaction with strong concurrency.
|
|
265
268
|
*
|
|
266
269
|
* Standard DML statements require a read-write transaction. To protect
|
|
267
|
-
* against replays, single-use transactions are not supported.
|
|
270
|
+
* against replays, single-use transactions are not supported. The caller
|
|
268
271
|
* must either supply an existing transaction ID or begin a new transaction.
|
|
269
272
|
*
|
|
270
273
|
* Partitioned DML requires an existing Partitioned DML transaction ID.
|
|
@@ -278,19 +281,19 @@ export declare class SpannerClient {
|
|
|
278
281
|
* to the naming requirements of identifiers as specified at
|
|
279
282
|
* https://cloud.google.com/spanner/docs/lexical#identifiers.
|
|
280
283
|
*
|
|
281
|
-
* Parameters can appear anywhere that a literal value is expected.
|
|
284
|
+
* Parameters can appear anywhere that a literal value is expected. The same
|
|
282
285
|
* parameter name can be used more than once, for example:
|
|
283
286
|
*
|
|
284
287
|
* `"WHERE id > @msg_id AND id < @msg_id + 100"`
|
|
285
288
|
*
|
|
286
|
-
* It
|
|
289
|
+
* It's an error to execute a SQL statement with unbound parameters.
|
|
287
290
|
* @param {number[]} request.paramTypes
|
|
288
|
-
* It
|
|
289
|
-
* from a JSON value.
|
|
291
|
+
* It isn't always possible for Cloud Spanner to infer the right SQL type
|
|
292
|
+
* from a JSON value. For example, values of type `BYTES` and values
|
|
290
293
|
* of type `STRING` both appear in
|
|
291
294
|
* {@link protos.google.spanner.v1.ExecuteSqlRequest.params|params} as JSON strings.
|
|
292
295
|
*
|
|
293
|
-
* In these cases,
|
|
296
|
+
* In these cases, you can use `param_types` to specify the exact
|
|
294
297
|
* SQL type for some or all of the SQL statement parameters. See the
|
|
295
298
|
* definition of {@link protos.google.spanner.v1.Type|Type} for more information
|
|
296
299
|
* about SQL types.
|
|
@@ -309,19 +312,19 @@ export declare class SpannerClient {
|
|
|
309
312
|
* be set to
|
|
310
313
|
* {@link protos.google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL|QueryMode.NORMAL}.
|
|
311
314
|
* @param {Buffer} request.partitionToken
|
|
312
|
-
* If present, results
|
|
313
|
-
* previously created using PartitionQuery
|
|
315
|
+
* If present, results are restricted to the specified partition
|
|
316
|
+
* previously created using `PartitionQuery`. There must be an exact
|
|
314
317
|
* match for the values of fields common to this message and the
|
|
315
|
-
* PartitionQueryRequest message used to create this partition_token
|
|
318
|
+
* `PartitionQueryRequest` message used to create this `partition_token`.
|
|
316
319
|
* @param {number} request.seqno
|
|
317
320
|
* A per-transaction sequence number used to identify this request. This field
|
|
318
321
|
* makes each request idempotent such that if the request is received multiple
|
|
319
|
-
* times, at most one
|
|
322
|
+
* times, at most one succeeds.
|
|
320
323
|
*
|
|
321
324
|
* The sequence number must be monotonically increasing within the
|
|
322
325
|
* transaction. If a request arrives for the first time with an out-of-order
|
|
323
|
-
* sequence number, the transaction
|
|
324
|
-
* handled requests
|
|
326
|
+
* sequence number, the transaction can be aborted. Replays of previously
|
|
327
|
+
* handled requests yield the same response as the first execution.
|
|
325
328
|
*
|
|
326
329
|
* Required for DML statements. Ignored for queries.
|
|
327
330
|
* @param {google.spanner.v1.ExecuteSqlRequest.QueryOptions} request.queryOptions
|
|
@@ -334,18 +337,18 @@ export declare class SpannerClient {
|
|
|
334
337
|
* If this is for a partitioned query and this field is set to `true`, the
|
|
335
338
|
* request is executed with Spanner Data Boost independent compute resources.
|
|
336
339
|
*
|
|
337
|
-
* If the field is set to `true` but the request
|
|
340
|
+
* If the field is set to `true` but the request doesn't set
|
|
338
341
|
* `partition_token`, the API returns an `INVALID_ARGUMENT` error.
|
|
339
342
|
* @param {boolean} [request.lastStatement]
|
|
340
|
-
* Optional. If set to true
|
|
341
|
-
*
|
|
342
|
-
*
|
|
343
|
-
* transaction (including reads and queries)
|
|
344
|
-
*
|
|
345
|
-
* For DML statements, setting this option
|
|
346
|
-
* be deferred until commit time (
|
|
347
|
-
* Given this, successful execution of a DML statement
|
|
348
|
-
* until a subsequent Commit call completes successfully.
|
|
343
|
+
* Optional. If set to `true`, this statement marks the end of the
|
|
344
|
+
* transaction. After this statement executes, you must commit or abort the
|
|
345
|
+
* transaction. Attempts to execute any other requests against this
|
|
346
|
+
* transaction (including reads and queries) are rejected.
|
|
347
|
+
*
|
|
348
|
+
* For DML statements, setting this option might cause some error reporting to
|
|
349
|
+
* be deferred until commit time (for example, validation of unique
|
|
350
|
+
* constraints). Given this, successful execution of a DML statement shouldn't
|
|
351
|
+
* be assumed until a subsequent `Commit` call completes successfully.
|
|
349
352
|
* @param {object} [options]
|
|
350
353
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
351
354
|
* @returns {Promise} - The promise which resolves to an array.
|
|
@@ -394,24 +397,24 @@ export declare class SpannerClient {
|
|
|
394
397
|
* @param {number} request.seqno
|
|
395
398
|
* Required. A per-transaction sequence number used to identify this request.
|
|
396
399
|
* This field makes each request idempotent such that if the request is
|
|
397
|
-
* received multiple times, at most one
|
|
400
|
+
* received multiple times, at most one succeeds.
|
|
398
401
|
*
|
|
399
402
|
* The sequence number must be monotonically increasing within the
|
|
400
403
|
* transaction. If a request arrives for the first time with an out-of-order
|
|
401
|
-
* sequence number, the transaction
|
|
402
|
-
* handled requests
|
|
404
|
+
* sequence number, the transaction might be aborted. Replays of previously
|
|
405
|
+
* handled requests yield the same response as the first execution.
|
|
403
406
|
* @param {google.spanner.v1.RequestOptions} request.requestOptions
|
|
404
407
|
* Common options for this request.
|
|
405
408
|
* @param {boolean} [request.lastStatements]
|
|
406
|
-
* Optional. If set to true
|
|
407
|
-
*
|
|
408
|
-
*
|
|
409
|
-
*
|
|
410
|
-
*
|
|
411
|
-
* Setting this option
|
|
412
|
-
* commit time (
|
|
413
|
-
* execution of statements
|
|
414
|
-
* call completes successfully.
|
|
409
|
+
* Optional. If set to `true`, this request marks the end of the transaction.
|
|
410
|
+
* After these statements execute, you must commit or abort the transaction.
|
|
411
|
+
* Attempts to execute any other requests against this transaction
|
|
412
|
+
* (including reads and queries) are rejected.
|
|
413
|
+
*
|
|
414
|
+
* Setting this option might cause some error reporting to be deferred until
|
|
415
|
+
* commit time (for example, validation of unique constraints). Given this,
|
|
416
|
+
* successful execution of statements shouldn't be assumed until a subsequent
|
|
417
|
+
* `Commit` call completes successfully.
|
|
415
418
|
* @param {object} [options]
|
|
416
419
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
417
420
|
* @returns {Promise} - The promise which resolves to an array.
|
|
@@ -429,7 +432,7 @@ export declare class SpannerClient {
|
|
|
429
432
|
/**
|
|
430
433
|
* Reads rows from the database using key lookups and scans, as a
|
|
431
434
|
* simple key/value style alternative to
|
|
432
|
-
* {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql}.
|
|
435
|
+
* {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql}. This method can't be
|
|
433
436
|
* used to return a result set larger than 10 MiB; if the read matches more
|
|
434
437
|
* data than that, the read fails with a `FAILED_PRECONDITION`
|
|
435
438
|
* error.
|
|
@@ -472,15 +475,15 @@ export declare class SpannerClient {
|
|
|
472
475
|
* If the {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token}
|
|
473
476
|
* field is empty, rows are yielded in table primary key order (if
|
|
474
477
|
* {@link protos.google.spanner.v1.ReadRequest.index|index} is empty) or index key order
|
|
475
|
-
* (if {@link protos.google.spanner.v1.ReadRequest.index|index} is non-empty).
|
|
476
|
-
* {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token} field
|
|
477
|
-
*
|
|
478
|
+
* (if {@link protos.google.spanner.v1.ReadRequest.index|index} is non-empty). If the
|
|
479
|
+
* {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token} field
|
|
480
|
+
* isn't empty, rows are yielded in an unspecified order.
|
|
478
481
|
*
|
|
479
|
-
* It
|
|
482
|
+
* It isn't an error for the `key_set` to name rows that don't
|
|
480
483
|
* exist in the database. Read yields nothing for nonexistent rows.
|
|
481
484
|
* @param {number} request.limit
|
|
482
485
|
* If greater than zero, only the first `limit` rows are yielded. If `limit`
|
|
483
|
-
* is zero, the default is no limit. A limit
|
|
486
|
+
* is zero, the default is no limit. A limit can't be specified if
|
|
484
487
|
* `partition_token` is set.
|
|
485
488
|
* @param {Buffer} request.resumeToken
|
|
486
489
|
* If this request is resuming a previously interrupted read,
|
|
@@ -490,8 +493,8 @@ export declare class SpannerClient {
|
|
|
490
493
|
* left off. The rest of the request parameters must exactly match the request
|
|
491
494
|
* that yielded this token.
|
|
492
495
|
* @param {Buffer} request.partitionToken
|
|
493
|
-
* If present, results
|
|
494
|
-
* previously created using PartitionRead
|
|
496
|
+
* If present, results are restricted to the specified partition
|
|
497
|
+
* previously created using `PartitionRead`. There must be an exact
|
|
495
498
|
* match for the values of fields common to this message and the
|
|
496
499
|
* PartitionReadRequest message used to create this partition_token.
|
|
497
500
|
* @param {google.spanner.v1.RequestOptions} request.requestOptions
|
|
@@ -502,16 +505,17 @@ export declare class SpannerClient {
|
|
|
502
505
|
* If this is for a partitioned read and this field is set to `true`, the
|
|
503
506
|
* request is executed with Spanner Data Boost independent compute resources.
|
|
504
507
|
*
|
|
505
|
-
* If the field is set to `true` but the request
|
|
508
|
+
* If the field is set to `true` but the request doesn't set
|
|
506
509
|
* `partition_token`, the API returns an `INVALID_ARGUMENT` error.
|
|
507
510
|
* @param {google.spanner.v1.ReadRequest.OrderBy} [request.orderBy]
|
|
508
511
|
* Optional. Order for the returned rows.
|
|
509
512
|
*
|
|
510
|
-
* By default, Spanner
|
|
511
|
-
* PartitionRead requests. For applications that
|
|
513
|
+
* By default, Spanner returns result rows in primary key order except for
|
|
514
|
+
* PartitionRead requests. For applications that don't require rows to be
|
|
512
515
|
* returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting
|
|
513
516
|
* `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval,
|
|
514
|
-
* resulting in lower latencies in certain cases (
|
|
517
|
+
* resulting in lower latencies in certain cases (for example, bulk point
|
|
518
|
+
* lookups).
|
|
515
519
|
* @param {google.spanner.v1.ReadRequest.LockHint} [request.lockHint]
|
|
516
520
|
* Optional. Lock Hint for the request, it can only be used with read-write
|
|
517
521
|
* transactions.
|
|
@@ -545,16 +549,14 @@ export declare class SpannerClient {
|
|
|
545
549
|
* @param {google.spanner.v1.RequestOptions} request.requestOptions
|
|
546
550
|
* Common options for this request.
|
|
547
551
|
* Priority is ignored for this request. Setting the priority in this
|
|
548
|
-
* request_options struct
|
|
552
|
+
* `request_options` struct doesn't do anything. To set the priority for a
|
|
549
553
|
* transaction, set it on the reads and writes that are part of this
|
|
550
554
|
* transaction instead.
|
|
551
555
|
* @param {google.spanner.v1.Mutation} [request.mutationKey]
|
|
552
556
|
* Optional. Required for read-write transactions on a multiplexed session
|
|
553
|
-
* that commit mutations but
|
|
554
|
-
*
|
|
555
|
-
*
|
|
556
|
-
* This feature is not yet supported and will result in an UNIMPLEMENTED
|
|
557
|
-
* error.
|
|
557
|
+
* that commit mutations but don't perform any reads or queries. You must
|
|
558
|
+
* randomly select one of the mutations from the mutation set and send it as a
|
|
559
|
+
* part of this request.
|
|
558
560
|
* @param {object} [options]
|
|
559
561
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
560
562
|
* @returns {Promise} - The promise which resolves to an array.
|
|
@@ -576,8 +578,8 @@ export declare class SpannerClient {
|
|
|
576
578
|
* `Commit` might return an `ABORTED` error. This can occur at any time;
|
|
577
579
|
* commonly, the cause is conflicts with concurrent
|
|
578
580
|
* transactions. However, it can also happen for a variety of other
|
|
579
|
-
* reasons. If `Commit` returns `ABORTED`, the caller should
|
|
580
|
-
* the transaction from the beginning,
|
|
581
|
+
* reasons. If `Commit` returns `ABORTED`, the caller should retry
|
|
582
|
+
* the transaction from the beginning, reusing the same session.
|
|
581
583
|
*
|
|
582
584
|
* On very rare occasions, `Commit` might return `UNKNOWN`. This can happen,
|
|
583
585
|
* for example, if the client job experiences a 1+ hour networking failure.
|
|
@@ -597,7 +599,7 @@ export declare class SpannerClient {
|
|
|
597
599
|
* temporary transaction is non-idempotent. That is, if the
|
|
598
600
|
* `CommitRequest` is sent to Cloud Spanner more than once (for
|
|
599
601
|
* instance, due to retries in the application, or in the
|
|
600
|
-
* transport library), it
|
|
602
|
+
* transport library), it's possible that the mutations are
|
|
601
603
|
* executed more than once. If this is undesirable, use
|
|
602
604
|
* {@link protos.google.spanner.v1.Spanner.BeginTransaction|BeginTransaction} and
|
|
603
605
|
* {@link protos.google.spanner.v1.Spanner.Commit|Commit} instead.
|
|
@@ -606,24 +608,22 @@ export declare class SpannerClient {
|
|
|
606
608
|
* mutations are applied atomically, in the order they appear in
|
|
607
609
|
* this list.
|
|
608
610
|
* @param {boolean} request.returnCommitStats
|
|
609
|
-
* If `true`, then statistics related to the transaction
|
|
611
|
+
* If `true`, then statistics related to the transaction is included in
|
|
610
612
|
* the {@link protos.google.spanner.v1.CommitResponse.commit_stats|CommitResponse}.
|
|
611
613
|
* Default value is `false`.
|
|
612
614
|
* @param {google.protobuf.Duration} [request.maxCommitDelay]
|
|
613
|
-
* Optional. The amount of latency this request is
|
|
614
|
-
* to improve throughput. If this field
|
|
615
|
-
* are relatively latency sensitive and automatically determines an
|
|
616
|
-
* appropriate delay time. You can specify a
|
|
617
|
-
*
|
|
615
|
+
* Optional. The amount of latency this request is configured to incur in
|
|
616
|
+
* order to improve throughput. If this field isn't set, Spanner assumes
|
|
617
|
+
* requests are relatively latency sensitive and automatically determines an
|
|
618
|
+
* appropriate delay time. You can specify a commit delay value between 0 and
|
|
619
|
+
* 500 ms.
|
|
618
620
|
* @param {google.spanner.v1.RequestOptions} request.requestOptions
|
|
619
621
|
* Common options for this request.
|
|
620
622
|
* @param {google.spanner.v1.MultiplexedSessionPrecommitToken} [request.precommitToken]
|
|
621
623
|
* Optional. If the read-write transaction was executed on a multiplexed
|
|
622
|
-
* session, the precommit token with the highest
|
|
623
|
-
*
|
|
624
|
-
*
|
|
625
|
-
* This feature is not yet supported and will result in an UNIMPLEMENTED
|
|
626
|
-
* error.
|
|
624
|
+
* session, then you must include the precommit token with the highest
|
|
625
|
+
* sequence number received in this transaction attempt. Failing to do so
|
|
626
|
+
* results in a `FailedPrecondition` error.
|
|
627
627
|
* @param {object} [options]
|
|
628
628
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
629
629
|
* @returns {Promise} - The promise which resolves to an array.
|
|
@@ -639,14 +639,14 @@ export declare class SpannerClient {
|
|
|
639
639
|
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;
|
|
640
640
|
commit(request: protos.google.spanner.v1.ICommitRequest, callback: Callback<protos.google.spanner.v1.ICommitResponse, protos.google.spanner.v1.ICommitRequest | null | undefined, {} | null | undefined>): void;
|
|
641
641
|
/**
|
|
642
|
-
* Rolls back a transaction, releasing any locks it holds. It
|
|
642
|
+
* Rolls back a transaction, releasing any locks it holds. It's a good
|
|
643
643
|
* idea to call this for any transaction that includes one or more
|
|
644
644
|
* {@link protos.google.spanner.v1.Spanner.Read|Read} or
|
|
645
645
|
* {@link protos.google.spanner.v1.Spanner.ExecuteSql|ExecuteSql} requests and ultimately
|
|
646
646
|
* decides not to commit.
|
|
647
647
|
*
|
|
648
648
|
* `Rollback` returns `OK` if it successfully aborts the transaction, the
|
|
649
|
-
* transaction was already aborted, or the transaction
|
|
649
|
+
* transaction was already aborted, or the transaction isn't
|
|
650
650
|
* found. `Rollback` never returns `ABORTED`.
|
|
651
651
|
*
|
|
652
652
|
* @param {Object} request
|
|
@@ -671,16 +671,16 @@ export declare class SpannerClient {
|
|
|
671
671
|
rollback(request: protos.google.spanner.v1.IRollbackRequest, callback: Callback<protos.google.protobuf.IEmpty, protos.google.spanner.v1.IRollbackRequest | null | undefined, {} | null | undefined>): void;
|
|
672
672
|
/**
|
|
673
673
|
* Creates a set of partition tokens that can be used to execute a query
|
|
674
|
-
* operation in parallel.
|
|
674
|
+
* operation in parallel. Each of the returned partition tokens can be used
|
|
675
675
|
* by {@link protos.google.spanner.v1.Spanner.ExecuteStreamingSql|ExecuteStreamingSql} to
|
|
676
|
-
* specify a subset of the query result to read.
|
|
677
|
-
* read-only transaction must be used by the PartitionQueryRequest used to
|
|
678
|
-
* create the partition tokens and the ExecuteSqlRequests that use the
|
|
676
|
+
* specify a subset of the query result to read. The same session and
|
|
677
|
+
* read-only transaction must be used by the `PartitionQueryRequest` used to
|
|
678
|
+
* create the partition tokens and the `ExecuteSqlRequests` that use the
|
|
679
679
|
* partition tokens.
|
|
680
680
|
*
|
|
681
681
|
* Partition tokens become invalid when the session used to create them
|
|
682
682
|
* is deleted, is idle for too long, begins a new transaction, or becomes too
|
|
683
|
-
* old.
|
|
683
|
+
* old. When any of these happen, it isn't possible to resume the query, and
|
|
684
684
|
* the whole operation must be restarted from the beginning.
|
|
685
685
|
*
|
|
686
686
|
* @param {Object} request
|
|
@@ -688,21 +688,22 @@ export declare class SpannerClient {
|
|
|
688
688
|
* @param {string} request.session
|
|
689
689
|
* Required. The session used to create the partitions.
|
|
690
690
|
* @param {google.spanner.v1.TransactionSelector} request.transaction
|
|
691
|
-
* Read
|
|
692
|
-
* transactions are not.
|
|
691
|
+
* Read-only snapshot transactions are supported, read and write and
|
|
692
|
+
* single-use transactions are not.
|
|
693
693
|
* @param {string} request.sql
|
|
694
|
-
* Required. The query request to generate partitions for. The request
|
|
695
|
-
*
|
|
694
|
+
* Required. The query request to generate partitions for. The request fails
|
|
695
|
+
* if the query isn't root partitionable. For a query to be root
|
|
696
696
|
* partitionable, it needs to satisfy a few conditions. For example, if the
|
|
697
697
|
* query execution plan contains a distributed union operator, then it must be
|
|
698
698
|
* the first operator in the plan. For more information about other
|
|
699
699
|
* conditions, see [Read data in
|
|
700
700
|
* parallel](https://cloud.google.com/spanner/docs/reads#read_data_in_parallel).
|
|
701
701
|
*
|
|
702
|
-
* The query request must not contain DML commands, such as INSERT
|
|
703
|
-
* DELETE
|
|
704
|
-
* {@link protos.google.spanner.v1.Spanner.ExecuteStreamingSql
|
|
705
|
-
* PartitionedDml transaction for large, partition-friendly DML
|
|
702
|
+
* The query request must not contain DML commands, such as `INSERT`,
|
|
703
|
+
* `UPDATE`, or `DELETE`. Use
|
|
704
|
+
* {@link protos.google.spanner.v1.Spanner.ExecuteStreamingSql|`ExecuteStreamingSql`} with
|
|
705
|
+
* a `PartitionedDml` transaction for large, partition-friendly DML
|
|
706
|
+
* operations.
|
|
706
707
|
* @param {google.protobuf.Struct} request.params
|
|
707
708
|
* Parameter names and values that bind to placeholders in the SQL string.
|
|
708
709
|
*
|
|
@@ -710,15 +711,15 @@ export declare class SpannerClient {
|
|
|
710
711
|
* parameter name (for example, `@firstName`). Parameter names can contain
|
|
711
712
|
* letters, numbers, and underscores.
|
|
712
713
|
*
|
|
713
|
-
* Parameters can appear anywhere that a literal value is expected.
|
|
714
|
+
* Parameters can appear anywhere that a literal value is expected. The same
|
|
714
715
|
* parameter name can be used more than once, for example:
|
|
715
716
|
*
|
|
716
717
|
* `"WHERE id > @msg_id AND id < @msg_id + 100"`
|
|
717
718
|
*
|
|
718
|
-
* It
|
|
719
|
+
* It's an error to execute a SQL statement with unbound parameters.
|
|
719
720
|
* @param {number[]} request.paramTypes
|
|
720
|
-
* It
|
|
721
|
-
* from a JSON value.
|
|
721
|
+
* It isn't always possible for Cloud Spanner to infer the right SQL type
|
|
722
|
+
* from a JSON value. For example, values of type `BYTES` and values
|
|
722
723
|
* of type `STRING` both appear in
|
|
723
724
|
* {@link protos.google.spanner.v1.PartitionQueryRequest.params|params} as JSON strings.
|
|
724
725
|
*
|
|
@@ -744,18 +745,18 @@ export declare class SpannerClient {
|
|
|
744
745
|
partitionQuery(request: protos.google.spanner.v1.IPartitionQueryRequest, callback: Callback<protos.google.spanner.v1.IPartitionResponse, protos.google.spanner.v1.IPartitionQueryRequest | null | undefined, {} | null | undefined>): void;
|
|
745
746
|
/**
|
|
746
747
|
* Creates a set of partition tokens that can be used to execute a read
|
|
747
|
-
* operation in parallel.
|
|
748
|
+
* operation in parallel. Each of the returned partition tokens can be used
|
|
748
749
|
* by {@link protos.google.spanner.v1.Spanner.StreamingRead|StreamingRead} to specify a
|
|
749
|
-
* subset of the read result to read.
|
|
750
|
-
* transaction must be used by the PartitionReadRequest used to create the
|
|
751
|
-
* partition tokens and the ReadRequests that use the partition tokens.
|
|
752
|
-
* are no ordering guarantees on rows returned among the returned
|
|
753
|
-
* tokens, or even within each individual StreamingRead call
|
|
754
|
-
* partition_token
|
|
750
|
+
* subset of the read result to read. The same session and read-only
|
|
751
|
+
* transaction must be used by the `PartitionReadRequest` used to create the
|
|
752
|
+
* partition tokens and the `ReadRequests` that use the partition tokens.
|
|
753
|
+
* There are no ordering guarantees on rows returned among the returned
|
|
754
|
+
* partition tokens, or even within each individual `StreamingRead` call
|
|
755
|
+
* issued with a `partition_token`.
|
|
755
756
|
*
|
|
756
757
|
* Partition tokens become invalid when the session used to create them
|
|
757
758
|
* is deleted, is idle for too long, begins a new transaction, or becomes too
|
|
758
|
-
* old.
|
|
759
|
+
* old. When any of these happen, it isn't possible to resume the read, and
|
|
759
760
|
* the whole operation must be restarted from the beginning.
|
|
760
761
|
*
|
|
761
762
|
* @param {Object} request
|
|
@@ -786,7 +787,7 @@ export declare class SpannerClient {
|
|
|
786
787
|
* {@link protos.google.spanner.v1.PartitionReadRequest.key_set|key_set} instead names
|
|
787
788
|
* index keys in {@link protos.google.spanner.v1.PartitionReadRequest.index|index}.
|
|
788
789
|
*
|
|
789
|
-
* It
|
|
790
|
+
* It isn't an error for the `key_set` to name rows that don't
|
|
790
791
|
* exist in the database. Read yields nothing for nonexistent rows.
|
|
791
792
|
* @param {google.spanner.v1.PartitionOptions} request.partitionOptions
|
|
792
793
|
* Additional options that affect how many partitions are created.
|
|
@@ -811,6 +812,9 @@ export declare class SpannerClient {
|
|
|
811
812
|
* the size of the returned result set. However, no individual row in the
|
|
812
813
|
* result set can exceed 100 MiB, and no column value can exceed 10 MiB.
|
|
813
814
|
*
|
|
815
|
+
* The query string can be SQL or [Graph Query Language
|
|
816
|
+
* (GQL)](https://cloud.google.com/spanner/docs/reference/standard-sql/graph-intro).
|
|
817
|
+
*
|
|
814
818
|
* @param {Object} request
|
|
815
819
|
* The request object that will be sent.
|
|
816
820
|
* @param {string} request.session
|
|
@@ -822,7 +826,7 @@ export declare class SpannerClient {
|
|
|
822
826
|
* transaction with strong concurrency.
|
|
823
827
|
*
|
|
824
828
|
* Standard DML statements require a read-write transaction. To protect
|
|
825
|
-
* against replays, single-use transactions are not supported.
|
|
829
|
+
* against replays, single-use transactions are not supported. The caller
|
|
826
830
|
* must either supply an existing transaction ID or begin a new transaction.
|
|
827
831
|
*
|
|
828
832
|
* Partitioned DML requires an existing Partitioned DML transaction ID.
|
|
@@ -836,19 +840,19 @@ export declare class SpannerClient {
|
|
|
836
840
|
* to the naming requirements of identifiers as specified at
|
|
837
841
|
* https://cloud.google.com/spanner/docs/lexical#identifiers.
|
|
838
842
|
*
|
|
839
|
-
* Parameters can appear anywhere that a literal value is expected.
|
|
843
|
+
* Parameters can appear anywhere that a literal value is expected. The same
|
|
840
844
|
* parameter name can be used more than once, for example:
|
|
841
845
|
*
|
|
842
846
|
* `"WHERE id > @msg_id AND id < @msg_id + 100"`
|
|
843
847
|
*
|
|
844
|
-
* It
|
|
848
|
+
* It's an error to execute a SQL statement with unbound parameters.
|
|
845
849
|
* @param {number[]} request.paramTypes
|
|
846
|
-
* It
|
|
847
|
-
* from a JSON value.
|
|
850
|
+
* It isn't always possible for Cloud Spanner to infer the right SQL type
|
|
851
|
+
* from a JSON value. For example, values of type `BYTES` and values
|
|
848
852
|
* of type `STRING` both appear in
|
|
849
853
|
* {@link protos.google.spanner.v1.ExecuteSqlRequest.params|params} as JSON strings.
|
|
850
854
|
*
|
|
851
|
-
* In these cases,
|
|
855
|
+
* In these cases, you can use `param_types` to specify the exact
|
|
852
856
|
* SQL type for some or all of the SQL statement parameters. See the
|
|
853
857
|
* definition of {@link protos.google.spanner.v1.Type|Type} for more information
|
|
854
858
|
* about SQL types.
|
|
@@ -867,19 +871,19 @@ export declare class SpannerClient {
|
|
|
867
871
|
* be set to
|
|
868
872
|
* {@link protos.google.spanner.v1.ExecuteSqlRequest.QueryMode.NORMAL|QueryMode.NORMAL}.
|
|
869
873
|
* @param {Buffer} request.partitionToken
|
|
870
|
-
* If present, results
|
|
871
|
-
* previously created using PartitionQuery
|
|
874
|
+
* If present, results are restricted to the specified partition
|
|
875
|
+
* previously created using `PartitionQuery`. There must be an exact
|
|
872
876
|
* match for the values of fields common to this message and the
|
|
873
|
-
* PartitionQueryRequest message used to create this partition_token
|
|
877
|
+
* `PartitionQueryRequest` message used to create this `partition_token`.
|
|
874
878
|
* @param {number} request.seqno
|
|
875
879
|
* A per-transaction sequence number used to identify this request. This field
|
|
876
880
|
* makes each request idempotent such that if the request is received multiple
|
|
877
|
-
* times, at most one
|
|
881
|
+
* times, at most one succeeds.
|
|
878
882
|
*
|
|
879
883
|
* The sequence number must be monotonically increasing within the
|
|
880
884
|
* transaction. If a request arrives for the first time with an out-of-order
|
|
881
|
-
* sequence number, the transaction
|
|
882
|
-
* handled requests
|
|
885
|
+
* sequence number, the transaction can be aborted. Replays of previously
|
|
886
|
+
* handled requests yield the same response as the first execution.
|
|
883
887
|
*
|
|
884
888
|
* Required for DML statements. Ignored for queries.
|
|
885
889
|
* @param {google.spanner.v1.ExecuteSqlRequest.QueryOptions} request.queryOptions
|
|
@@ -892,18 +896,18 @@ export declare class SpannerClient {
|
|
|
892
896
|
* If this is for a partitioned query and this field is set to `true`, the
|
|
893
897
|
* request is executed with Spanner Data Boost independent compute resources.
|
|
894
898
|
*
|
|
895
|
-
* If the field is set to `true` but the request
|
|
899
|
+
* If the field is set to `true` but the request doesn't set
|
|
896
900
|
* `partition_token`, the API returns an `INVALID_ARGUMENT` error.
|
|
897
901
|
* @param {boolean} [request.lastStatement]
|
|
898
|
-
* Optional. If set to true
|
|
899
|
-
*
|
|
900
|
-
*
|
|
901
|
-
* transaction (including reads and queries)
|
|
902
|
-
*
|
|
903
|
-
* For DML statements, setting this option
|
|
904
|
-
* be deferred until commit time (
|
|
905
|
-
* Given this, successful execution of a DML statement
|
|
906
|
-
* until a subsequent Commit call completes successfully.
|
|
902
|
+
* Optional. If set to `true`, this statement marks the end of the
|
|
903
|
+
* transaction. After this statement executes, you must commit or abort the
|
|
904
|
+
* transaction. Attempts to execute any other requests against this
|
|
905
|
+
* transaction (including reads and queries) are rejected.
|
|
906
|
+
*
|
|
907
|
+
* For DML statements, setting this option might cause some error reporting to
|
|
908
|
+
* be deferred until commit time (for example, validation of unique
|
|
909
|
+
* constraints). Given this, successful execution of a DML statement shouldn't
|
|
910
|
+
* be assumed until a subsequent `Commit` call completes successfully.
|
|
907
911
|
* @param {object} [options]
|
|
908
912
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
909
913
|
* @returns {Stream}
|
|
@@ -949,15 +953,15 @@ export declare class SpannerClient {
|
|
|
949
953
|
* If the {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token}
|
|
950
954
|
* field is empty, rows are yielded in table primary key order (if
|
|
951
955
|
* {@link protos.google.spanner.v1.ReadRequest.index|index} is empty) or index key order
|
|
952
|
-
* (if {@link protos.google.spanner.v1.ReadRequest.index|index} is non-empty).
|
|
953
|
-
* {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token} field
|
|
954
|
-
*
|
|
956
|
+
* (if {@link protos.google.spanner.v1.ReadRequest.index|index} is non-empty). If the
|
|
957
|
+
* {@link protos.google.spanner.v1.ReadRequest.partition_token|partition_token} field
|
|
958
|
+
* isn't empty, rows are yielded in an unspecified order.
|
|
955
959
|
*
|
|
956
|
-
* It
|
|
960
|
+
* It isn't an error for the `key_set` to name rows that don't
|
|
957
961
|
* exist in the database. Read yields nothing for nonexistent rows.
|
|
958
962
|
* @param {number} request.limit
|
|
959
963
|
* If greater than zero, only the first `limit` rows are yielded. If `limit`
|
|
960
|
-
* is zero, the default is no limit. A limit
|
|
964
|
+
* is zero, the default is no limit. A limit can't be specified if
|
|
961
965
|
* `partition_token` is set.
|
|
962
966
|
* @param {Buffer} request.resumeToken
|
|
963
967
|
* If this request is resuming a previously interrupted read,
|
|
@@ -967,8 +971,8 @@ export declare class SpannerClient {
|
|
|
967
971
|
* left off. The rest of the request parameters must exactly match the request
|
|
968
972
|
* that yielded this token.
|
|
969
973
|
* @param {Buffer} request.partitionToken
|
|
970
|
-
* If present, results
|
|
971
|
-
* previously created using PartitionRead
|
|
974
|
+
* If present, results are restricted to the specified partition
|
|
975
|
+
* previously created using `PartitionRead`. There must be an exact
|
|
972
976
|
* match for the values of fields common to this message and the
|
|
973
977
|
* PartitionReadRequest message used to create this partition_token.
|
|
974
978
|
* @param {google.spanner.v1.RequestOptions} request.requestOptions
|
|
@@ -979,16 +983,17 @@ export declare class SpannerClient {
|
|
|
979
983
|
* If this is for a partitioned read and this field is set to `true`, the
|
|
980
984
|
* request is executed with Spanner Data Boost independent compute resources.
|
|
981
985
|
*
|
|
982
|
-
* If the field is set to `true` but the request
|
|
986
|
+
* If the field is set to `true` but the request doesn't set
|
|
983
987
|
* `partition_token`, the API returns an `INVALID_ARGUMENT` error.
|
|
984
988
|
* @param {google.spanner.v1.ReadRequest.OrderBy} [request.orderBy]
|
|
985
989
|
* Optional. Order for the returned rows.
|
|
986
990
|
*
|
|
987
|
-
* By default, Spanner
|
|
988
|
-
* PartitionRead requests. For applications that
|
|
991
|
+
* By default, Spanner returns result rows in primary key order except for
|
|
992
|
+
* PartitionRead requests. For applications that don't require rows to be
|
|
989
993
|
* returned in primary key (`ORDER_BY_PRIMARY_KEY`) order, setting
|
|
990
994
|
* `ORDER_BY_NO_ORDER` option allows Spanner to optimize row retrieval,
|
|
991
|
-
* resulting in lower latencies in certain cases (
|
|
995
|
+
* resulting in lower latencies in certain cases (for example, bulk point
|
|
996
|
+
* lookups).
|
|
992
997
|
* @param {google.spanner.v1.ReadRequest.LockHint} [request.lockHint]
|
|
993
998
|
* Optional. Lock Hint for the request, it can only be used with read-write
|
|
994
999
|
* transactions.
|
|
@@ -1005,15 +1010,15 @@ export declare class SpannerClient {
|
|
|
1005
1010
|
* transactions. All mutations in a group are committed atomically. However,
|
|
1006
1011
|
* mutations across groups can be committed non-atomically in an unspecified
|
|
1007
1012
|
* order and thus, they must be independent of each other. Partial failure is
|
|
1008
|
-
* possible,
|
|
1009
|
-
* some
|
|
1010
|
-
* the response as the batches are applied.
|
|
1011
|
-
*
|
|
1012
|
-
* BatchWrite requests are not replay protected, meaning that each mutation
|
|
1013
|
-
* group
|
|
1014
|
-
*
|
|
1015
|
-
*
|
|
1016
|
-
* timestamp-based keys, it
|
|
1013
|
+
* possible, that is, some groups might have been committed successfully,
|
|
1014
|
+
* while some might have failed. The results of individual batches are
|
|
1015
|
+
* streamed into the response as the batches are applied.
|
|
1016
|
+
*
|
|
1017
|
+
* `BatchWrite` requests are not replay protected, meaning that each mutation
|
|
1018
|
+
* group can be applied more than once. Replays of non-idempotent mutations
|
|
1019
|
+
* can have undesirable effects. For example, replays of an insert mutation
|
|
1020
|
+
* can produce an already exists error or if you use generated or commit
|
|
1021
|
+
* timestamp-based keys, it can result in additional rows being added to the
|
|
1017
1022
|
* mutation's table. We recommend structuring your mutation groups to be
|
|
1018
1023
|
* idempotent to avoid this issue.
|
|
1019
1024
|
*
|
|
@@ -1026,18 +1031,9 @@ export declare class SpannerClient {
|
|
|
1026
1031
|
* @param {number[]} request.mutationGroups
|
|
1027
1032
|
* Required. The groups of mutations to be applied.
|
|
1028
1033
|
* @param {boolean} [request.excludeTxnFromChangeStreams]
|
|
1029
|
-
* Optional.
|
|
1030
|
-
*
|
|
1031
|
-
*
|
|
1032
|
-
* that are tracking columns modified by these transactions.
|
|
1033
|
-
* * Mutations from all transactions in this batch write operation will be
|
|
1034
|
-
* recorded in change streams with DDL option `allow_txn_exclusion=false or
|
|
1035
|
-
* not set` that are tracking columns modified by these transactions.
|
|
1036
|
-
*
|
|
1037
|
-
* When `exclude_txn_from_change_streams` is set to `false` or not set,
|
|
1038
|
-
* mutations from all transactions in this batch write operation will be
|
|
1039
|
-
* recorded in all change streams that are tracking columns modified by these
|
|
1040
|
-
* transactions.
|
|
1034
|
+
* Optional. If you don't set the `exclude_txn_from_change_streams` option or
|
|
1035
|
+
* if it's set to `false`, then any change streams monitoring columns modified
|
|
1036
|
+
* by transactions will capture the updates made within that transaction.
|
|
1041
1037
|
* @param {object} [options]
|
|
1042
1038
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
1043
1039
|
* @returns {Stream}
|