@google-cloud/spanner 6.15.0 → 7.0.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 +28 -0
- package/README.md +7 -1
- package/build/src/transaction.d.ts +4 -3
- package/build/src/transaction.js +20 -7
- package/package.json +17 -15
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,34 @@
|
|
|
4
4
|
|
|
5
5
|
[1]: https://www.npmjs.com/package/nodejs-spanner?activeTab=versions
|
|
6
6
|
|
|
7
|
+
## [7.0.0](https://github.com/googleapis/nodejs-spanner/compare/v6.16.0...v7.0.0) (2023-08-30)
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
### ⚠ BREAKING CHANGES
|
|
11
|
+
|
|
12
|
+
* upgrade to Node 14 ([#1890](https://github.com/googleapis/nodejs-spanner/issues/1890))
|
|
13
|
+
|
|
14
|
+
### Bug Fixes
|
|
15
|
+
|
|
16
|
+
* Idwaiter with multiple requests ([#1910](https://github.com/googleapis/nodejs-spanner/issues/1910)) ([83dd1f8](https://github.com/googleapis/nodejs-spanner/commit/83dd1f8201d07898bd3ddff9e339dfbcef7d7ace))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### Miscellaneous Chores
|
|
20
|
+
|
|
21
|
+
* Upgrade to Node 14 ([#1890](https://github.com/googleapis/nodejs-spanner/issues/1890)) ([0024772](https://github.com/googleapis/nodejs-spanner/commit/0024772b750de404cd44771e320fe89cd430f064))
|
|
22
|
+
|
|
23
|
+
## [6.16.0](https://github.com/googleapis/nodejs-spanner/compare/v6.15.0...v6.16.0) (2023-08-07)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Features
|
|
27
|
+
|
|
28
|
+
* Bit reverse sequence ([#1846](https://github.com/googleapis/nodejs-spanner/issues/1846)) ([4154c02](https://github.com/googleapis/nodejs-spanner/commit/4154c02f4c5ac1aa23f4c7c61521ab6fbabadfb8))
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### Bug Fixes
|
|
32
|
+
|
|
33
|
+
* Databoost tests ([#1870](https://github.com/googleapis/nodejs-spanner/issues/1870)) ([45e13c7](https://github.com/googleapis/nodejs-spanner/commit/45e13c70607abf717d533a8c5b1c58752a5439cb))
|
|
34
|
+
|
|
7
35
|
## [6.15.0](https://github.com/googleapis/nodejs-spanner/compare/v6.14.0...v6.15.0) (2023-08-04)
|
|
8
36
|
|
|
9
37
|
|
package/README.md
CHANGED
|
@@ -161,6 +161,9 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-spanner/tre
|
|
|
161
161
|
| Showcases how a Spanner PostgreSQL database orders null values in a query. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-ordering-nulls.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/pg-ordering-nulls.js,samples/README.md) |
|
|
162
162
|
| Execute a query with parameters on a Spanner PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-query-parameter.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/pg-query-parameter.js,samples/README.md) |
|
|
163
163
|
| Query the information schema metadata in a Spanner PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-schema-information.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/pg-schema-information.js,samples/README.md) |
|
|
164
|
+
| Alters a sequence in a PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-sequence-alter.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/pg-sequence-alter.js,samples/README.md) |
|
|
165
|
+
| Creates sequence in PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-sequence-create.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/pg-sequence-create.js,samples/README.md) |
|
|
166
|
+
| Drops a sequence in PostgreSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/pg-sequence-drop.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/pg-sequence-drop.js,samples/README.md) |
|
|
164
167
|
| Queryoptions | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/queryoptions.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/queryoptions.js,samples/README.md) |
|
|
165
168
|
| Quickstart | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/quickstart.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/quickstart.js,samples/README.md) |
|
|
166
169
|
| Read data with database role | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/read-data-with-database-role.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/read-data-with-database-role.js,samples/README.md) |
|
|
@@ -172,6 +175,9 @@ Samples are in the [`samples/`](https://github.com/googleapis/nodejs-spanner/tre
|
|
|
172
175
|
| Query data with RPC Priority | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/rpc-priority-run.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/rpc-priority-run.js,samples/README.md) |
|
|
173
176
|
| Run transaction with RPC priority | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/rpc-priority-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/rpc-priority-transaction.js,samples/README.md) |
|
|
174
177
|
| Schema | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/schema.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/schema.js,samples/README.md) |
|
|
178
|
+
| Alters a sequence in a GoogleSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/sequence-alter.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/sequence-alter.js,samples/README.md) |
|
|
179
|
+
| Creates sequence in GoogleSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/sequence-create.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/sequence-create.js,samples/README.md) |
|
|
180
|
+
| Drops a sequence in GoogleSQL database. | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/sequence-drop.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/sequence-drop.js,samples/README.md) |
|
|
175
181
|
| Struct | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/struct.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/struct.js,samples/README.md) |
|
|
176
182
|
| Alters a table with foreign key delete cascade action | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/table-alter-with-foreign-key-delete-cascade.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/table-alter-with-foreign-key-delete-cascade.js,samples/README.md) |
|
|
177
183
|
| Creates a table with foreign key delete cascade action | [source code](https://github.com/googleapis/nodejs-spanner/blob/main/samples/table-create-with-foreign-key-delete-cascade.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/table-create-with-foreign-key-delete-cascade.js,samples/README.md) |
|
|
@@ -187,7 +193,7 @@ also contains samples.
|
|
|
187
193
|
|
|
188
194
|
## Supported Node.js Versions
|
|
189
195
|
|
|
190
|
-
Our client libraries follow the [Node.js release schedule](https://
|
|
196
|
+
Our client libraries follow the [Node.js release schedule](https://github.com/nodejs/release#release-schedule).
|
|
191
197
|
Libraries are compatible with all current _active_ and _maintenance_ versions of
|
|
192
198
|
Node.js.
|
|
193
199
|
If you are using an end-of-life version of Node.js, we recommend that you update
|
|
@@ -13,10 +13,10 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
/// <reference types="long" />
|
|
17
16
|
/// <reference types="node" />
|
|
18
17
|
/// <reference types="node" />
|
|
19
18
|
import { PreciseDate } from '@google-cloud/precise-date';
|
|
19
|
+
import Long = require('long');
|
|
20
20
|
import { EventEmitter } from 'events';
|
|
21
21
|
import { grpc, CallOptions } from 'google-gax';
|
|
22
22
|
import { common as p } from 'protobufjs';
|
|
@@ -82,7 +82,7 @@ export interface ReadRequest extends RequestOptions {
|
|
|
82
82
|
keys?: string[] | string[][];
|
|
83
83
|
ranges?: KeyRange[];
|
|
84
84
|
keySet?: spannerClient.spanner.v1.IKeySet | null;
|
|
85
|
-
limit?: number | Long | null;
|
|
85
|
+
limit?: number | Long | string | null;
|
|
86
86
|
resumeToken?: Uint8Array | null;
|
|
87
87
|
partitionToken?: Uint8Array | null;
|
|
88
88
|
requestOptions?: Omit<IRequestOptions, 'transactionTag'>;
|
|
@@ -182,7 +182,7 @@ export type CommitCallback = NormalCallback<spannerClient.spanner.v1.ICommitResp
|
|
|
182
182
|
export declare class Snapshot extends EventEmitter {
|
|
183
183
|
protected _options: spannerClient.spanner.v1.ITransactionOptions;
|
|
184
184
|
protected _seqno: number;
|
|
185
|
-
protected
|
|
185
|
+
protected _waitingRequests: Array<() => void>;
|
|
186
186
|
protected _inlineBeginStarted: any;
|
|
187
187
|
protected _useInRunner: boolean;
|
|
188
188
|
id?: Uint8Array | string;
|
|
@@ -857,6 +857,7 @@ export declare class Snapshot extends EventEmitter {
|
|
|
857
857
|
* @private
|
|
858
858
|
*/
|
|
859
859
|
private _wrapWithIdWaiter;
|
|
860
|
+
_releaseWaitingRequests(): void;
|
|
860
861
|
/**
|
|
861
862
|
* Gets the Spanner object
|
|
862
863
|
*
|
package/build/src/transaction.js
CHANGED
|
@@ -142,9 +142,7 @@ class Snapshot extends events_1.EventEmitter {
|
|
|
142
142
|
this.resourceHeader_ = {
|
|
143
143
|
[common_1.CLOUD_RESOURCE_HEADER]: this.session.parent.formattedName_,
|
|
144
144
|
};
|
|
145
|
-
this.
|
|
146
|
-
read() { },
|
|
147
|
-
});
|
|
145
|
+
this._waitingRequests = [];
|
|
148
146
|
this._inlineBeginStarted = false;
|
|
149
147
|
}
|
|
150
148
|
begin(gaxOptionsOrCallback, cb) {
|
|
@@ -793,7 +791,7 @@ class Snapshot extends events_1.EventEmitter {
|
|
|
793
791
|
this.readTimestampProto = readTimestamp;
|
|
794
792
|
this.readTimestamp = new precise_date_1.PreciseDate(readTimestamp);
|
|
795
793
|
}
|
|
796
|
-
this.
|
|
794
|
+
this._releaseWaitingRequests();
|
|
797
795
|
}
|
|
798
796
|
/**
|
|
799
797
|
* Wrap `makeRequest` function with the lock to make sure the inline begin
|
|
@@ -810,9 +808,24 @@ class Snapshot extends events_1.EventEmitter {
|
|
|
810
808
|
this._inlineBeginStarted = true;
|
|
811
809
|
return makeRequest;
|
|
812
810
|
}
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
811
|
+
// Queue subsequent requests.
|
|
812
|
+
return (resumeToken) => {
|
|
813
|
+
const streamProxy = new stream_1.Readable({
|
|
814
|
+
read() { },
|
|
815
|
+
});
|
|
816
|
+
this._waitingRequests.push(() => {
|
|
817
|
+
makeRequest(resumeToken)
|
|
818
|
+
.on('data', chunk => streamProxy.emit('data', chunk))
|
|
819
|
+
.on('end', () => streamProxy.emit('end'));
|
|
820
|
+
});
|
|
821
|
+
return streamProxy;
|
|
822
|
+
};
|
|
823
|
+
}
|
|
824
|
+
_releaseWaitingRequests() {
|
|
825
|
+
while (this._waitingRequests.length > 0) {
|
|
826
|
+
const request = this._waitingRequests.shift();
|
|
827
|
+
request === null || request === void 0 ? void 0 : request();
|
|
828
|
+
}
|
|
816
829
|
}
|
|
817
830
|
/**
|
|
818
831
|
* Gets the Spanner object
|
package/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@google-cloud/spanner",
|
|
3
3
|
"description": "Cloud Spanner Client Library for Node.js",
|
|
4
|
-
"version": "
|
|
4
|
+
"version": "7.0.0",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Google Inc.",
|
|
7
7
|
"engines": {
|
|
8
|
-
"node": ">=
|
|
8
|
+
"node": ">=14.0.0"
|
|
9
9
|
},
|
|
10
10
|
"repository": "googleapis/nodejs-spanner",
|
|
11
11
|
"main": "./build/src/index.js",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"samples-test": "cd samples/ && npm link ../ && npm test && cd ../",
|
|
34
34
|
"system-test": "mocha build/system-test --timeout 1600000",
|
|
35
35
|
"cleanup": "mocha scripts/cleanup.js --timeout 30000",
|
|
36
|
-
"test": "
|
|
36
|
+
"test": "mocha build/test build/test/common",
|
|
37
37
|
"ycsb": "node ./benchmark/ycsb.js run -P ./benchmark/workloada -p table=usertable -p cloudspanner.instance=ycsb-instance -p operationcount=100 -p cloudspanner.database=ycsb",
|
|
38
38
|
"fix": "gts fix",
|
|
39
39
|
"clean": "gts clean",
|
|
@@ -47,13 +47,14 @@
|
|
|
47
47
|
"benchwrapper": "node bin/benchwrapper.js",
|
|
48
48
|
"prelint": "cd samples; npm link ../; npm install",
|
|
49
49
|
"precompile": "gts clean",
|
|
50
|
-
"compile-protos": "compileProtos src"
|
|
50
|
+
"compile-protos": "compileProtos src",
|
|
51
|
+
"coverage": "c8 mocha build/test build/test/common && c8 report --check-coverage"
|
|
51
52
|
},
|
|
52
53
|
"dependencies": {
|
|
53
|
-
"@google-cloud/common": "^
|
|
54
|
+
"@google-cloud/common": "^5.0.0",
|
|
54
55
|
"@google-cloud/precise-date": "^3.0.0",
|
|
55
|
-
"@google-cloud/projectify": "^
|
|
56
|
-
"@google-cloud/promisify": "^
|
|
56
|
+
"@google-cloud/projectify": "^4.0.0",
|
|
57
|
+
"@google-cloud/promisify": "^4.0.0",
|
|
57
58
|
"@grpc/proto-loader": "^0.7.0",
|
|
58
59
|
"@types/big.js": "^6.0.0",
|
|
59
60
|
"@types/stack-trace": "0.0.29",
|
|
@@ -63,19 +64,19 @@
|
|
|
63
64
|
"duplexify": "^4.1.1",
|
|
64
65
|
"events-intercept": "^2.0.0",
|
|
65
66
|
"extend": "^3.0.2",
|
|
66
|
-
"google-auth-library": "^
|
|
67
|
-
"google-gax": "^
|
|
67
|
+
"google-auth-library": "^9.0.0",
|
|
68
|
+
"google-gax": "^4.0.3",
|
|
68
69
|
"grpc-gcp": "^1.0.0",
|
|
69
70
|
"is": "^3.2.1",
|
|
70
71
|
"lodash.snakecase": "^4.1.1",
|
|
71
72
|
"merge-stream": "^2.0.0",
|
|
72
73
|
"p-queue": "^6.0.2",
|
|
73
74
|
"protobufjs": "^7.0.0",
|
|
74
|
-
"retry-request": "^
|
|
75
|
+
"retry-request": "^6.0.0",
|
|
75
76
|
"split-array-stream": "^2.0.0",
|
|
76
77
|
"stack-trace": "0.0.10",
|
|
77
78
|
"stream-events": "^1.0.4",
|
|
78
|
-
"teeny-request": "^
|
|
79
|
+
"teeny-request": "^9.0.0",
|
|
79
80
|
"through2": "^4.0.0"
|
|
80
81
|
},
|
|
81
82
|
"devDependencies": {
|
|
@@ -93,15 +94,16 @@
|
|
|
93
94
|
"@types/through2": "^2.0.34",
|
|
94
95
|
"@types/uuid": "^9.0.0",
|
|
95
96
|
"binary-search-bounds": "^2.0.4",
|
|
96
|
-
"c8": "^8.0.
|
|
97
|
+
"c8": "^8.0.1",
|
|
97
98
|
"codecov": "^3.0.2",
|
|
98
99
|
"concat-stream": "^2.0.0",
|
|
99
100
|
"dedent": "^0.7.0",
|
|
100
101
|
"execa": "^5.0.0",
|
|
101
|
-
"
|
|
102
|
+
"gapic-tools": "^0.1.8",
|
|
103
|
+
"gts": "^5.0.0",
|
|
102
104
|
"jsdoc": "^4.0.0",
|
|
103
105
|
"jsdoc-fresh": "^2.0.0",
|
|
104
|
-
"jsdoc-region-tag": "^
|
|
106
|
+
"jsdoc-region-tag": "^3.0.0",
|
|
105
107
|
"linkinator": "^4.0.0",
|
|
106
108
|
"lodash.random": "^3.2.0",
|
|
107
109
|
"mocha": "^9.2.2",
|
|
@@ -113,7 +115,7 @@
|
|
|
113
115
|
"stats-lite": "^2.1.1",
|
|
114
116
|
"time-span": "^4.0.0",
|
|
115
117
|
"tmp": "^0.2.0",
|
|
116
|
-
"typescript": "^
|
|
118
|
+
"typescript": "^5.1.6",
|
|
117
119
|
"uuid": "^9.0.0",
|
|
118
120
|
"yargs": "^17.0.0"
|
|
119
121
|
}
|