@google-cloud/spanner 7.16.0 → 7.17.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/CHANGELOG.md +20 -0
- package/README.md +2 -0
- package/build/protos/google/spanner/v1/spanner.proto +22 -0
- package/build/protos/protos.d.ts +13 -1
- package/build/protos/protos.js +47 -1
- package/build/protos/protos.json +14 -0
- package/build/src/common.d.ts +8 -0
- package/build/src/common.js +19 -1
- package/build/src/database.d.ts +7 -1
- package/build/src/database.js +61 -57
- package/build/src/helper.d.ts +45 -0
- package/build/src/helper.js +71 -0
- package/build/src/index.d.ts +1 -1
- package/build/src/index.js +17 -11
- package/build/src/instance-config.d.ts +1 -0
- package/build/src/instance.d.ts +2 -1
- package/build/src/instance.js +12 -13
- package/build/src/instrument.d.ts +1 -0
- package/build/src/multiplexed-session.d.ts +136 -0
- package/build/src/multiplexed-session.js +197 -0
- package/build/src/session-factory.d.ts +101 -0
- package/build/src/session-factory.js +93 -0
- package/build/src/session-pool.d.ts +1 -39
- package/build/src/session-pool.js +6 -58
- package/build/src/session.d.ts +2 -1
- package/build/src/session.js +5 -6
- package/build/src/transaction.d.ts +1 -1
- package/build/src/transaction.js +8 -9
- package/build/src/v1/spanner_client.d.ts +30 -0
- package/build/src/v1/spanner_client.js +10 -0
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,26 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/nodejs-spanner?activeTab=versions
|
|
6
6
|
|
|
7
|
+
## [7.17.1](https://github.com/googleapis/nodejs-spanner/compare/v7.17.0...v7.17.1) (2025-01-03)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### Bug Fixes
|
|
11
|
+
|
|
12
|
+
* Remove default global trace context propagator ([#2209](https://github.com/googleapis/nodejs-spanner/issues/2209)) ([7898e0c](https://github.com/googleapis/nodejs-spanner/commit/7898e0ce0477e2d4327822ac26a2674203b47a64)), closes [#2208](https://github.com/googleapis/nodejs-spanner/issues/2208)
|
|
13
|
+
|
|
14
|
+
## [7.17.0](https://github.com/googleapis/nodejs-spanner/compare/v7.16.0...v7.17.0) (2024-12-27)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* Add the last statement option to ExecuteSqlRequest and ExecuteBatchDmlRequest ([#2196](https://github.com/googleapis/nodejs-spanner/issues/2196)) ([223f167](https://github.com/googleapis/nodejs-spanner/commit/223f167c1c9bc4da26155637eabbcabce5487ede))
|
|
20
|
+
* Enable e2e tracing ([#2202](https://github.com/googleapis/nodejs-spanner/issues/2202)) ([3cc257e](https://github.com/googleapis/nodejs-spanner/commit/3cc257e99925594776b9a1886f0173ce2dfe904f))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
### Bug Fixes
|
|
24
|
+
|
|
25
|
+
* Span events Issue 2166 ([#2184](https://github.com/googleapis/nodejs-spanner/issues/2184)) ([97ed577](https://github.com/googleapis/nodejs-spanner/commit/97ed5776dbdf5e90f8398fffea08e2a968045f9b))
|
|
26
|
+
|
|
7
27
|
## [7.16.0](https://github.com/googleapis/nodejs-spanner/compare/v7.15.0...v7.16.0) (2024-11-09)
|
|
8
28
|
|
|
9
29
|
|
package/README.md
CHANGED
|
@@ -109,6 +109,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-spanner/tre
|
|
|
109
109
|
| Batch | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/batch.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/batch.js,samples/README.md) |
|
|
110
110
|
| Creates a full backup schedule | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/create-full-backup-schedule.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/create-full-backup-schedule.js,samples/README.md) |
|
|
111
111
|
| Creates an incremental backup schedule | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/create-incremental-backup-schedule.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/create-incremental-backup-schedule.js,samples/README.md) |
|
|
112
|
+
| Create-instance-without-default-backup-schedules | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/create-instance-without-default-backup-schedules.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/create-instance-without-default-backup-schedules.js,samples/README.md) |
|
|
112
113
|
| CRUD | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/crud.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/crud.js,samples/README.md) |
|
|
113
114
|
| Creates a new database with a specific default leader | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/database-create-with-default-leader.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/database-create-with-default-leader.js,samples/README.md) |
|
|
114
115
|
| Database-create-with-encryption-key | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/database-create-with-encryption-key.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/database-create-with-encryption-key.js,samples/README.md) |
|
|
@@ -206,6 +207,7 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-spanner/tre
|
|
|
206
207
|
| Executes a read/write transaction with transaction and request tags | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/transaction-tag.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/transaction-tag.js,samples/README.md) |
|
|
207
208
|
| Transaction | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/transaction.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/transaction.js,samples/README.md) |
|
|
208
209
|
| Updates a backup schedule | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/update-backup-schedule.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/update-backup-schedule.js,samples/README.md) |
|
|
210
|
+
| Updates an instance. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/update-instance-default-backup-schedule-type.js) | [![Open in Cloud Shell][shell_img]](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/googleapis/nodejs-spanner&page=editor&open_in_editor=samples/update-instance-default-backup-schedule-type.js,samples/README.md) |
|
|
209
211
|
|
|
210
212
|
|
|
211
213
|
|
|
@@ -792,6 +792,17 @@ message ExecuteSqlRequest {
|
|
|
792
792
|
// If the field is set to `true` but the request does not set
|
|
793
793
|
// `partition_token`, the API returns an `INVALID_ARGUMENT` error.
|
|
794
794
|
bool data_boost_enabled = 16;
|
|
795
|
+
|
|
796
|
+
// Optional. If set to true, this statement marks the end of the transaction.
|
|
797
|
+
// The transaction should be committed or aborted after this statement
|
|
798
|
+
// executes, and attempts to execute any other requests against this
|
|
799
|
+
// transaction (including reads and queries) will be rejected.
|
|
800
|
+
//
|
|
801
|
+
// For DML statements, setting this option may cause some error reporting to
|
|
802
|
+
// be deferred until commit time (e.g. validation of unique constraints).
|
|
803
|
+
// Given this, successful execution of a DML statement should not be assumed
|
|
804
|
+
// until a subsequent Commit call completes successfully.
|
|
805
|
+
bool last_statement = 17 [(google.api.field_behavior) = OPTIONAL];
|
|
795
806
|
}
|
|
796
807
|
|
|
797
808
|
// The request for [ExecuteBatchDml][google.spanner.v1.Spanner.ExecuteBatchDml].
|
|
@@ -861,6 +872,17 @@ message ExecuteBatchDmlRequest {
|
|
|
861
872
|
|
|
862
873
|
// Common options for this request.
|
|
863
874
|
RequestOptions request_options = 5;
|
|
875
|
+
|
|
876
|
+
// Optional. If set to true, this request marks the end of the transaction.
|
|
877
|
+
// The transaction should be committed or aborted after these statements
|
|
878
|
+
// execute, and attempts to execute any other requests against this
|
|
879
|
+
// transaction (including reads and queries) will be rejected.
|
|
880
|
+
//
|
|
881
|
+
// Setting this option may cause some error reporting to be deferred until
|
|
882
|
+
// commit time (e.g. validation of unique constraints). Given this, successful
|
|
883
|
+
// execution of statements should not be assumed until a subsequent Commit
|
|
884
|
+
// call completes successfully.
|
|
885
|
+
bool last_statements = 6 [(google.api.field_behavior) = OPTIONAL];
|
|
864
886
|
}
|
|
865
887
|
|
|
866
888
|
// The response for
|
package/build/protos/protos.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2025 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.
|
|
@@ -29515,6 +29515,9 @@ export namespace google {
|
|
|
29515
29515
|
|
|
29516
29516
|
/** ExecuteSqlRequest dataBoostEnabled */
|
|
29517
29517
|
dataBoostEnabled?: (boolean|null);
|
|
29518
|
+
|
|
29519
|
+
/** ExecuteSqlRequest lastStatement */
|
|
29520
|
+
lastStatement?: (boolean|null);
|
|
29518
29521
|
}
|
|
29519
29522
|
|
|
29520
29523
|
/** Represents an ExecuteSqlRequest. */
|
|
@@ -29565,6 +29568,9 @@ export namespace google {
|
|
|
29565
29568
|
/** ExecuteSqlRequest dataBoostEnabled. */
|
|
29566
29569
|
public dataBoostEnabled: boolean;
|
|
29567
29570
|
|
|
29571
|
+
/** ExecuteSqlRequest lastStatement. */
|
|
29572
|
+
public lastStatement: boolean;
|
|
29573
|
+
|
|
29568
29574
|
/**
|
|
29569
29575
|
* Creates a new ExecuteSqlRequest instance using the specified properties.
|
|
29570
29576
|
* @param [properties] Properties to set
|
|
@@ -29775,6 +29781,9 @@ export namespace google {
|
|
|
29775
29781
|
|
|
29776
29782
|
/** ExecuteBatchDmlRequest requestOptions */
|
|
29777
29783
|
requestOptions?: (google.spanner.v1.IRequestOptions|null);
|
|
29784
|
+
|
|
29785
|
+
/** ExecuteBatchDmlRequest lastStatements */
|
|
29786
|
+
lastStatements?: (boolean|null);
|
|
29778
29787
|
}
|
|
29779
29788
|
|
|
29780
29789
|
/** Represents an ExecuteBatchDmlRequest. */
|
|
@@ -29801,6 +29810,9 @@ export namespace google {
|
|
|
29801
29810
|
/** ExecuteBatchDmlRequest requestOptions. */
|
|
29802
29811
|
public requestOptions?: (google.spanner.v1.IRequestOptions|null);
|
|
29803
29812
|
|
|
29813
|
+
/** ExecuteBatchDmlRequest lastStatements. */
|
|
29814
|
+
public lastStatements: boolean;
|
|
29815
|
+
|
|
29804
29816
|
/**
|
|
29805
29817
|
* Creates a new ExecuteBatchDmlRequest instance using the specified properties.
|
|
29806
29818
|
* @param [properties] Properties to set
|
package/build/protos/protos.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Copyright
|
|
1
|
+
// Copyright 2025 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.
|
|
@@ -75067,6 +75067,7 @@
|
|
|
75067
75067
|
* @property {google.spanner.v1.IRequestOptions|null} [requestOptions] ExecuteSqlRequest requestOptions
|
|
75068
75068
|
* @property {google.spanner.v1.IDirectedReadOptions|null} [directedReadOptions] ExecuteSqlRequest directedReadOptions
|
|
75069
75069
|
* @property {boolean|null} [dataBoostEnabled] ExecuteSqlRequest dataBoostEnabled
|
|
75070
|
+
* @property {boolean|null} [lastStatement] ExecuteSqlRequest lastStatement
|
|
75070
75071
|
*/
|
|
75071
75072
|
|
|
75072
75073
|
/**
|
|
@@ -75189,6 +75190,14 @@
|
|
|
75189
75190
|
*/
|
|
75190
75191
|
ExecuteSqlRequest.prototype.dataBoostEnabled = false;
|
|
75191
75192
|
|
|
75193
|
+
/**
|
|
75194
|
+
* ExecuteSqlRequest lastStatement.
|
|
75195
|
+
* @member {boolean} lastStatement
|
|
75196
|
+
* @memberof google.spanner.v1.ExecuteSqlRequest
|
|
75197
|
+
* @instance
|
|
75198
|
+
*/
|
|
75199
|
+
ExecuteSqlRequest.prototype.lastStatement = false;
|
|
75200
|
+
|
|
75192
75201
|
/**
|
|
75193
75202
|
* Creates a new ExecuteSqlRequest instance using the specified properties.
|
|
75194
75203
|
* @function create
|
|
@@ -75242,6 +75251,8 @@
|
|
|
75242
75251
|
$root.google.spanner.v1.DirectedReadOptions.encode(message.directedReadOptions, writer.uint32(/* id 15, wireType 2 =*/122).fork()).ldelim();
|
|
75243
75252
|
if (message.dataBoostEnabled != null && Object.hasOwnProperty.call(message, "dataBoostEnabled"))
|
|
75244
75253
|
writer.uint32(/* id 16, wireType 0 =*/128).bool(message.dataBoostEnabled);
|
|
75254
|
+
if (message.lastStatement != null && Object.hasOwnProperty.call(message, "lastStatement"))
|
|
75255
|
+
writer.uint32(/* id 17, wireType 0 =*/136).bool(message.lastStatement);
|
|
75245
75256
|
return writer;
|
|
75246
75257
|
};
|
|
75247
75258
|
|
|
@@ -75347,6 +75358,10 @@
|
|
|
75347
75358
|
message.dataBoostEnabled = reader.bool();
|
|
75348
75359
|
break;
|
|
75349
75360
|
}
|
|
75361
|
+
case 17: {
|
|
75362
|
+
message.lastStatement = reader.bool();
|
|
75363
|
+
break;
|
|
75364
|
+
}
|
|
75350
75365
|
default:
|
|
75351
75366
|
reader.skipType(tag & 7);
|
|
75352
75367
|
break;
|
|
@@ -75446,6 +75461,9 @@
|
|
|
75446
75461
|
if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled"))
|
|
75447
75462
|
if (typeof message.dataBoostEnabled !== "boolean")
|
|
75448
75463
|
return "dataBoostEnabled: boolean expected";
|
|
75464
|
+
if (message.lastStatement != null && message.hasOwnProperty("lastStatement"))
|
|
75465
|
+
if (typeof message.lastStatement !== "boolean")
|
|
75466
|
+
return "lastStatement: boolean expected";
|
|
75449
75467
|
return null;
|
|
75450
75468
|
};
|
|
75451
75469
|
|
|
@@ -75549,6 +75567,8 @@
|
|
|
75549
75567
|
}
|
|
75550
75568
|
if (object.dataBoostEnabled != null)
|
|
75551
75569
|
message.dataBoostEnabled = Boolean(object.dataBoostEnabled);
|
|
75570
|
+
if (object.lastStatement != null)
|
|
75571
|
+
message.lastStatement = Boolean(object.lastStatement);
|
|
75552
75572
|
return message;
|
|
75553
75573
|
};
|
|
75554
75574
|
|
|
@@ -75596,6 +75616,7 @@
|
|
|
75596
75616
|
object.requestOptions = null;
|
|
75597
75617
|
object.directedReadOptions = null;
|
|
75598
75618
|
object.dataBoostEnabled = false;
|
|
75619
|
+
object.lastStatement = false;
|
|
75599
75620
|
}
|
|
75600
75621
|
if (message.session != null && message.hasOwnProperty("session"))
|
|
75601
75622
|
object.session = message.session;
|
|
@@ -75630,6 +75651,8 @@
|
|
|
75630
75651
|
object.directedReadOptions = $root.google.spanner.v1.DirectedReadOptions.toObject(message.directedReadOptions, options);
|
|
75631
75652
|
if (message.dataBoostEnabled != null && message.hasOwnProperty("dataBoostEnabled"))
|
|
75632
75653
|
object.dataBoostEnabled = message.dataBoostEnabled;
|
|
75654
|
+
if (message.lastStatement != null && message.hasOwnProperty("lastStatement"))
|
|
75655
|
+
object.lastStatement = message.lastStatement;
|
|
75633
75656
|
return object;
|
|
75634
75657
|
};
|
|
75635
75658
|
|
|
@@ -75920,6 +75943,7 @@
|
|
|
75920
75943
|
* @property {Array.<google.spanner.v1.ExecuteBatchDmlRequest.IStatement>|null} [statements] ExecuteBatchDmlRequest statements
|
|
75921
75944
|
* @property {number|Long|null} [seqno] ExecuteBatchDmlRequest seqno
|
|
75922
75945
|
* @property {google.spanner.v1.IRequestOptions|null} [requestOptions] ExecuteBatchDmlRequest requestOptions
|
|
75946
|
+
* @property {boolean|null} [lastStatements] ExecuteBatchDmlRequest lastStatements
|
|
75923
75947
|
*/
|
|
75924
75948
|
|
|
75925
75949
|
/**
|
|
@@ -75978,6 +76002,14 @@
|
|
|
75978
76002
|
*/
|
|
75979
76003
|
ExecuteBatchDmlRequest.prototype.requestOptions = null;
|
|
75980
76004
|
|
|
76005
|
+
/**
|
|
76006
|
+
* ExecuteBatchDmlRequest lastStatements.
|
|
76007
|
+
* @member {boolean} lastStatements
|
|
76008
|
+
* @memberof google.spanner.v1.ExecuteBatchDmlRequest
|
|
76009
|
+
* @instance
|
|
76010
|
+
*/
|
|
76011
|
+
ExecuteBatchDmlRequest.prototype.lastStatements = false;
|
|
76012
|
+
|
|
75981
76013
|
/**
|
|
75982
76014
|
* Creates a new ExecuteBatchDmlRequest instance using the specified properties.
|
|
75983
76015
|
* @function create
|
|
@@ -76013,6 +76045,8 @@
|
|
|
76013
76045
|
writer.uint32(/* id 4, wireType 0 =*/32).int64(message.seqno);
|
|
76014
76046
|
if (message.requestOptions != null && Object.hasOwnProperty.call(message, "requestOptions"))
|
|
76015
76047
|
$root.google.spanner.v1.RequestOptions.encode(message.requestOptions, writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim();
|
|
76048
|
+
if (message.lastStatements != null && Object.hasOwnProperty.call(message, "lastStatements"))
|
|
76049
|
+
writer.uint32(/* id 6, wireType 0 =*/48).bool(message.lastStatements);
|
|
76016
76050
|
return writer;
|
|
76017
76051
|
};
|
|
76018
76052
|
|
|
@@ -76069,6 +76103,10 @@
|
|
|
76069
76103
|
message.requestOptions = $root.google.spanner.v1.RequestOptions.decode(reader, reader.uint32());
|
|
76070
76104
|
break;
|
|
76071
76105
|
}
|
|
76106
|
+
case 6: {
|
|
76107
|
+
message.lastStatements = reader.bool();
|
|
76108
|
+
break;
|
|
76109
|
+
}
|
|
76072
76110
|
default:
|
|
76073
76111
|
reader.skipType(tag & 7);
|
|
76074
76112
|
break;
|
|
@@ -76129,6 +76167,9 @@
|
|
|
76129
76167
|
if (error)
|
|
76130
76168
|
return "requestOptions." + error;
|
|
76131
76169
|
}
|
|
76170
|
+
if (message.lastStatements != null && message.hasOwnProperty("lastStatements"))
|
|
76171
|
+
if (typeof message.lastStatements !== "boolean")
|
|
76172
|
+
return "lastStatements: boolean expected";
|
|
76132
76173
|
return null;
|
|
76133
76174
|
};
|
|
76134
76175
|
|
|
@@ -76175,6 +76216,8 @@
|
|
|
76175
76216
|
throw TypeError(".google.spanner.v1.ExecuteBatchDmlRequest.requestOptions: object expected");
|
|
76176
76217
|
message.requestOptions = $root.google.spanner.v1.RequestOptions.fromObject(object.requestOptions);
|
|
76177
76218
|
}
|
|
76219
|
+
if (object.lastStatements != null)
|
|
76220
|
+
message.lastStatements = Boolean(object.lastStatements);
|
|
76178
76221
|
return message;
|
|
76179
76222
|
};
|
|
76180
76223
|
|
|
@@ -76202,6 +76245,7 @@
|
|
|
76202
76245
|
} else
|
|
76203
76246
|
object.seqno = options.longs === String ? "0" : 0;
|
|
76204
76247
|
object.requestOptions = null;
|
|
76248
|
+
object.lastStatements = false;
|
|
76205
76249
|
}
|
|
76206
76250
|
if (message.session != null && message.hasOwnProperty("session"))
|
|
76207
76251
|
object.session = message.session;
|
|
@@ -76219,6 +76263,8 @@
|
|
|
76219
76263
|
object.seqno = options.longs === String ? $util.Long.prototype.toString.call(message.seqno) : options.longs === Number ? new $util.LongBits(message.seqno.low >>> 0, message.seqno.high >>> 0).toNumber() : message.seqno;
|
|
76220
76264
|
if (message.requestOptions != null && message.hasOwnProperty("requestOptions"))
|
|
76221
76265
|
object.requestOptions = $root.google.spanner.v1.RequestOptions.toObject(message.requestOptions, options);
|
|
76266
|
+
if (message.lastStatements != null && message.hasOwnProperty("lastStatements"))
|
|
76267
|
+
object.lastStatements = message.lastStatements;
|
|
76222
76268
|
return object;
|
|
76223
76269
|
};
|
|
76224
76270
|
|
package/build/protos/protos.json
CHANGED
|
@@ -8065,6 +8065,13 @@
|
|
|
8065
8065
|
"dataBoostEnabled": {
|
|
8066
8066
|
"type": "bool",
|
|
8067
8067
|
"id": 16
|
|
8068
|
+
},
|
|
8069
|
+
"lastStatement": {
|
|
8070
|
+
"type": "bool",
|
|
8071
|
+
"id": 17,
|
|
8072
|
+
"options": {
|
|
8073
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
8074
|
+
}
|
|
8068
8075
|
}
|
|
8069
8076
|
},
|
|
8070
8077
|
"nested": {
|
|
@@ -8126,6 +8133,13 @@
|
|
|
8126
8133
|
"requestOptions": {
|
|
8127
8134
|
"type": "RequestOptions",
|
|
8128
8135
|
"id": 5
|
|
8136
|
+
},
|
|
8137
|
+
"lastStatements": {
|
|
8138
|
+
"type": "bool",
|
|
8139
|
+
"id": 6,
|
|
8140
|
+
"options": {
|
|
8141
|
+
"(google.api.field_behavior)": "OPTIONAL"
|
|
8142
|
+
}
|
|
8129
8143
|
}
|
|
8130
8144
|
},
|
|
8131
8145
|
"nested": {
|
package/build/src/common.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ export declare const CLOUD_RESOURCE_HEADER = "google-cloud-resource-prefix";
|
|
|
49
49
|
* HTTP header to route the requests at Leader
|
|
50
50
|
*/
|
|
51
51
|
export declare const LEADER_AWARE_ROUTING_HEADER = "x-goog-spanner-route-to-leader";
|
|
52
|
+
export declare const END_TO_END_TRACING_HEADER = "x-goog-spanner-end-to-end-tracing";
|
|
52
53
|
/**
|
|
53
54
|
* Add Leader aware routing header to existing header list.
|
|
54
55
|
* @param headers Existing header list.
|
|
@@ -56,3 +57,10 @@ export declare const LEADER_AWARE_ROUTING_HEADER = "x-goog-spanner-route-to-lead
|
|
|
56
57
|
export declare function addLeaderAwareRoutingHeader(headers: {
|
|
57
58
|
[k: string]: string;
|
|
58
59
|
}): void;
|
|
60
|
+
/**
|
|
61
|
+
* Returns common headers to add.
|
|
62
|
+
* @param headers Common header list.
|
|
63
|
+
*/
|
|
64
|
+
export declare function getCommonHeaders(resourceName: string, enableTracing?: boolean): {
|
|
65
|
+
[k: string]: string;
|
|
66
|
+
};
|
package/build/src/common.js
CHANGED
|
@@ -15,8 +15,9 @@
|
|
|
15
15
|
* limitations under the License.
|
|
16
16
|
*/
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.LEADER_AWARE_ROUTING_HEADER = exports.CLOUD_RESOURCE_HEADER = void 0;
|
|
18
|
+
exports.END_TO_END_TRACING_HEADER = exports.LEADER_AWARE_ROUTING_HEADER = exports.CLOUD_RESOURCE_HEADER = void 0;
|
|
19
19
|
exports.addLeaderAwareRoutingHeader = addLeaderAwareRoutingHeader;
|
|
20
|
+
exports.getCommonHeaders = getCommonHeaders;
|
|
20
21
|
/*!
|
|
21
22
|
* HTTP header for the resource prefix to improve routing
|
|
22
23
|
* by the backend.
|
|
@@ -26,6 +27,10 @@ exports.CLOUD_RESOURCE_HEADER = 'google-cloud-resource-prefix';
|
|
|
26
27
|
* HTTP header to route the requests at Leader
|
|
27
28
|
*/
|
|
28
29
|
exports.LEADER_AWARE_ROUTING_HEADER = 'x-goog-spanner-route-to-leader';
|
|
30
|
+
/*
|
|
31
|
+
* END TO END TRACING header.
|
|
32
|
+
*/
|
|
33
|
+
exports.END_TO_END_TRACING_HEADER = 'x-goog-spanner-end-to-end-tracing';
|
|
29
34
|
/**
|
|
30
35
|
* Add Leader aware routing header to existing header list.
|
|
31
36
|
* @param headers Existing header list.
|
|
@@ -33,4 +38,17 @@ exports.LEADER_AWARE_ROUTING_HEADER = 'x-goog-spanner-route-to-leader';
|
|
|
33
38
|
function addLeaderAwareRoutingHeader(headers) {
|
|
34
39
|
headers[exports.LEADER_AWARE_ROUTING_HEADER] = 'true';
|
|
35
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Returns common headers to add.
|
|
43
|
+
* @param headers Common header list.
|
|
44
|
+
*/
|
|
45
|
+
function getCommonHeaders(resourceName, enableTracing) {
|
|
46
|
+
const headers = {};
|
|
47
|
+
if (process.env.SPANNER_ENABLE_END_TO_END_TRACING === 'true' ||
|
|
48
|
+
enableTracing) {
|
|
49
|
+
headers[exports.END_TO_END_TRACING_HEADER] = 'true';
|
|
50
|
+
}
|
|
51
|
+
headers[exports.CLOUD_RESOURCE_HEADER] = resourceName;
|
|
52
|
+
return headers;
|
|
53
|
+
}
|
|
36
54
|
//# sourceMappingURL=common.js.map
|
package/build/src/database.d.ts
CHANGED
|
@@ -18,6 +18,7 @@ declare const common: any;
|
|
|
18
18
|
import * as r from 'teeny-request';
|
|
19
19
|
import { CallOptions, Operation as GaxOperation } from 'google-gax';
|
|
20
20
|
import { BatchTransaction, TransactionIdentifier } from './batch-transaction';
|
|
21
|
+
import { SessionFactoryInterface } from './session-factory';
|
|
21
22
|
import { google as databaseAdmin, google, google as spannerClient } from '../protos/protos';
|
|
22
23
|
import { GetDatabaseOperationsOptions, GetDatabaseOperationsResponse, Instance, GetDatabaseOperationsCallback } from './instance';
|
|
23
24
|
import { PartialResultStream } from './partial-result-stream';
|
|
@@ -167,15 +168,20 @@ export interface RestoreOptions {
|
|
|
167
168
|
* ```
|
|
168
169
|
*/
|
|
169
170
|
declare class Database extends common.GrpcServiceObject {
|
|
171
|
+
static [x: string]: any;
|
|
170
172
|
private instance;
|
|
171
173
|
formattedName_: string;
|
|
172
174
|
pool_: SessionPoolInterface;
|
|
175
|
+
sessionFactory_: SessionFactoryInterface;
|
|
173
176
|
queryOptions_?: spannerClient.spanner.v1.ExecuteSqlRequest.IQueryOptions;
|
|
174
|
-
|
|
177
|
+
commonHeaders_: {
|
|
175
178
|
[k: string]: string;
|
|
176
179
|
};
|
|
177
180
|
request: DatabaseRequest;
|
|
178
181
|
databaseRole?: string | null;
|
|
182
|
+
labels?: {
|
|
183
|
+
[k: string]: string;
|
|
184
|
+
} | null;
|
|
179
185
|
databaseDialect?: EnumKey<typeof databaseAdmin.spanner.admin.database.v1.DatabaseDialect> | null;
|
|
180
186
|
_observabilityOptions?: ObservabilityOptions;
|
|
181
187
|
private _traceConfig;
|