@google-cloud/spanner 8.7.1 → 8.8.1
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/build/protos/google/spanner/v1/commit_response.proto +16 -0
- package/build/protos/google/spanner/v1/spanner.proto +55 -2
- package/build/protos/google/spanner/v1/transaction.proto +38 -18
- package/build/protos/protos.d.ts +1639 -1473
- package/build/protos/protos.js +13981 -9820
- package/build/protos/protos.json +296 -213
- package/build/src/codec.d.ts +10 -16
- package/build/src/codec.js +337 -68
- package/build/src/common-grpc/service.js +26 -16
- package/build/src/database.js +4 -1
- package/build/src/helper.d.ts +16 -0
- package/build/src/helper.js +89 -0
- package/build/src/index.js +20 -16
- package/build/src/instance.js +4 -1
- package/build/src/instrument.d.ts +10 -0
- package/build/src/instrument.js +74 -13
- package/build/src/metrics/metrics-tracer-factory.d.ts +1 -1
- package/build/src/metrics/metrics-tracer-factory.js +4 -4
- package/build/src/multiplexed-session.js +22 -19
- package/build/src/partial-result-stream.d.ts +11 -0
- package/build/src/partial-result-stream.js +79 -12
- package/build/src/request_id_header.js +12 -25
- package/build/src/session-pool.js +37 -34
- package/build/src/session.js +1 -1
- package/build/src/transaction.js +1 -1
- package/build/src/v1/spanner_client.d.ts +47 -4
- package/build/src/v1/spanner_client.js +47 -2
- package/build/src/v1/spanner_client_config.json +4 -0
- package/package.json +3 -11
|
@@ -31,6 +31,8 @@ const randIdForProcess = (0, crypto_1.randomBytes)(8)
|
|
|
31
31
|
.toString(16)
|
|
32
32
|
.padStart(8, '0');
|
|
33
33
|
exports.randIdForProcess = randIdForProcess;
|
|
34
|
+
const REQUEST_HEADER_VERSION = 1;
|
|
35
|
+
const PROCESS_PREFIX = `${REQUEST_HEADER_VERSION}.${randIdForProcess}.`;
|
|
34
36
|
const X_GOOG_SPANNER_REQUEST_ID_HEADER = 'x-goog-spanner-request-id';
|
|
35
37
|
exports.X_GOOG_SPANNER_REQUEST_ID_HEADER = X_GOOG_SPANNER_REQUEST_ID_HEADER;
|
|
36
38
|
class AtomicCounter {
|
|
@@ -59,9 +61,8 @@ class AtomicCounter {
|
|
|
59
61
|
}
|
|
60
62
|
}
|
|
61
63
|
exports.AtomicCounter = AtomicCounter;
|
|
62
|
-
const REQUEST_HEADER_VERSION = 1;
|
|
63
64
|
function craftRequestId(nthClientId, channelId, nthRequest, attempt) {
|
|
64
|
-
return `${
|
|
65
|
+
return `${PROCESS_PREFIX}${nthClientId}.${channelId}.${nthRequest}.${attempt}`;
|
|
65
66
|
}
|
|
66
67
|
const nthClientId = new AtomicCounter();
|
|
67
68
|
// Only exported for deterministic testing.
|
|
@@ -105,38 +106,24 @@ function injectRequestIDIntoHeaders(headers, session, nthRequest, attempt) {
|
|
|
105
106
|
if (!session) {
|
|
106
107
|
return headers;
|
|
107
108
|
}
|
|
109
|
+
const database = session.parent;
|
|
108
110
|
if (!nthRequest) {
|
|
109
|
-
|
|
110
|
-
if (!(database && typeof database._nextNthRequest === 'function')) {
|
|
111
|
+
if (!database || typeof database._nextNthRequest !== 'function') {
|
|
111
112
|
return headers;
|
|
112
113
|
}
|
|
113
114
|
nthRequest = database._nextNthRequest();
|
|
114
115
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
if (!priorMetadata) {
|
|
120
|
-
priorMetadata = {};
|
|
121
|
-
}
|
|
122
|
-
const withReqId = {
|
|
123
|
-
...priorMetadata,
|
|
124
|
-
};
|
|
125
|
-
const database = session.parent;
|
|
126
|
-
let clientId = 1;
|
|
127
|
-
let channelId = 1;
|
|
128
|
-
if (database) {
|
|
129
|
-
clientId = database._nthClientId || 1;
|
|
130
|
-
channelId = database._channelId || 1;
|
|
131
|
-
}
|
|
132
|
-
withReqId[X_GOOG_SPANNER_REQUEST_ID_HEADER] = craftRequestId(clientId, channelId, nthRequest, attempt);
|
|
116
|
+
const clientId = database ? database._nthClientId || 1 : 1;
|
|
117
|
+
const channelId = database ? database._channelId || 1 : 1;
|
|
118
|
+
const withReqId = { ...headers };
|
|
119
|
+
withReqId[X_GOOG_SPANNER_REQUEST_ID_HEADER] = craftRequestId(clientId, channelId, nthRequest || 1, attempt || 1);
|
|
133
120
|
return withReqId;
|
|
134
121
|
}
|
|
135
122
|
function nextNthRequest(database) {
|
|
136
|
-
if (
|
|
137
|
-
return
|
|
123
|
+
if (database && typeof database._nextNthRequest === 'function') {
|
|
124
|
+
return database._nextNthRequest();
|
|
138
125
|
}
|
|
139
|
-
return
|
|
126
|
+
return 1;
|
|
140
127
|
}
|
|
141
128
|
const X_GOOG_SPANNER_REQUEST_ID_SPAN_ATTR = 'x_goog_spanner_request_id';
|
|
142
129
|
exports.X_GOOG_SPANNER_REQUEST_ID_SPAN_ATTR = X_GOOG_SPANNER_REQUEST_ID_SPAN_ATTR;
|
|
@@ -20,6 +20,7 @@ exports.isSessionNotFoundError = isSessionNotFoundError;
|
|
|
20
20
|
const events_1 = require("events");
|
|
21
21
|
const p_queue_1 = require("p-queue");
|
|
22
22
|
const google_gax_1 = require("google-gax");
|
|
23
|
+
const api_1 = require("@opentelemetry/api");
|
|
23
24
|
const trace = require("stack-trace");
|
|
24
25
|
const instrument_1 = require("./instrument");
|
|
25
26
|
const helper_1 = require("./helper");
|
|
@@ -450,40 +451,42 @@ class SessionPool extends events_1.EventEmitter {
|
|
|
450
451
|
opts: this._observabilityOptions,
|
|
451
452
|
dbName: this.database.formattedName_,
|
|
452
453
|
};
|
|
453
|
-
return
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
454
|
+
return api_1.context.with(api_1.ROOT_CONTEXT, () => {
|
|
455
|
+
return (0, instrument_1.startTrace)('SessionPool.createSessions', traceConfig, async (span) => {
|
|
456
|
+
span.addEvent(`Requesting ${amount} sessions`);
|
|
457
|
+
// while we can request as many sessions be created as we want, the backend
|
|
458
|
+
// will return at most 100 at a time, hence the need for a while loop.
|
|
459
|
+
while (amount > 0) {
|
|
460
|
+
let sessions = null;
|
|
461
|
+
span.addEvent(`Creating ${amount} sessions`);
|
|
462
|
+
try {
|
|
463
|
+
[sessions] = await this.database.batchCreateSessions({
|
|
464
|
+
count: amount,
|
|
465
|
+
labels: labels,
|
|
466
|
+
databaseRole: databaseRole,
|
|
467
|
+
});
|
|
468
|
+
amount -= sessions.length;
|
|
469
|
+
nReturned += sessions.length;
|
|
470
|
+
}
|
|
471
|
+
catch (e) {
|
|
472
|
+
this._pending -= amount;
|
|
473
|
+
this.emit('createError', e);
|
|
474
|
+
span.addEvent(`Requested for ${nRequested} sessions returned ${nReturned}`);
|
|
475
|
+
(0, instrument_1.setSpanErrorAndException)(span, e);
|
|
476
|
+
span.end();
|
|
477
|
+
throw e;
|
|
478
|
+
}
|
|
479
|
+
sessions.forEach((session) => {
|
|
480
|
+
setImmediate(() => {
|
|
481
|
+
this._inventory.borrowed.add(session);
|
|
482
|
+
this._pending -= 1;
|
|
483
|
+
this.release(session);
|
|
484
|
+
});
|
|
465
485
|
});
|
|
466
|
-
amount -= sessions.length;
|
|
467
|
-
nReturned += sessions.length;
|
|
468
486
|
}
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
span.addEvent(`Requested for ${nRequested} sessions returned ${nReturned}`);
|
|
473
|
-
(0, instrument_1.setSpanErrorAndException)(span, e);
|
|
474
|
-
span.end();
|
|
475
|
-
throw e;
|
|
476
|
-
}
|
|
477
|
-
sessions.forEach((session) => {
|
|
478
|
-
setImmediate(() => {
|
|
479
|
-
this._inventory.borrowed.add(session);
|
|
480
|
-
this._pending -= 1;
|
|
481
|
-
this.release(session);
|
|
482
|
-
});
|
|
483
|
-
});
|
|
484
|
-
}
|
|
485
|
-
span.addEvent(`Requested for ${nRequested} sessions returned ${nReturned}`);
|
|
486
|
-
span.end();
|
|
487
|
+
span.addEvent(`Requested for ${nRequested} sessions returned ${nReturned}`);
|
|
488
|
+
span.end();
|
|
489
|
+
});
|
|
487
490
|
});
|
|
488
491
|
}
|
|
489
492
|
/**
|
|
@@ -757,10 +760,10 @@ class SessionPool extends events_1.EventEmitter {
|
|
|
757
760
|
*/
|
|
758
761
|
_startHouseKeeping() {
|
|
759
762
|
const evictRate = this.options.idlesAfter * 60000;
|
|
760
|
-
this._evictHandle = setInterval(() => this._evictIdleSessions(), evictRate);
|
|
763
|
+
this._evictHandle = api_1.context.with(api_1.ROOT_CONTEXT, () => setInterval(() => this._evictIdleSessions(), evictRate));
|
|
761
764
|
this._evictHandle.unref();
|
|
762
765
|
const pingRate = this.options.keepAlive * 60000;
|
|
763
|
-
this._pingHandle = setInterval(() => this._pingIdleSessions(), pingRate);
|
|
766
|
+
this._pingHandle = api_1.context.with(api_1.ROOT_CONTEXT, () => setInterval(() => this._pingIdleSessions(), pingRate));
|
|
764
767
|
this._pingHandle.unref();
|
|
765
768
|
}
|
|
766
769
|
/**
|
package/build/src/session.js
CHANGED
|
@@ -206,7 +206,7 @@ class Session extends common.GrpcServiceObject {
|
|
|
206
206
|
},
|
|
207
207
|
});
|
|
208
208
|
this._observabilityOptions = database._observabilityOptions;
|
|
209
|
-
this.commonHeaders_ =
|
|
209
|
+
this.commonHeaders_ = { ...database.commonHeaders_ };
|
|
210
210
|
this.request = database.request;
|
|
211
211
|
this.requestStream = database.requestStream;
|
|
212
212
|
if (name) {
|
package/build/src/transaction.js
CHANGED
|
@@ -166,7 +166,7 @@ class Snapshot extends events_1.EventEmitter {
|
|
|
166
166
|
this._waitingRequests = [];
|
|
167
167
|
this._inlineBeginStarted = false;
|
|
168
168
|
this._observabilityOptions = session._observabilityOptions;
|
|
169
|
-
this.commonHeaders_ =
|
|
169
|
+
this.commonHeaders_ = { ...session.commonHeaders_ };
|
|
170
170
|
this._traceConfig = {
|
|
171
171
|
opts: this._observabilityOptions,
|
|
172
172
|
dbName: this._dbName,
|
|
@@ -350,7 +350,7 @@ export declare class SpannerClient {
|
|
|
350
350
|
* constraints). Given this, successful execution of a DML statement shouldn't
|
|
351
351
|
* be assumed until a subsequent `Commit` call completes successfully.
|
|
352
352
|
* @param {google.spanner.v1.RoutingHint} [request.routingHint]
|
|
353
|
-
* Optional.
|
|
353
|
+
* Optional. Makes the Spanner requests location-aware if present.
|
|
354
354
|
*
|
|
355
355
|
* It gives the server hints that can be used to route the request
|
|
356
356
|
* to an appropriate server, potentially significantly decreasing latency and
|
|
@@ -527,7 +527,7 @@ export declare class SpannerClient {
|
|
|
527
527
|
* Optional. Lock Hint for the request, it can only be used with read-write
|
|
528
528
|
* transactions.
|
|
529
529
|
* @param {google.spanner.v1.RoutingHint} [request.routingHint]
|
|
530
|
-
* Optional.
|
|
530
|
+
* Optional. Makes the Spanner requests location-aware if present.
|
|
531
531
|
*
|
|
532
532
|
* It gives the server hints that can be used to route the request
|
|
533
533
|
* to an appropriate server, potentially significantly decreasing latency and
|
|
@@ -571,6 +571,13 @@ export declare class SpannerClient {
|
|
|
571
571
|
* that commit mutations but don't perform any reads or queries. You must
|
|
572
572
|
* randomly select one of the mutations from the mutation set and send it as a
|
|
573
573
|
* part of this request.
|
|
574
|
+
* @param {google.spanner.v1.RoutingHint} [request.routingHint]
|
|
575
|
+
* Optional. Makes the Spanner requests location-aware if present.
|
|
576
|
+
*
|
|
577
|
+
* It gives the server hints that can be used to route the request
|
|
578
|
+
* to an appropriate server, potentially significantly decreasing latency and
|
|
579
|
+
* improving throughput. To achieve improved performance, most fields must be
|
|
580
|
+
* filled in with accurate values.
|
|
574
581
|
* @param {object} [options]
|
|
575
582
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
576
583
|
* @returns {Promise} - The promise which resolves to an array.
|
|
@@ -638,6 +645,13 @@ export declare class SpannerClient {
|
|
|
638
645
|
* session, then you must include the precommit token with the highest
|
|
639
646
|
* sequence number received in this transaction attempt. Failing to do so
|
|
640
647
|
* results in a `FailedPrecondition` error.
|
|
648
|
+
* @param {google.spanner.v1.RoutingHint} [request.routingHint]
|
|
649
|
+
* Optional. Makes the Spanner requests location-aware if present.
|
|
650
|
+
*
|
|
651
|
+
* It gives the server hints that can be used to route the request
|
|
652
|
+
* to an appropriate server, potentially significantly decreasing latency and
|
|
653
|
+
* improving throughput. To achieve improved performance, most fields must be
|
|
654
|
+
* filled in with accurate values.
|
|
641
655
|
* @param {object} [options]
|
|
642
656
|
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
643
657
|
* @returns {Promise} - The promise which resolves to an array.
|
|
@@ -924,7 +938,7 @@ export declare class SpannerClient {
|
|
|
924
938
|
* constraints). Given this, successful execution of a DML statement shouldn't
|
|
925
939
|
* be assumed until a subsequent `Commit` call completes successfully.
|
|
926
940
|
* @param {google.spanner.v1.RoutingHint} [request.routingHint]
|
|
927
|
-
* Optional.
|
|
941
|
+
* Optional. Makes the Spanner requests location-aware if present.
|
|
928
942
|
*
|
|
929
943
|
* It gives the server hints that can be used to route the request
|
|
930
944
|
* to an appropriate server, potentially significantly decreasing latency and
|
|
@@ -1020,7 +1034,7 @@ export declare class SpannerClient {
|
|
|
1020
1034
|
* Optional. Lock Hint for the request, it can only be used with read-write
|
|
1021
1035
|
* transactions.
|
|
1022
1036
|
* @param {google.spanner.v1.RoutingHint} [request.routingHint]
|
|
1023
|
-
* Optional.
|
|
1037
|
+
* Optional. Makes the Spanner requests location-aware if present.
|
|
1024
1038
|
*
|
|
1025
1039
|
* It gives the server hints that can be used to route the request
|
|
1026
1040
|
* to an appropriate server, potentially significantly decreasing latency and
|
|
@@ -1071,6 +1085,35 @@ export declare class SpannerClient {
|
|
|
1071
1085
|
* for more details and examples.
|
|
1072
1086
|
*/
|
|
1073
1087
|
batchWrite(request?: protos.google.spanner.v1.IBatchWriteRequest, options?: CallOptions): gax.CancellableStream;
|
|
1088
|
+
/**
|
|
1089
|
+
* Retrieves a cache update for a given database.
|
|
1090
|
+
*
|
|
1091
|
+
* This RPC can be used to warm up the client cache by fetching key recipes
|
|
1092
|
+
* and server information for a given database. It is recommended to call
|
|
1093
|
+
* this RPC at the beginning of the client's lifecycle, prior to any other
|
|
1094
|
+
* data plane operations.
|
|
1095
|
+
*
|
|
1096
|
+
* The cache update is returned as a stream because the response can be too
|
|
1097
|
+
* large to fit into a single `CacheUpdate` message.
|
|
1098
|
+
*
|
|
1099
|
+
* @param {Object} request
|
|
1100
|
+
* The request object that will be sent.
|
|
1101
|
+
* @param {string} request.database
|
|
1102
|
+
* Required. The database for which to retrieve the cache update.
|
|
1103
|
+
* @param {number} [request.maxRecipeCount]
|
|
1104
|
+
* Optional. The maximum number of key recipes to return in the response.
|
|
1105
|
+
* If not set, a default limit of 100 will be used.
|
|
1106
|
+
* @param {number} [request.maxRangeCount]
|
|
1107
|
+
* Optional. The maximum number of ranges to return in the response.
|
|
1108
|
+
* If not set, a default limit of 10000 will be used.
|
|
1109
|
+
* @param {object} [options]
|
|
1110
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
1111
|
+
* @returns {Stream}
|
|
1112
|
+
* An object stream which emits {@link protos.google.spanner.v1.CacheUpdate|CacheUpdate} on 'data' event.
|
|
1113
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation }
|
|
1114
|
+
* for more details and examples.
|
|
1115
|
+
*/
|
|
1116
|
+
fetchCacheUpdate(request?: protos.google.spanner.v1.IFetchCacheUpdateRequest, options?: CallOptions): gax.CancellableStream;
|
|
1074
1117
|
/**
|
|
1075
1118
|
* Lists all sessions in a given database.
|
|
1076
1119
|
*
|
|
@@ -185,6 +185,7 @@ class SpannerClient {
|
|
|
185
185
|
executeStreamingSql: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries),
|
|
186
186
|
streamingRead: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries),
|
|
187
187
|
batchWrite: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries),
|
|
188
|
+
fetchCacheUpdate: new this._gaxModule.StreamDescriptor(this._gaxModule.StreamType.SERVER_STREAMING, !!opts.fallback, !!opts.gaxServerStreamingRetries),
|
|
188
189
|
};
|
|
189
190
|
// Put together the default options sent with requests.
|
|
190
191
|
this._defaults = this._gaxGrpc.constructSettings('google.spanner.v1.Spanner', gapicConfig, opts.clientConfig || {}, { 'x-goog-api-client': clientHeader.join(' ') });
|
|
@@ -236,6 +237,7 @@ class SpannerClient {
|
|
|
236
237
|
'partitionQuery',
|
|
237
238
|
'partitionRead',
|
|
238
239
|
'batchWrite',
|
|
240
|
+
'fetchCacheUpdate',
|
|
239
241
|
];
|
|
240
242
|
for (const methodName of spannerStubMethods) {
|
|
241
243
|
const callPromise = this.spannerStub.then(stub => (...args) => {
|
|
@@ -945,7 +947,7 @@ class SpannerClient {
|
|
|
945
947
|
* constraints). Given this, successful execution of a DML statement shouldn't
|
|
946
948
|
* be assumed until a subsequent `Commit` call completes successfully.
|
|
947
949
|
* @param {google.spanner.v1.RoutingHint} [request.routingHint]
|
|
948
|
-
* Optional.
|
|
950
|
+
* Optional. Makes the Spanner requests location-aware if present.
|
|
949
951
|
*
|
|
950
952
|
* It gives the server hints that can be used to route the request
|
|
951
953
|
* to an appropriate server, potentially significantly decreasing latency and
|
|
@@ -1055,7 +1057,7 @@ class SpannerClient {
|
|
|
1055
1057
|
* Optional. Lock Hint for the request, it can only be used with read-write
|
|
1056
1058
|
* transactions.
|
|
1057
1059
|
* @param {google.spanner.v1.RoutingHint} [request.routingHint]
|
|
1058
|
-
* Optional.
|
|
1060
|
+
* Optional. Makes the Spanner requests location-aware if present.
|
|
1059
1061
|
*
|
|
1060
1062
|
* It gives the server hints that can be used to route the request
|
|
1061
1063
|
* to an appropriate server, potentially significantly decreasing latency and
|
|
@@ -1134,6 +1136,49 @@ class SpannerClient {
|
|
|
1134
1136
|
this._log.info('batchWrite stream %j', options);
|
|
1135
1137
|
return this.innerApiCalls.batchWrite(request, options);
|
|
1136
1138
|
}
|
|
1139
|
+
/**
|
|
1140
|
+
* Retrieves a cache update for a given database.
|
|
1141
|
+
*
|
|
1142
|
+
* This RPC can be used to warm up the client cache by fetching key recipes
|
|
1143
|
+
* and server information for a given database. It is recommended to call
|
|
1144
|
+
* this RPC at the beginning of the client's lifecycle, prior to any other
|
|
1145
|
+
* data plane operations.
|
|
1146
|
+
*
|
|
1147
|
+
* The cache update is returned as a stream because the response can be too
|
|
1148
|
+
* large to fit into a single `CacheUpdate` message.
|
|
1149
|
+
*
|
|
1150
|
+
* @param {Object} request
|
|
1151
|
+
* The request object that will be sent.
|
|
1152
|
+
* @param {string} request.database
|
|
1153
|
+
* Required. The database for which to retrieve the cache update.
|
|
1154
|
+
* @param {number} [request.maxRecipeCount]
|
|
1155
|
+
* Optional. The maximum number of key recipes to return in the response.
|
|
1156
|
+
* If not set, a default limit of 100 will be used.
|
|
1157
|
+
* @param {number} [request.maxRangeCount]
|
|
1158
|
+
* Optional. The maximum number of ranges to return in the response.
|
|
1159
|
+
* If not set, a default limit of 10000 will be used.
|
|
1160
|
+
* @param {object} [options]
|
|
1161
|
+
* Call options. See {@link https://googleapis.dev/nodejs/google-gax/latest/interfaces/CallOptions.html|CallOptions} for more details.
|
|
1162
|
+
* @returns {Stream}
|
|
1163
|
+
* An object stream which emits {@link protos.google.spanner.v1.CacheUpdate|CacheUpdate} on 'data' event.
|
|
1164
|
+
* Please see the {@link https://github.com/googleapis/gax-nodejs/blob/master/client-libraries.md#server-streaming | documentation }
|
|
1165
|
+
* for more details and examples.
|
|
1166
|
+
*/
|
|
1167
|
+
fetchCacheUpdate(request, options) {
|
|
1168
|
+
request = request || {};
|
|
1169
|
+
options = options || {};
|
|
1170
|
+
options.otherArgs = options.otherArgs || {};
|
|
1171
|
+
options.otherArgs.headers = options.otherArgs.headers || {};
|
|
1172
|
+
options.otherArgs.headers['x-goog-request-params'] =
|
|
1173
|
+
this._gaxModule.routingHeader.fromParams({
|
|
1174
|
+
database: request.database ?? '',
|
|
1175
|
+
});
|
|
1176
|
+
this.initialize().catch(err => {
|
|
1177
|
+
throw err;
|
|
1178
|
+
});
|
|
1179
|
+
this._log.info('fetchCacheUpdate stream %j', options);
|
|
1180
|
+
return this.innerApiCalls.fetchCacheUpdate(request, options);
|
|
1181
|
+
}
|
|
1137
1182
|
listSessions(request, optionsOrCallback, callback) {
|
|
1138
1183
|
request = request || {};
|
|
1139
1184
|
let options;
|
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": "8.
|
|
4
|
+
"version": "8.8.1",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Google Inc.",
|
|
7
7
|
"engines": {
|
|
@@ -34,8 +34,6 @@
|
|
|
34
34
|
"docs": "jsdoc -c .jsdoc.js",
|
|
35
35
|
"predocs": "npm run compile",
|
|
36
36
|
"lint": "gts check",
|
|
37
|
-
"samples-test-with-archived": "cd samples/ && npm link ../ && npm test-with-archived && cd ../",
|
|
38
|
-
"samples-test": "cd samples/ && npm link ../ && npm test && cd ../",
|
|
39
37
|
"system-test": "mocha build/system-test --timeout 1600000",
|
|
40
38
|
"observability-test": "mocha build/observability-test --timeout 1600000",
|
|
41
39
|
"cleanup": "mocha scripts/cleanup.js --timeout 30000",
|
|
@@ -49,10 +47,7 @@
|
|
|
49
47
|
"presystem-test": "npm run compile",
|
|
50
48
|
"preobservability-test": "npm run compile",
|
|
51
49
|
"proto": "compileProtos src",
|
|
52
|
-
"docs-test": "linkinator docs",
|
|
53
|
-
"predocs-test": "npm run docs",
|
|
54
50
|
"benchwrapper": "node bin/benchwrapper.js",
|
|
55
|
-
"prelint": "cd samples; npm link ../; npm install",
|
|
56
51
|
"precompile": "gts clean",
|
|
57
52
|
"compile-protos": "compileProtos src",
|
|
58
53
|
"coverage": "c8 mocha build/test build/test/common && c8 report --check-coverage"
|
|
@@ -65,7 +60,6 @@
|
|
|
65
60
|
"@google-cloud/monitoring": "^5.0.0",
|
|
66
61
|
"@google-cloud/opentelemetry-resource-util": "^2.4.0",
|
|
67
62
|
"@google-cloud/precise-date": "^5.0.0",
|
|
68
|
-
"@google-cloud/projectify": "^5.0.0",
|
|
69
63
|
"@google-cloud/promisify": "^5.0.0",
|
|
70
64
|
"@grpc/grpc-js": "^1.13.2",
|
|
71
65
|
"@grpc/proto-loader": "^0.8.0",
|
|
@@ -94,8 +88,7 @@
|
|
|
94
88
|
"stack-trace": "0.0.10",
|
|
95
89
|
"stream-events": "^1.0.5",
|
|
96
90
|
"teeny-request": "^10.0.0",
|
|
97
|
-
"through2": "^4.0.2"
|
|
98
|
-
"uuid": "^11.1.0"
|
|
91
|
+
"through2": "^4.0.2"
|
|
99
92
|
},
|
|
100
93
|
"devDependencies": {
|
|
101
94
|
"@grpc/reflection": "^1.0.4",
|
|
@@ -128,7 +121,6 @@
|
|
|
128
121
|
"jsdoc": "^4.0.4",
|
|
129
122
|
"jsdoc-fresh": "^5.0.0",
|
|
130
123
|
"jsdoc-region-tag": "^4.0.0",
|
|
131
|
-
"linkinator": "^6.1.2",
|
|
132
124
|
"lodash.random": "^3.2.0",
|
|
133
125
|
"long": "^5.3.2",
|
|
134
126
|
"mocha": "^11.1.0",
|
|
@@ -156,4 +148,4 @@
|
|
|
156
148
|
}
|
|
157
149
|
},
|
|
158
150
|
"homepage": "https://github.com/googleapis/google-cloud-node/tree/main/handwritten/spanner"
|
|
159
|
-
}
|
|
151
|
+
}
|