@google-cloud/spanner 7.3.0 → 7.4.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.
- package/CHANGELOG.md +15 -0
- package/build/protos/google/spanner/v1/spanner.proto +29 -5
- package/build/protos/google/spanner/v1/transaction.proto +17 -1
- package/build/protos/protos.d.ts +18 -0
- package/build/protos/protos.js +70 -0
- package/build/protos/protos.json +18 -0
- package/build/src/codec.d.ts +10 -0
- package/build/src/codec.js +34 -4
- package/build/src/partial-result-stream.d.ts +1 -1
- package/build/src/partial-result-stream.js +4 -3
- package/build/src/transaction.js +4 -1
- package/build/src/v1/spanner_client.d.ts +13 -0
- package/build/src/v1/spanner_client.js +13 -0
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,21 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/nodejs-spanner?activeTab=versions
|
|
6
6
|
|
|
7
|
+
## [7.4.0](https://github.com/googleapis/nodejs-spanner/compare/v7.3.0...v7.4.0) (2024-02-23)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Features
|
|
11
|
+
|
|
12
|
+
* **spanner:** Add PG.OID support ([#1948](https://github.com/googleapis/nodejs-spanner/issues/1948)) ([cf9df7a](https://github.com/googleapis/nodejs-spanner/commit/cf9df7a54c21ac995bbea9ad82c3544e4aff41b6))
|
|
13
|
+
* Untyped param types ([#1869](https://github.com/googleapis/nodejs-spanner/issues/1869)) ([6ef44c3](https://github.com/googleapis/nodejs-spanner/commit/6ef44c383a90bf6ae95de531c83e21d2d58da159))
|
|
14
|
+
* Update TransactionOptions to include new option exclude_txn_from_change_streams ([#1998](https://github.com/googleapis/nodejs-spanner/issues/1998)) ([937a7a1](https://github.com/googleapis/nodejs-spanner/commit/937a7a13f8c7660e21d34ebbaecad426b2bacd99))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **deps:** Update dependency google-gax to v4.3.1 ([#1995](https://github.com/googleapis/nodejs-spanner/issues/1995)) ([bed4832](https://github.com/googleapis/nodejs-spanner/commit/bed4832445e72c7116fe5495c79d989664220b38))
|
|
20
|
+
* Only reset pending value with resume token ([#2000](https://github.com/googleapis/nodejs-spanner/issues/2000)) ([f337089](https://github.com/googleapis/nodejs-spanner/commit/f337089567d7d92c9467e311be7d72b0a7dc8047)), closes [#1959](https://github.com/googleapis/nodejs-spanner/issues/1959)
|
|
21
|
+
|
|
7
22
|
## [7.3.0](https://github.com/googleapis/nodejs-spanner/compare/v7.2.0...v7.3.0) (2024-02-08)
|
|
8
23
|
|
|
9
24
|
|
|
@@ -402,6 +402,15 @@ message Session {
|
|
|
402
402
|
|
|
403
403
|
// The database role which created this session.
|
|
404
404
|
string creator_role = 5;
|
|
405
|
+
|
|
406
|
+
// Optional. If true, specifies a multiplexed session. A multiplexed session
|
|
407
|
+
// may be used for multiple, concurrent read-only operations but can not be
|
|
408
|
+
// used for read-write transactions, partitioned reads, or partitioned
|
|
409
|
+
// queries. Multiplexed sessions can be created via
|
|
410
|
+
// [CreateSession][google.spanner.v1.Spanner.CreateSession] but not via
|
|
411
|
+
// [BatchCreateSessions][google.spanner.v1.Spanner.BatchCreateSessions].
|
|
412
|
+
// Multiplexed sessions may not be deleted nor listed.
|
|
413
|
+
bool multiplexed = 6 [(google.api.field_behavior) = OPTIONAL];
|
|
405
414
|
}
|
|
406
415
|
|
|
407
416
|
// The request for [GetSession][google.spanner.v1.Spanner.GetSession].
|
|
@@ -546,7 +555,7 @@ message DirectedReadOptions {
|
|
|
546
555
|
// * `location:us-east1` --> The "us-east1" replica(s) of any available type
|
|
547
556
|
// will be used to process the request.
|
|
548
557
|
// * `type:READ_ONLY` --> The "READ_ONLY" type replica(s) in nearest
|
|
549
|
-
//
|
|
558
|
+
// available location will be used to process the
|
|
550
559
|
// request.
|
|
551
560
|
// * `location:us-east1 type:READ_ONLY` --> The "READ_ONLY" type replica(s)
|
|
552
561
|
// in location "us-east1" will be used to process
|
|
@@ -590,8 +599,7 @@ message DirectedReadOptions {
|
|
|
590
599
|
repeated ReplicaSelection replica_selections = 1;
|
|
591
600
|
}
|
|
592
601
|
|
|
593
|
-
// Required.
|
|
594
|
-
// considered. At most one of either include_replicas or exclude_replicas
|
|
602
|
+
// Required. At most one of either include_replicas or exclude_replicas
|
|
595
603
|
// should be present in the message.
|
|
596
604
|
oneof replicas {
|
|
597
605
|
// Include_replicas indicates the order of replicas (as they appear in
|
|
@@ -601,8 +609,9 @@ message DirectedReadOptions {
|
|
|
601
609
|
// may fail due to `DEADLINE_EXCEEDED` errors.
|
|
602
610
|
IncludeReplicas include_replicas = 1;
|
|
603
611
|
|
|
604
|
-
// Exclude_replicas indicates that should be excluded
|
|
605
|
-
// requests. Spanner will not route requests to the replicas
|
|
612
|
+
// Exclude_replicas indicates that specified replicas should be excluded
|
|
613
|
+
// from serving requests. Spanner will not route requests to the replicas
|
|
614
|
+
// in this list.
|
|
606
615
|
ExcludeReplicas exclude_replicas = 2;
|
|
607
616
|
}
|
|
608
617
|
}
|
|
@@ -1211,6 +1220,21 @@ message BatchWriteRequest {
|
|
|
1211
1220
|
// Required. The groups of mutations to be applied.
|
|
1212
1221
|
repeated MutationGroup mutation_groups = 4
|
|
1213
1222
|
[(google.api.field_behavior) = REQUIRED];
|
|
1223
|
+
|
|
1224
|
+
// Optional. When `exclude_txn_from_change_streams` is set to `true`:
|
|
1225
|
+
// * Mutations from all transactions in this batch write operation will not
|
|
1226
|
+
// be recorded in change streams with DDL option `allow_txn_exclusion=true`
|
|
1227
|
+
// that are tracking columns modified by these transactions.
|
|
1228
|
+
// * Mutations from all transactions in this batch write operation will be
|
|
1229
|
+
// recorded in change streams with DDL option `allow_txn_exclusion=false or
|
|
1230
|
+
// not set` that are tracking columns modified by these transactions.
|
|
1231
|
+
//
|
|
1232
|
+
// When `exclude_txn_from_change_streams` is set to `false` or not set,
|
|
1233
|
+
// mutations from all transactions in this batch write operation will be
|
|
1234
|
+
// recorded in all change streams that are tracking columns modified by these
|
|
1235
|
+
// transactions.
|
|
1236
|
+
bool exclude_txn_from_change_streams = 5
|
|
1237
|
+
[(google.api.field_behavior) = OPTIONAL];
|
|
1214
1238
|
}
|
|
1215
1239
|
|
|
1216
1240
|
// The result of applying a batch of mutations.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2023 Google LLC
|
|
2
2
|
//
|
|
3
3
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
4
|
// you may not use this file except in compliance with the License.
|
|
@@ -475,6 +475,22 @@ message TransactionOptions {
|
|
|
475
475
|
// on the `session` resource.
|
|
476
476
|
ReadOnly read_only = 2;
|
|
477
477
|
}
|
|
478
|
+
|
|
479
|
+
// When `exclude_txn_from_change_streams` is set to `true`:
|
|
480
|
+
// * Mutations from this transaction will not be recorded in change streams
|
|
481
|
+
// with DDL option `allow_txn_exclusion=true` that are tracking columns
|
|
482
|
+
// modified by these transactions.
|
|
483
|
+
// * Mutations from this transaction will be recorded in change streams with
|
|
484
|
+
// DDL option `allow_txn_exclusion=false or not set` that are tracking
|
|
485
|
+
// columns modified by these transactions.
|
|
486
|
+
//
|
|
487
|
+
// When `exclude_txn_from_change_streams` is set to `false` or not set,
|
|
488
|
+
// mutations from this transaction will be recorded in all change streams that
|
|
489
|
+
// are tracking columns modified by these transactions.
|
|
490
|
+
// `exclude_txn_from_change_streams` may only be specified for read-write or
|
|
491
|
+
// partitioned-dml transactions, otherwise the API will return an
|
|
492
|
+
// `INVALID_ARGUMENT` error.
|
|
493
|
+
bool exclude_txn_from_change_streams = 5;
|
|
478
494
|
}
|
|
479
495
|
|
|
480
496
|
// A transaction.
|
package/build/protos/protos.d.ts
CHANGED
|
@@ -16549,6 +16549,9 @@ export namespace google {
|
|
|
16549
16549
|
|
|
16550
16550
|
/** TransactionOptions readOnly */
|
|
16551
16551
|
readOnly?: (google.spanner.v1.TransactionOptions.IReadOnly|null);
|
|
16552
|
+
|
|
16553
|
+
/** TransactionOptions excludeTxnFromChangeStreams */
|
|
16554
|
+
excludeTxnFromChangeStreams?: (boolean|null);
|
|
16552
16555
|
}
|
|
16553
16556
|
|
|
16554
16557
|
/** Represents a TransactionOptions. */
|
|
@@ -16569,6 +16572,9 @@ export namespace google {
|
|
|
16569
16572
|
/** TransactionOptions readOnly. */
|
|
16570
16573
|
public readOnly?: (google.spanner.v1.TransactionOptions.IReadOnly|null);
|
|
16571
16574
|
|
|
16575
|
+
/** TransactionOptions excludeTxnFromChangeStreams. */
|
|
16576
|
+
public excludeTxnFromChangeStreams: boolean;
|
|
16577
|
+
|
|
16572
16578
|
/** TransactionOptions mode. */
|
|
16573
16579
|
public mode?: ("readWrite"|"partitionedDml"|"readOnly");
|
|
16574
16580
|
|
|
@@ -18233,6 +18239,9 @@ export namespace google {
|
|
|
18233
18239
|
|
|
18234
18240
|
/** Session creatorRole */
|
|
18235
18241
|
creatorRole?: (string|null);
|
|
18242
|
+
|
|
18243
|
+
/** Session multiplexed */
|
|
18244
|
+
multiplexed?: (boolean|null);
|
|
18236
18245
|
}
|
|
18237
18246
|
|
|
18238
18247
|
/** Represents a Session. */
|
|
@@ -18259,6 +18268,9 @@ export namespace google {
|
|
|
18259
18268
|
/** Session creatorRole. */
|
|
18260
18269
|
public creatorRole: string;
|
|
18261
18270
|
|
|
18271
|
+
/** Session multiplexed. */
|
|
18272
|
+
public multiplexed: boolean;
|
|
18273
|
+
|
|
18262
18274
|
/**
|
|
18263
18275
|
* Creates a new Session instance using the specified properties.
|
|
18264
18276
|
* @param [properties] Properties to set
|
|
@@ -20994,6 +21006,9 @@ export namespace google {
|
|
|
20994
21006
|
|
|
20995
21007
|
/** BatchWriteRequest mutationGroups */
|
|
20996
21008
|
mutationGroups?: (google.spanner.v1.BatchWriteRequest.IMutationGroup[]|null);
|
|
21009
|
+
|
|
21010
|
+
/** BatchWriteRequest excludeTxnFromChangeStreams */
|
|
21011
|
+
excludeTxnFromChangeStreams?: (boolean|null);
|
|
20997
21012
|
}
|
|
20998
21013
|
|
|
20999
21014
|
/** Represents a BatchWriteRequest. */
|
|
@@ -21014,6 +21029,9 @@ export namespace google {
|
|
|
21014
21029
|
/** BatchWriteRequest mutationGroups. */
|
|
21015
21030
|
public mutationGroups: google.spanner.v1.BatchWriteRequest.IMutationGroup[];
|
|
21016
21031
|
|
|
21032
|
+
/** BatchWriteRequest excludeTxnFromChangeStreams. */
|
|
21033
|
+
public excludeTxnFromChangeStreams: boolean;
|
|
21034
|
+
|
|
21017
21035
|
/**
|
|
21018
21036
|
* Creates a new BatchWriteRequest instance using the specified properties.
|
|
21019
21037
|
* @param [properties] Properties to set
|
package/build/protos/protos.js
CHANGED
|
@@ -42007,6 +42007,7 @@
|
|
|
42007
42007
|
* @property {google.spanner.v1.TransactionOptions.IReadWrite|null} [readWrite] TransactionOptions readWrite
|
|
42008
42008
|
* @property {google.spanner.v1.TransactionOptions.IPartitionedDml|null} [partitionedDml] TransactionOptions partitionedDml
|
|
42009
42009
|
* @property {google.spanner.v1.TransactionOptions.IReadOnly|null} [readOnly] TransactionOptions readOnly
|
|
42010
|
+
* @property {boolean|null} [excludeTxnFromChangeStreams] TransactionOptions excludeTxnFromChangeStreams
|
|
42010
42011
|
*/
|
|
42011
42012
|
|
|
42012
42013
|
/**
|
|
@@ -42048,6 +42049,14 @@
|
|
|
42048
42049
|
*/
|
|
42049
42050
|
TransactionOptions.prototype.readOnly = null;
|
|
42050
42051
|
|
|
42052
|
+
/**
|
|
42053
|
+
* TransactionOptions excludeTxnFromChangeStreams.
|
|
42054
|
+
* @member {boolean} excludeTxnFromChangeStreams
|
|
42055
|
+
* @memberof google.spanner.v1.TransactionOptions
|
|
42056
|
+
* @instance
|
|
42057
|
+
*/
|
|
42058
|
+
TransactionOptions.prototype.excludeTxnFromChangeStreams = false;
|
|
42059
|
+
|
|
42051
42060
|
// OneOf field names bound to virtual getters and setters
|
|
42052
42061
|
var $oneOfFields;
|
|
42053
42062
|
|
|
@@ -42092,6 +42101,8 @@
|
|
|
42092
42101
|
$root.google.spanner.v1.TransactionOptions.ReadOnly.encode(message.readOnly, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim();
|
|
42093
42102
|
if (message.partitionedDml != null && Object.hasOwnProperty.call(message, "partitionedDml"))
|
|
42094
42103
|
$root.google.spanner.v1.TransactionOptions.PartitionedDml.encode(message.partitionedDml, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim();
|
|
42104
|
+
if (message.excludeTxnFromChangeStreams != null && Object.hasOwnProperty.call(message, "excludeTxnFromChangeStreams"))
|
|
42105
|
+
writer.uint32(/* id 5, wireType 0 =*/40).bool(message.excludeTxnFromChangeStreams);
|
|
42095
42106
|
return writer;
|
|
42096
42107
|
};
|
|
42097
42108
|
|
|
@@ -42138,6 +42149,10 @@
|
|
|
42138
42149
|
message.readOnly = $root.google.spanner.v1.TransactionOptions.ReadOnly.decode(reader, reader.uint32());
|
|
42139
42150
|
break;
|
|
42140
42151
|
}
|
|
42152
|
+
case 5: {
|
|
42153
|
+
message.excludeTxnFromChangeStreams = reader.bool();
|
|
42154
|
+
break;
|
|
42155
|
+
}
|
|
42141
42156
|
default:
|
|
42142
42157
|
reader.skipType(tag & 7);
|
|
42143
42158
|
break;
|
|
@@ -42202,6 +42217,9 @@
|
|
|
42202
42217
|
return "readOnly." + error;
|
|
42203
42218
|
}
|
|
42204
42219
|
}
|
|
42220
|
+
if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams"))
|
|
42221
|
+
if (typeof message.excludeTxnFromChangeStreams !== "boolean")
|
|
42222
|
+
return "excludeTxnFromChangeStreams: boolean expected";
|
|
42205
42223
|
return null;
|
|
42206
42224
|
};
|
|
42207
42225
|
|
|
@@ -42232,6 +42250,8 @@
|
|
|
42232
42250
|
throw TypeError(".google.spanner.v1.TransactionOptions.readOnly: object expected");
|
|
42233
42251
|
message.readOnly = $root.google.spanner.v1.TransactionOptions.ReadOnly.fromObject(object.readOnly);
|
|
42234
42252
|
}
|
|
42253
|
+
if (object.excludeTxnFromChangeStreams != null)
|
|
42254
|
+
message.excludeTxnFromChangeStreams = Boolean(object.excludeTxnFromChangeStreams);
|
|
42235
42255
|
return message;
|
|
42236
42256
|
};
|
|
42237
42257
|
|
|
@@ -42248,6 +42268,8 @@
|
|
|
42248
42268
|
if (!options)
|
|
42249
42269
|
options = {};
|
|
42250
42270
|
var object = {};
|
|
42271
|
+
if (options.defaults)
|
|
42272
|
+
object.excludeTxnFromChangeStreams = false;
|
|
42251
42273
|
if (message.readWrite != null && message.hasOwnProperty("readWrite")) {
|
|
42252
42274
|
object.readWrite = $root.google.spanner.v1.TransactionOptions.ReadWrite.toObject(message.readWrite, options);
|
|
42253
42275
|
if (options.oneofs)
|
|
@@ -42263,6 +42285,8 @@
|
|
|
42263
42285
|
if (options.oneofs)
|
|
42264
42286
|
object.mode = "partitionedDml";
|
|
42265
42287
|
}
|
|
42288
|
+
if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams"))
|
|
42289
|
+
object.excludeTxnFromChangeStreams = message.excludeTxnFromChangeStreams;
|
|
42266
42290
|
return object;
|
|
42267
42291
|
};
|
|
42268
42292
|
|
|
@@ -45851,6 +45875,7 @@
|
|
|
45851
45875
|
* @property {google.protobuf.ITimestamp|null} [createTime] Session createTime
|
|
45852
45876
|
* @property {google.protobuf.ITimestamp|null} [approximateLastUseTime] Session approximateLastUseTime
|
|
45853
45877
|
* @property {string|null} [creatorRole] Session creatorRole
|
|
45878
|
+
* @property {boolean|null} [multiplexed] Session multiplexed
|
|
45854
45879
|
*/
|
|
45855
45880
|
|
|
45856
45881
|
/**
|
|
@@ -45909,6 +45934,14 @@
|
|
|
45909
45934
|
*/
|
|
45910
45935
|
Session.prototype.creatorRole = "";
|
|
45911
45936
|
|
|
45937
|
+
/**
|
|
45938
|
+
* Session multiplexed.
|
|
45939
|
+
* @member {boolean} multiplexed
|
|
45940
|
+
* @memberof google.spanner.v1.Session
|
|
45941
|
+
* @instance
|
|
45942
|
+
*/
|
|
45943
|
+
Session.prototype.multiplexed = false;
|
|
45944
|
+
|
|
45912
45945
|
/**
|
|
45913
45946
|
* Creates a new Session instance using the specified properties.
|
|
45914
45947
|
* @function create
|
|
@@ -45944,6 +45977,8 @@
|
|
|
45944
45977
|
$root.google.protobuf.Timestamp.encode(message.approximateLastUseTime, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
|
45945
45978
|
if (message.creatorRole != null && Object.hasOwnProperty.call(message, "creatorRole"))
|
|
45946
45979
|
writer.uint32(/* id 5, wireType 2 =*/42).string(message.creatorRole);
|
|
45980
|
+
if (message.multiplexed != null && Object.hasOwnProperty.call(message, "multiplexed"))
|
|
45981
|
+
writer.uint32(/* id 6, wireType 0 =*/48).bool(message.multiplexed);
|
|
45947
45982
|
return writer;
|
|
45948
45983
|
};
|
|
45949
45984
|
|
|
@@ -46017,6 +46052,10 @@
|
|
|
46017
46052
|
message.creatorRole = reader.string();
|
|
46018
46053
|
break;
|
|
46019
46054
|
}
|
|
46055
|
+
case 6: {
|
|
46056
|
+
message.multiplexed = reader.bool();
|
|
46057
|
+
break;
|
|
46058
|
+
}
|
|
46020
46059
|
default:
|
|
46021
46060
|
reader.skipType(tag & 7);
|
|
46022
46061
|
break;
|
|
@@ -46076,6 +46115,9 @@
|
|
|
46076
46115
|
if (message.creatorRole != null && message.hasOwnProperty("creatorRole"))
|
|
46077
46116
|
if (!$util.isString(message.creatorRole))
|
|
46078
46117
|
return "creatorRole: string expected";
|
|
46118
|
+
if (message.multiplexed != null && message.hasOwnProperty("multiplexed"))
|
|
46119
|
+
if (typeof message.multiplexed !== "boolean")
|
|
46120
|
+
return "multiplexed: boolean expected";
|
|
46079
46121
|
return null;
|
|
46080
46122
|
};
|
|
46081
46123
|
|
|
@@ -46112,6 +46154,8 @@
|
|
|
46112
46154
|
}
|
|
46113
46155
|
if (object.creatorRole != null)
|
|
46114
46156
|
message.creatorRole = String(object.creatorRole);
|
|
46157
|
+
if (object.multiplexed != null)
|
|
46158
|
+
message.multiplexed = Boolean(object.multiplexed);
|
|
46115
46159
|
return message;
|
|
46116
46160
|
};
|
|
46117
46161
|
|
|
@@ -46135,6 +46179,7 @@
|
|
|
46135
46179
|
object.createTime = null;
|
|
46136
46180
|
object.approximateLastUseTime = null;
|
|
46137
46181
|
object.creatorRole = "";
|
|
46182
|
+
object.multiplexed = false;
|
|
46138
46183
|
}
|
|
46139
46184
|
if (message.name != null && message.hasOwnProperty("name"))
|
|
46140
46185
|
object.name = message.name;
|
|
@@ -46150,6 +46195,8 @@
|
|
|
46150
46195
|
object.approximateLastUseTime = $root.google.protobuf.Timestamp.toObject(message.approximateLastUseTime, options);
|
|
46151
46196
|
if (message.creatorRole != null && message.hasOwnProperty("creatorRole"))
|
|
46152
46197
|
object.creatorRole = message.creatorRole;
|
|
46198
|
+
if (message.multiplexed != null && message.hasOwnProperty("multiplexed"))
|
|
46199
|
+
object.multiplexed = message.multiplexed;
|
|
46153
46200
|
return object;
|
|
46154
46201
|
};
|
|
46155
46202
|
|
|
@@ -53057,6 +53104,7 @@
|
|
|
53057
53104
|
* @property {string|null} [session] BatchWriteRequest session
|
|
53058
53105
|
* @property {google.spanner.v1.IRequestOptions|null} [requestOptions] BatchWriteRequest requestOptions
|
|
53059
53106
|
* @property {Array.<google.spanner.v1.BatchWriteRequest.IMutationGroup>|null} [mutationGroups] BatchWriteRequest mutationGroups
|
|
53107
|
+
* @property {boolean|null} [excludeTxnFromChangeStreams] BatchWriteRequest excludeTxnFromChangeStreams
|
|
53060
53108
|
*/
|
|
53061
53109
|
|
|
53062
53110
|
/**
|
|
@@ -53099,6 +53147,14 @@
|
|
|
53099
53147
|
*/
|
|
53100
53148
|
BatchWriteRequest.prototype.mutationGroups = $util.emptyArray;
|
|
53101
53149
|
|
|
53150
|
+
/**
|
|
53151
|
+
* BatchWriteRequest excludeTxnFromChangeStreams.
|
|
53152
|
+
* @member {boolean} excludeTxnFromChangeStreams
|
|
53153
|
+
* @memberof google.spanner.v1.BatchWriteRequest
|
|
53154
|
+
* @instance
|
|
53155
|
+
*/
|
|
53156
|
+
BatchWriteRequest.prototype.excludeTxnFromChangeStreams = false;
|
|
53157
|
+
|
|
53102
53158
|
/**
|
|
53103
53159
|
* Creates a new BatchWriteRequest instance using the specified properties.
|
|
53104
53160
|
* @function create
|
|
@@ -53130,6 +53186,8 @@
|
|
|
53130
53186
|
if (message.mutationGroups != null && message.mutationGroups.length)
|
|
53131
53187
|
for (var i = 0; i < message.mutationGroups.length; ++i)
|
|
53132
53188
|
$root.google.spanner.v1.BatchWriteRequest.MutationGroup.encode(message.mutationGroups[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim();
|
|
53189
|
+
if (message.excludeTxnFromChangeStreams != null && Object.hasOwnProperty.call(message, "excludeTxnFromChangeStreams"))
|
|
53190
|
+
writer.uint32(/* id 5, wireType 0 =*/40).bool(message.excludeTxnFromChangeStreams);
|
|
53133
53191
|
return writer;
|
|
53134
53192
|
};
|
|
53135
53193
|
|
|
@@ -53178,6 +53236,10 @@
|
|
|
53178
53236
|
message.mutationGroups.push($root.google.spanner.v1.BatchWriteRequest.MutationGroup.decode(reader, reader.uint32()));
|
|
53179
53237
|
break;
|
|
53180
53238
|
}
|
|
53239
|
+
case 5: {
|
|
53240
|
+
message.excludeTxnFromChangeStreams = reader.bool();
|
|
53241
|
+
break;
|
|
53242
|
+
}
|
|
53181
53243
|
default:
|
|
53182
53244
|
reader.skipType(tag & 7);
|
|
53183
53245
|
break;
|
|
@@ -53230,6 +53292,9 @@
|
|
|
53230
53292
|
return "mutationGroups." + error;
|
|
53231
53293
|
}
|
|
53232
53294
|
}
|
|
53295
|
+
if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams"))
|
|
53296
|
+
if (typeof message.excludeTxnFromChangeStreams !== "boolean")
|
|
53297
|
+
return "excludeTxnFromChangeStreams: boolean expected";
|
|
53233
53298
|
return null;
|
|
53234
53299
|
};
|
|
53235
53300
|
|
|
@@ -53262,6 +53327,8 @@
|
|
|
53262
53327
|
message.mutationGroups[i] = $root.google.spanner.v1.BatchWriteRequest.MutationGroup.fromObject(object.mutationGroups[i]);
|
|
53263
53328
|
}
|
|
53264
53329
|
}
|
|
53330
|
+
if (object.excludeTxnFromChangeStreams != null)
|
|
53331
|
+
message.excludeTxnFromChangeStreams = Boolean(object.excludeTxnFromChangeStreams);
|
|
53265
53332
|
return message;
|
|
53266
53333
|
};
|
|
53267
53334
|
|
|
@@ -53283,6 +53350,7 @@
|
|
|
53283
53350
|
if (options.defaults) {
|
|
53284
53351
|
object.session = "";
|
|
53285
53352
|
object.requestOptions = null;
|
|
53353
|
+
object.excludeTxnFromChangeStreams = false;
|
|
53286
53354
|
}
|
|
53287
53355
|
if (message.session != null && message.hasOwnProperty("session"))
|
|
53288
53356
|
object.session = message.session;
|
|
@@ -53293,6 +53361,8 @@
|
|
|
53293
53361
|
for (var j = 0; j < message.mutationGroups.length; ++j)
|
|
53294
53362
|
object.mutationGroups[j] = $root.google.spanner.v1.BatchWriteRequest.MutationGroup.toObject(message.mutationGroups[j], options);
|
|
53295
53363
|
}
|
|
53364
|
+
if (message.excludeTxnFromChangeStreams != null && message.hasOwnProperty("excludeTxnFromChangeStreams"))
|
|
53365
|
+
object.excludeTxnFromChangeStreams = message.excludeTxnFromChangeStreams;
|
|
53296
53366
|
return object;
|
|
53297
53367
|
};
|
|
53298
53368
|
|
package/build/protos/protos.json
CHANGED
|
@@ -4462,6 +4462,10 @@
|
|
|
4462
4462
|
"readOnly": {
|
|
4463
4463
|
"type": "ReadOnly",
|
|
4464
4464
|
"id": 2
|
|
4465
|
+
},
|
|
4466
|
+
"excludeTxnFromChangeStreams": {
|
|
4467
|
+
"type": "bool",
|
|
4468
|
+
"id": 5
|
|
4465
4469
|
}
|
|
4466
4470
|
},
|
|
4467
4471
|
"nested": {
|
|
@@ -5026,6 +5030,13 @@
|
|
|
5026
5030
|
"creatorRole": {
|
|
5027
5031
|
"type": "string",
|
|
5028
5032
|
"id": 5
|
|
5033
|
+
},
|
|
5034
|
+
"multiplexed": {
|
|
5035
|
+
"type": "bool",
|
|
5036
|
+
"id": 6,
|
|
5037
|
+
"options": {
|
|
5038
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
5039
|
+
}
|
|
5029
5040
|
}
|
|
5030
5041
|
}
|
|
5031
5042
|
},
|
|
@@ -5628,6 +5639,13 @@
|
|
|
5628
5639
|
"options": {
|
|
5629
5640
|
"(google.api.field_behavior)": "REQUIRED"
|
|
5630
5641
|
}
|
|
5642
|
+
},
|
|
5643
|
+
"excludeTxnFromChangeStreams": {
|
|
5644
|
+
"type": "bool",
|
|
5645
|
+
"id": 5,
|
|
5646
|
+
"options": {
|
|
5647
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
5648
|
+
}
|
|
5631
5649
|
}
|
|
5632
5650
|
},
|
|
5633
5651
|
"nested": {
|
package/build/src/codec.d.ts
CHANGED
|
@@ -139,6 +139,15 @@ export declare class PGJsonb {
|
|
|
139
139
|
constructor(pgValue: object | string);
|
|
140
140
|
toString(): string;
|
|
141
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* @typedef PGOid
|
|
144
|
+
* @see Spanner.pgOid
|
|
145
|
+
*/
|
|
146
|
+
export declare class PGOid extends WrappedNumber {
|
|
147
|
+
value: string;
|
|
148
|
+
constructor(value: string);
|
|
149
|
+
valueOf(): number;
|
|
150
|
+
}
|
|
142
151
|
/**
|
|
143
152
|
* @typedef JSONOptions
|
|
144
153
|
* @property {boolean} [wrapNumbers=false] Indicates if the numbers should be
|
|
@@ -278,6 +287,7 @@ export declare const codec: {
|
|
|
278
287
|
Numeric: typeof Numeric;
|
|
279
288
|
PGNumeric: typeof PGNumeric;
|
|
280
289
|
PGJsonb: typeof PGJsonb;
|
|
290
|
+
PGOid: typeof PGOid;
|
|
281
291
|
convertFieldsToJson: typeof convertFieldsToJson;
|
|
282
292
|
decode: typeof decode;
|
|
283
293
|
encode: typeof encode;
|
package/build/src/codec.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.codec = exports.PGJsonb = exports.PGNumeric = exports.Numeric = exports.Struct = exports.Int = exports.Float = exports.SpannerDate = void 0;
|
|
3
|
+
exports.codec = exports.PGOid = exports.PGJsonb = exports.PGNumeric = exports.Numeric = exports.Struct = exports.Int = exports.Float = exports.SpannerDate = void 0;
|
|
4
4
|
/*!
|
|
5
5
|
* Copyright 2017 Google Inc. All Rights Reserved.
|
|
6
6
|
*
|
|
@@ -211,6 +211,24 @@ class PGJsonb {
|
|
|
211
211
|
}
|
|
212
212
|
}
|
|
213
213
|
exports.PGJsonb = PGJsonb;
|
|
214
|
+
/**
|
|
215
|
+
* @typedef PGOid
|
|
216
|
+
* @see Spanner.pgOid
|
|
217
|
+
*/
|
|
218
|
+
class PGOid extends WrappedNumber {
|
|
219
|
+
constructor(value) {
|
|
220
|
+
super();
|
|
221
|
+
this.value = value.toString();
|
|
222
|
+
}
|
|
223
|
+
valueOf() {
|
|
224
|
+
const num = Number(this.value);
|
|
225
|
+
if (num > Number.MAX_SAFE_INTEGER) {
|
|
226
|
+
throw new google_gax_1.GoogleError(`PG.OID ${this.value} is out of bounds.`);
|
|
227
|
+
}
|
|
228
|
+
return num;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
exports.PGOid = PGOid;
|
|
214
232
|
/**
|
|
215
233
|
* @typedef JSONOptions
|
|
216
234
|
* @property {boolean} [wrapNumbers=false] Indicates if the numbers should be
|
|
@@ -312,6 +330,12 @@ function decode(value, type) {
|
|
|
312
330
|
break;
|
|
313
331
|
case protos_1.google.spanner.v1.TypeCode.INT64:
|
|
314
332
|
case 'INT64':
|
|
333
|
+
if (type.typeAnnotation ===
|
|
334
|
+
protos_1.google.spanner.v1.TypeAnnotationCode.PG_OID ||
|
|
335
|
+
type.typeAnnotation === 'PG_OID') {
|
|
336
|
+
decoded = new PGOid(decoded);
|
|
337
|
+
break;
|
|
338
|
+
}
|
|
315
339
|
decoded = new Int(decoded);
|
|
316
340
|
break;
|
|
317
341
|
case protos_1.google.spanner.v1.TypeCode.NUMERIC:
|
|
@@ -425,6 +449,7 @@ const TypeCode = {
|
|
|
425
449
|
unspecified: 'TYPE_CODE_UNSPECIFIED',
|
|
426
450
|
bool: 'BOOL',
|
|
427
451
|
int64: 'INT64',
|
|
452
|
+
pgOid: 'INT64',
|
|
428
453
|
float64: 'FLOAT64',
|
|
429
454
|
numeric: 'NUMERIC',
|
|
430
455
|
pgNumeric: 'NUMERIC',
|
|
@@ -491,12 +516,12 @@ function getType(value) {
|
|
|
491
516
|
if (value instanceof PGJsonb) {
|
|
492
517
|
return { type: 'pgJsonb' };
|
|
493
518
|
}
|
|
519
|
+
if (value instanceof PGOid) {
|
|
520
|
+
return { type: 'pgOid' };
|
|
521
|
+
}
|
|
494
522
|
if (is.boolean(value)) {
|
|
495
523
|
return { type: 'bool' };
|
|
496
524
|
}
|
|
497
|
-
if (is.string(value)) {
|
|
498
|
-
return { type: 'string' };
|
|
499
|
-
}
|
|
500
525
|
if (Buffer.isBuffer(value)) {
|
|
501
526
|
return { type: 'bytes' };
|
|
502
527
|
}
|
|
@@ -530,6 +555,7 @@ function getType(value) {
|
|
|
530
555
|
if (is.object(value)) {
|
|
531
556
|
return { type: 'json' };
|
|
532
557
|
}
|
|
558
|
+
// String type is also returned as unspecified to allow untyped parameters
|
|
533
559
|
return { type: 'unspecified' };
|
|
534
560
|
}
|
|
535
561
|
/**
|
|
@@ -608,6 +634,9 @@ function createTypeObject(friendlyType) {
|
|
|
608
634
|
else if (friendlyType.type === 'jsonb') {
|
|
609
635
|
type.typeAnnotation = protos_1.google.spanner.v1.TypeAnnotationCode.PG_JSONB;
|
|
610
636
|
}
|
|
637
|
+
else if (friendlyType.type === 'pgOid') {
|
|
638
|
+
type.typeAnnotation = protos_1.google.spanner.v1.TypeAnnotationCode.PG_OID;
|
|
639
|
+
}
|
|
611
640
|
return type;
|
|
612
641
|
}
|
|
613
642
|
exports.codec = {
|
|
@@ -621,6 +650,7 @@ exports.codec = {
|
|
|
621
650
|
Numeric,
|
|
622
651
|
PGNumeric,
|
|
623
652
|
PGJsonb,
|
|
653
|
+
PGOid,
|
|
624
654
|
convertFieldsToJson,
|
|
625
655
|
decode,
|
|
626
656
|
encode,
|
|
@@ -139,7 +139,7 @@ export declare class PartialResultStream extends Transform implements ResultEven
|
|
|
139
139
|
*/
|
|
140
140
|
_transform(chunk: google.spanner.v1.PartialResultSet, enc: string, next: Function): void;
|
|
141
141
|
private _tryResume;
|
|
142
|
-
|
|
142
|
+
_resetPendingValues(): void;
|
|
143
143
|
/**
|
|
144
144
|
* Manages any chunked values.
|
|
145
145
|
*
|
|
@@ -122,8 +122,7 @@ class PartialResultStream extends stream_1.Transform {
|
|
|
122
122
|
}, timeout);
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
|
|
126
|
-
this._values = [];
|
|
125
|
+
_resetPendingValues() {
|
|
127
126
|
if (this._pendingValueForResume) {
|
|
128
127
|
this._pendingValue = this._pendingValueForResume;
|
|
129
128
|
}
|
|
@@ -323,7 +322,9 @@ function partialResultStream(requestFn, options) {
|
|
|
323
322
|
});
|
|
324
323
|
};
|
|
325
324
|
const makeRequest = () => {
|
|
326
|
-
|
|
325
|
+
if (is.defined(lastResumeToken) && lastResumeToken.length > 0) {
|
|
326
|
+
partialRSStream._resetPendingValues();
|
|
327
|
+
}
|
|
327
328
|
lastRequestStream = requestFn(lastResumeToken);
|
|
328
329
|
lastRequestStream.on('end', endListener);
|
|
329
330
|
requestsStream.add(lastRequestStream);
|
package/build/src/transaction.js
CHANGED
|
@@ -781,7 +781,10 @@ class Snapshot extends events_1.EventEmitter {
|
|
|
781
781
|
if (!is.empty(typeMap)) {
|
|
782
782
|
Object.keys(typeMap).forEach(param => {
|
|
783
783
|
const type = typeMap[param];
|
|
784
|
-
|
|
784
|
+
const typeObject = codec_1.codec.createTypeObject(type);
|
|
785
|
+
if (typeObject.code !== 'TYPE_CODE_UNSPECIFIED') {
|
|
786
|
+
paramTypes[param] = codec_1.codec.createTypeObject(type);
|
|
787
|
+
}
|
|
785
788
|
});
|
|
786
789
|
}
|
|
787
790
|
return { params, paramTypes };
|
|
@@ -959,6 +959,19 @@ export declare class SpannerClient {
|
|
|
959
959
|
* Common options for this request.
|
|
960
960
|
* @param {number[]} request.mutationGroups
|
|
961
961
|
* Required. The groups of mutations to be applied.
|
|
962
|
+
* @param {boolean} [request.excludeTxnFromChangeStreams]
|
|
963
|
+
* Optional. When `exclude_txn_from_change_streams` is set to `true`:
|
|
964
|
+
* * Mutations from all transactions in this batch write operation will not
|
|
965
|
+
* be recorded in change streams with DDL option `allow_txn_exclusion=true`
|
|
966
|
+
* that are tracking columns modified by these transactions.
|
|
967
|
+
* * Mutations from all transactions in this batch write operation will be
|
|
968
|
+
* recorded in change streams with DDL option `allow_txn_exclusion=false or
|
|
969
|
+
* not set` that are tracking columns modified by these transactions.
|
|
970
|
+
*
|
|
971
|
+
* When `exclude_txn_from_change_streams` is set to `false` or not set,
|
|
972
|
+
* mutations from all transactions in this batch write operation will be
|
|
973
|
+
* recorded in all change streams that are tracking columns modified by these
|
|
974
|
+
* transactions.
|
|
962
975
|
* @param {object} [options]
|
|
963
976
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
964
977
|
* @returns {Stream}
|
|
@@ -783,6 +783,19 @@ class SpannerClient {
|
|
|
783
783
|
* Common options for this request.
|
|
784
784
|
* @param {number[]} request.mutationGroups
|
|
785
785
|
* Required. The groups of mutations to be applied.
|
|
786
|
+
* @param {boolean} [request.excludeTxnFromChangeStreams]
|
|
787
|
+
* Optional. When `exclude_txn_from_change_streams` is set to `true`:
|
|
788
|
+
* * Mutations from all transactions in this batch write operation will not
|
|
789
|
+
* be recorded in change streams with DDL option `allow_txn_exclusion=true`
|
|
790
|
+
* that are tracking columns modified by these transactions.
|
|
791
|
+
* * Mutations from all transactions in this batch write operation will be
|
|
792
|
+
* recorded in change streams with DDL option `allow_txn_exclusion=false or
|
|
793
|
+
* not set` that are tracking columns modified by these transactions.
|
|
794
|
+
*
|
|
795
|
+
* When `exclude_txn_from_change_streams` is set to `false` or not set,
|
|
796
|
+
* mutations from all transactions in this batch write operation will be
|
|
797
|
+
* recorded in all change streams that are tracking columns modified by these
|
|
798
|
+
* transactions.
|
|
786
799
|
* @param {object} [options]
|
|
787
800
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
788
801
|
* @returns {Stream}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@google-cloud/spanner",
|
|
3
3
|
"description": "Cloud Spanner Client Library for Node.js",
|
|
4
|
-
"version": "7.
|
|
4
|
+
"version": "7.4.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Google Inc.",
|
|
7
7
|
"engines": {
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"events-intercept": "^2.0.0",
|
|
66
66
|
"extend": "^3.0.2",
|
|
67
67
|
"google-auth-library": "^9.0.0",
|
|
68
|
-
"google-gax": "4.3.
|
|
68
|
+
"google-gax": "4.3.1",
|
|
69
69
|
"grpc-gcp": "^1.0.0",
|
|
70
70
|
"is": "^3.2.1",
|
|
71
71
|
"lodash.snakecase": "^4.1.1",
|