@clickhouse/client 1.11.0 → 1.11.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/dist/utils/stream.d.ts +1 -1
- package/dist/utils/stream.js +10 -5
- package/dist/utils/stream.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/dist/utils/stream.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import Stream from 'stream';
|
|
2
|
-
export declare function isStream(obj:
|
|
2
|
+
export declare function isStream(obj: unknown): obj is Stream.Readable;
|
|
3
3
|
export declare function getAsText(stream: Stream.Readable): Promise<string>;
|
|
4
4
|
export declare function mapStream(mapper: (input: unknown) => string): Stream.Transform;
|
package/dist/utils/stream.js
CHANGED
|
@@ -7,19 +7,24 @@ exports.isStream = isStream;
|
|
|
7
7
|
exports.getAsText = getAsText;
|
|
8
8
|
exports.mapStream = mapStream;
|
|
9
9
|
const stream_1 = __importDefault(require("stream"));
|
|
10
|
-
|
|
11
|
-
const
|
|
10
|
+
const buffer_1 = require("buffer");
|
|
11
|
+
const { MAX_STRING_LENGTH } = buffer_1.constants;
|
|
12
12
|
function isStream(obj) {
|
|
13
|
-
return
|
|
13
|
+
return (typeof obj === 'object' &&
|
|
14
|
+
obj !== null &&
|
|
15
|
+
'pipe' in obj &&
|
|
16
|
+
typeof obj.pipe === 'function' &&
|
|
17
|
+
'on' in obj &&
|
|
18
|
+
typeof obj.on === 'function');
|
|
14
19
|
}
|
|
15
20
|
async function getAsText(stream) {
|
|
16
21
|
let text = '';
|
|
17
22
|
const textDecoder = new TextDecoder();
|
|
18
23
|
for await (const chunk of stream) {
|
|
19
24
|
const decoded = textDecoder.decode(chunk, { stream: true });
|
|
20
|
-
if (decoded.length + text.length >
|
|
25
|
+
if (decoded.length + text.length > MAX_STRING_LENGTH) {
|
|
21
26
|
throw new Error('The response length exceeds the maximum allowed size of V8 String: ' +
|
|
22
|
-
`${
|
|
27
|
+
`${MAX_STRING_LENGTH}; consider limiting the amount of requested rows.`);
|
|
23
28
|
}
|
|
24
29
|
text += decoded;
|
|
25
30
|
}
|
package/dist/utils/stream.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.js","sourceRoot":"","sources":["../../../../packages/client-node/src/utils/stream.ts"],"names":[],"mappings":";;;;;AAKA,
|
|
1
|
+
{"version":3,"file":"stream.js","sourceRoot":"","sources":["../../../../packages/client-node/src/utils/stream.ts"],"names":[],"mappings":";;;;;AAKA,4BASC;AAED,8BAsBC;AAED,8BASC;AAjDD,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,IAAI,GAAG,EAAE,CAAA;IAEb,MAAM,WAAW,GAAG,IAAI,WAAW,EAAE,CAAA;IACrC,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QACjC,MAAM,OAAO,GAAG,WAAW,CAAC,MAAM,CAAC,KAAK,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;QAC3D,IAAI,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,GAAG,iBAAiB,EAAE,CAAC;YACrD,MAAM,IAAI,KAAK,CACb,qEAAqE;gBACnE,GAAG,iBAAiB,mDAAmD,CAC1E,CAAA;QACH,CAAC;QACD,IAAI,IAAI,OAAO,CAAA;IACjB,CAAC;IAED,QAAQ;IACR,MAAM,IAAI,GAAG,WAAW,CAAC,MAAM,EAAE,CAAA;IACjC,IAAI,IAAI,EAAE,CAAC;QACT,IAAI,IAAI,IAAI,CAAA;IACd,CAAC;IAED,OAAO,IAAI,CAAA;AACb,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.11.
|
|
1
|
+
declare const _default: "1.11.1";
|
|
2
2
|
export default _default;
|
package/dist/version.js
CHANGED
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.11.
|
|
5
|
+
"version": "1.11.1",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"clickhouse",
|
|
@@ -23,6 +23,6 @@
|
|
|
23
23
|
"dist"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@clickhouse/client-common": "1.11.
|
|
26
|
+
"@clickhouse/client-common": "1.11.1"
|
|
27
27
|
}
|
|
28
28
|
}
|