@clickhouse/client 1.18.0 → 1.18.2-head.084b623.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/README.md +67 -2
- package/dist/config.d.ts +8 -2
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/connection/create_connection.d.ts +2 -1
- package/dist/connection/create_connection.js +4 -1
- package/dist/connection/create_connection.js.map +1 -1
- package/dist/connection/node_base_connection.d.ts +8 -26
- package/dist/connection/node_base_connection.js +12 -486
- package/dist/connection/node_base_connection.js.map +1 -1
- package/dist/connection/node_custom_agent_connection.d.ts +2 -1
- package/dist/connection/node_custom_agent_connection.js.map +1 -1
- package/dist/connection/node_http_connection.d.ts +2 -1
- package/dist/connection/node_http_connection.js.map +1 -1
- package/dist/connection/node_https_connection.d.ts +2 -1
- package/dist/connection/node_https_connection.js.map +1 -1
- package/dist/connection/socket_pool.d.ts +43 -0
- package/dist/connection/socket_pool.js +623 -0
- package/dist/connection/socket_pool.js.map +1 -0
- package/dist/connection/stream.d.ts +9 -3
- package/dist/connection/stream.js +110 -1
- package/dist/connection/stream.js.map +1 -1
- package/dist/utils/stream.js +14 -13
- package/dist/utils/stream.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/version.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type LogWriter, type ConnOperation, ClickHouseLogLevel } from '@clickhouse/client-common';
|
|
2
2
|
import type Stream from 'stream';
|
|
3
|
-
interface Context {
|
|
3
|
+
export interface Context {
|
|
4
4
|
op: ConnOperation;
|
|
5
5
|
log_level: ClickHouseLogLevel;
|
|
6
6
|
log_writer: LogWriter;
|
|
@@ -8,6 +8,12 @@ interface Context {
|
|
|
8
8
|
}
|
|
9
9
|
/** Drains the response stream, as calling `destroy` on a {@link Stream.Readable} response stream
|
|
10
10
|
* will result in closing the underlying socket, and negate the KeepAlive feature benefits.
|
|
11
|
+
* See https://github.com/ClickHouse/clickhouse-js/pull/203
|
|
12
|
+
* @deprecated This method is not intended to be used outside of the client implementation anymore. Use `client.command()` instead, which will handle draining the stream internally when needed.
|
|
13
|
+
* */
|
|
14
|
+
export declare function drainStream(stream: Stream.Readable): Promise<void>;
|
|
15
|
+
/** Drains the response stream, as calling `destroy` on a {@link Stream.Readable} response stream
|
|
16
|
+
* will result in closing the underlying socket, and negate the KeepAlive feature benefits.
|
|
17
|
+
* Also, provides additional internal logging for debugging stream issues. Not intended to be used outside of the client implementation.
|
|
11
18
|
* See https://github.com/ClickHouse/clickhouse-js/pull/203 */
|
|
12
|
-
export declare function
|
|
13
|
-
export {};
|
|
19
|
+
export declare function drainStreamInternal(ctx: Context, stream: Stream.Readable): Promise<void>;
|
|
@@ -1,11 +1,68 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.drainStream = drainStream;
|
|
4
|
+
exports.drainStreamInternal = drainStreamInternal;
|
|
4
5
|
const client_common_1 = require("@clickhouse/client-common");
|
|
5
6
|
/** Drains the response stream, as calling `destroy` on a {@link Stream.Readable} response stream
|
|
6
7
|
* will result in closing the underlying socket, and negate the KeepAlive feature benefits.
|
|
8
|
+
* See https://github.com/ClickHouse/clickhouse-js/pull/203
|
|
9
|
+
* @deprecated This method is not intended to be used outside of the client implementation anymore. Use `client.command()` instead, which will handle draining the stream internally when needed.
|
|
10
|
+
* */
|
|
11
|
+
async function drainStream(stream) {
|
|
12
|
+
return new Promise((resolve, reject) => {
|
|
13
|
+
// If the stream has already emitted an error, we can reject the promise immediately.
|
|
14
|
+
if (stream.errored) {
|
|
15
|
+
// the stream is already errored, no need to attach listeners
|
|
16
|
+
reject(stream.errored);
|
|
17
|
+
return;
|
|
18
|
+
}
|
|
19
|
+
// Avoid a race condition where the stream has already sent the 'end' event before we attach the listener.
|
|
20
|
+
// In this case, we can resolve the promise immediately without attaching any listeners.
|
|
21
|
+
if (stream.readableEnded) {
|
|
22
|
+
// the stream is already ended, no need to attach listeners
|
|
23
|
+
resolve();
|
|
24
|
+
return;
|
|
25
|
+
}
|
|
26
|
+
// If the stream is already closed, we can resolve the promise immediately as well.
|
|
27
|
+
if (stream.closed) {
|
|
28
|
+
// the stream is already closed, no need to attach listeners
|
|
29
|
+
resolve();
|
|
30
|
+
return;
|
|
31
|
+
}
|
|
32
|
+
function dropData() {
|
|
33
|
+
// used only for the methods without expected response; we don't care about the data here
|
|
34
|
+
}
|
|
35
|
+
function onEnd() {
|
|
36
|
+
removeListeners();
|
|
37
|
+
resolve();
|
|
38
|
+
}
|
|
39
|
+
function onError(err) {
|
|
40
|
+
removeListeners();
|
|
41
|
+
reject(err);
|
|
42
|
+
}
|
|
43
|
+
function onClose() {
|
|
44
|
+
removeListeners();
|
|
45
|
+
// The `end` event might not be emitted if the server closes the connection.
|
|
46
|
+
// Making sure to resolve the promise in this case as well.
|
|
47
|
+
resolve();
|
|
48
|
+
}
|
|
49
|
+
function removeListeners() {
|
|
50
|
+
stream.removeListener('data', dropData);
|
|
51
|
+
stream.removeListener('end', onEnd);
|
|
52
|
+
stream.removeListener('error', onError);
|
|
53
|
+
stream.removeListener('close', onClose);
|
|
54
|
+
}
|
|
55
|
+
stream.on('data', dropData);
|
|
56
|
+
stream.on('end', onEnd);
|
|
57
|
+
stream.on('error', onError);
|
|
58
|
+
stream.on('close', onClose);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
/** Drains the response stream, as calling `destroy` on a {@link Stream.Readable} response stream
|
|
62
|
+
* will result in closing the underlying socket, and negate the KeepAlive feature benefits.
|
|
63
|
+
* Also, provides additional internal logging for debugging stream issues. Not intended to be used outside of the client implementation.
|
|
7
64
|
* See https://github.com/ClickHouse/clickhouse-js/pull/203 */
|
|
8
|
-
async function
|
|
65
|
+
async function drainStreamInternal(ctx, stream) {
|
|
9
66
|
return new Promise((resolve, reject) => {
|
|
10
67
|
const startTime = Date.now();
|
|
11
68
|
let bytesReceived = 0;
|
|
@@ -23,6 +80,55 @@ async function drainStream(ctx, stream) {
|
|
|
23
80
|
},
|
|
24
81
|
});
|
|
25
82
|
}
|
|
83
|
+
// If the stream has already emitted an error, we can reject the promise immediately.
|
|
84
|
+
if (stream.errored) {
|
|
85
|
+
if (ctx.log_level <= client_common_1.ClickHouseLogLevel.TRACE) {
|
|
86
|
+
ctx.log_writer.trace({
|
|
87
|
+
message: `${ctx.op}: stream already errored before drain`,
|
|
88
|
+
args: {
|
|
89
|
+
query_id: ctx.query_id,
|
|
90
|
+
chunk_number: chunkCount,
|
|
91
|
+
total_bytes_received: bytesReceived,
|
|
92
|
+
},
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
// the stream is already errored, no need to attach listeners
|
|
96
|
+
reject(stream.errored);
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
// Avoid a race condition where the stream has already sent the 'end' event before we attach the listener.
|
|
100
|
+
// In this case, we can resolve the promise immediately without attaching any listeners.
|
|
101
|
+
if (stream.readableEnded) {
|
|
102
|
+
if (ctx.log_level <= client_common_1.ClickHouseLogLevel.TRACE) {
|
|
103
|
+
ctx.log_writer.trace({
|
|
104
|
+
message: `${ctx.op}: stream already ended before drain`,
|
|
105
|
+
args: {
|
|
106
|
+
query_id: ctx.query_id,
|
|
107
|
+
chunk_number: chunkCount,
|
|
108
|
+
total_bytes_received: bytesReceived,
|
|
109
|
+
},
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
// the stream is already ended, no need to attach listeners
|
|
113
|
+
resolve();
|
|
114
|
+
return;
|
|
115
|
+
}
|
|
116
|
+
// If the stream is already closed, we can resolve the promise immediately as well.
|
|
117
|
+
if (stream.closed) {
|
|
118
|
+
if (ctx.log_level <= client_common_1.ClickHouseLogLevel.TRACE) {
|
|
119
|
+
ctx.log_writer.trace({
|
|
120
|
+
message: `${ctx.op}: stream already closed before drain`,
|
|
121
|
+
args: {
|
|
122
|
+
query_id: ctx.query_id,
|
|
123
|
+
chunk_number: chunkCount,
|
|
124
|
+
total_bytes_received: bytesReceived,
|
|
125
|
+
},
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
// the stream is already closed, no need to attach listeners
|
|
129
|
+
resolve();
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
26
132
|
function dropData(chunk) {
|
|
27
133
|
// used only for the methods without expected response; we don't care about the data here
|
|
28
134
|
if (ctx.log_level <= client_common_1.ClickHouseLogLevel.TRACE) {
|
|
@@ -87,6 +193,9 @@ async function drainStream(ctx, stream) {
|
|
|
87
193
|
},
|
|
88
194
|
});
|
|
89
195
|
}
|
|
196
|
+
// The `end` event might not be emitted if the server closes the connection.
|
|
197
|
+
// Making sure to resolve the promise in this case as well.
|
|
198
|
+
resolve();
|
|
90
199
|
}
|
|
91
200
|
function removeListeners() {
|
|
92
201
|
stream.removeListener('data', dropData);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.js","sourceRoot":"","sources":["../../src/connection/stream.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"stream.js","sourceRoot":"","sources":["../../src/connection/stream.ts"],"names":[],"mappings":";;AAmBA,kCAyDC;AAMD,kDA+JC;AAjPD,6DAIkC;AAUlC;;;;KAIK;AACE,KAAK,UAAU,WAAW,CAAC,MAAuB;IACvD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,qFAAqF;QACrF,IAAI,MAAM,CAAC,OAAO,EAAE,CAAC;YACnB,6DAA6D;YAC7D,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;YACtB,OAAM;QACR,CAAC;QAED,0GAA0G;QAC1G,wFAAwF;QACxF,IAAI,MAAM,CAAC,aAAa,EAAE,CAAC;YACzB,2DAA2D;YAC3D,OAAO,EAAE,CAAA;YACT,OAAM;QACR,CAAC;QAED,mFAAmF;QACnF,IAAI,MAAM,CAAC,MAAM,EAAE,CAAC;YAClB,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5E,2DAA2D;YAC3D,OAAO,EAAE,CAAA;QACX,CAAC;QAED,SAAS,eAAe;YACtB,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;YACvC,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;YACnC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;YACvC,MAAM,CAAC,cAAc,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QACzC,CAAC;QAED,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAA;QAC3B,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;QACvB,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAC3B,MAAM,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;IAC7B,CAAC,CAAC,CAAA;AACJ,CAAC"}
|
package/dist/utils/stream.js
CHANGED
|
@@ -18,22 +18,23 @@ function isStream(obj) {
|
|
|
18
18
|
typeof obj.on === 'function');
|
|
19
19
|
}
|
|
20
20
|
async function getAsText(stream) {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
throw new Error('The response length exceeds the maximum allowed size of V8 String: ' +
|
|
27
|
-
`${MAX_STRING_LENGTH}; consider limiting the amount of requested rows.`);
|
|
21
|
+
try {
|
|
22
|
+
let text = '';
|
|
23
|
+
const textDecoder = new TextDecoder();
|
|
24
|
+
for await (const chunk of stream) {
|
|
25
|
+
text += textDecoder.decode(chunk, { stream: true });
|
|
28
26
|
}
|
|
29
|
-
|
|
27
|
+
// flush unfinished multi-byte characters
|
|
28
|
+
text += textDecoder.decode();
|
|
29
|
+
return text;
|
|
30
30
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
catch (err) {
|
|
32
|
+
if (err instanceof RangeError &&
|
|
33
|
+
err.message.includes('Invalid string length')) {
|
|
34
|
+
throw new Error(`The response length exceeds the maximum allowed size of V8 String: ${MAX_STRING_LENGTH} characters.`);
|
|
35
|
+
}
|
|
36
|
+
throw err;
|
|
35
37
|
}
|
|
36
|
-
return text;
|
|
37
38
|
}
|
|
38
39
|
function mapStream(mapper) {
|
|
39
40
|
return new stream_1.default.Transform({
|
package/dist/utils/stream.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.js","sourceRoot":"","sources":["../../src/utils/stream.ts"],"names":[],"mappings":";;;;;AAKA,4BASC;AAED,
|
|
1
|
+
{"version":3,"file":"stream.js","sourceRoot":"","sources":["../../src/utils/stream.ts"],"names":[],"mappings":";;;;;AAKA,4BASC;AAED,8BAwBC;AAED,8BASC;AAnDD,oDAA2B;AAC3B,mCAAkC;AAElC,MAAM,EAAE,iBAAiB,EAAE,GAAG,kBAAS,CAAA;AAEvC,SAAgB,QAAQ,CAAC,GAAY;IACnC,OAAO,CACL,OAAO,GAAG,KAAK,QAAQ;QACvB,GAAG,KAAK,IAAI;QACZ,MAAM,IAAI,GAAG;QACb,OAAO,GAAG,CAAC,IAAI,KAAK,UAAU;QAC9B,IAAI,IAAI,GAAG;QACX,OAAO,GAAG,CAAC,EAAE,KAAK,UAAU,CAC7B,CAAA;AACH,CAAC;AAEM,KAAK,UAAU,SAAS,CAAC,MAAuB;IACrD,IAAI,CAAC;QACH,IAAI,IAAI,GAAG,EAAE,CAAA;QAEb,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAA;QACrC,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YACjC,IAAI,IAAI,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;QACrD,CAAC;QAED,yCAAyC;QACzC,IAAI,IAAI,WAAW,CAAC,MAAM,EAAE,CAAA;QAE5B,OAAO,IAAI,CAAA;IACb,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,IACE,GAAG,YAAY,UAAU;YACzB,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC,uBAAuB,CAAC,EAC7C,CAAC;YACD,MAAM,IAAI,KAAK,CACb,sEAAsE,iBAAiB,cAAc,CACtG,CAAA;QACH,CAAC;QACD,MAAM,GAAG,CAAA;IACX,CAAC;AACH,CAAC;AAED,SAAgB,SAAS,CACvB,MAAkC;IAElC,OAAO,IAAI,gBAAM,CAAC,SAAS,CAAC;QAC1B,UAAU,EAAE,IAAI;QAChB,SAAS,CAAC,KAAK,EAAE,QAAQ,EAAE,QAAQ;YACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;QAC/B,CAAC;KACF,CAAC,CAAA;AACJ,CAAC"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.18.
|
|
1
|
+
declare const _default: "1.18.2-head.084b623.1";
|
|
2
2
|
export default _default;
|
package/dist/version.js
CHANGED
package/dist/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;AAAA,kBAAe,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":";;AAAA,kBAAe,uBAAuB,CAAA"}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@clickhouse/client",
|
|
3
3
|
"description": "Official JS client for ClickHouse DB - Node.js implementation",
|
|
4
4
|
"homepage": "https://clickhouse.com",
|
|
5
|
-
"version": "1.18.
|
|
5
|
+
"version": "1.18.2-head.084b623.1",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"clickhouse",
|
|
@@ -25,12 +25,12 @@
|
|
|
25
25
|
"scripts": {
|
|
26
26
|
"prepack": "cp ../../README.md ../../LICENSE .",
|
|
27
27
|
"typecheck": "tsc --noEmit",
|
|
28
|
-
"lint": "eslint .",
|
|
28
|
+
"lint": "eslint --max-warnings=0 .",
|
|
29
29
|
"lint:fix": "eslint . --fix",
|
|
30
30
|
"build": "rm -rf dist; tsc"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@clickhouse/client-common": "1.18.
|
|
33
|
+
"@clickhouse/client-common": "1.18.2-head.084b623.1"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"simdjson": "^0.9.2"
|