@clickhouse/client 0.0.16 → 0.1.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/dist/client.d.ts +41 -5
- package/dist/client.js +49 -12
- package/dist/client.js.map +1 -1
- package/dist/connection/adapter/base_http_adapter.d.ts +4 -4
- package/dist/connection/adapter/base_http_adapter.js +25 -43
- package/dist/connection/adapter/base_http_adapter.js.map +1 -1
- package/dist/connection/adapter/http_adapter.d.ts +1 -1
- package/dist/connection/adapter/http_adapter.js +2 -2
- package/dist/connection/adapter/http_adapter.js.map +1 -1
- package/dist/connection/adapter/https_adapter.d.ts +1 -1
- package/dist/connection/adapter/https_adapter.js +2 -2
- package/dist/connection/adapter/https_adapter.js.map +1 -1
- package/dist/connection/connection.d.ts +9 -6
- package/dist/connection/connection.js.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js.map +1 -1
- package/dist/schema/table.d.ts +4 -4
- package/dist/schema/table.js +4 -4
- package/dist/schema/table.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 +1 -2
package/dist/client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
import Stream from 'stream';
|
|
4
|
-
import type {
|
|
4
|
+
import type { ExecResult, InsertResult } from './connection';
|
|
5
5
|
import type { Logger } from './logger';
|
|
6
6
|
import { type DataFormat } from './data_formatter';
|
|
7
7
|
import { ResultSet } from './result';
|
|
@@ -10,8 +10,6 @@ import type { InputJSON, InputJSONObjectEachRow } from './clickhouse_types';
|
|
|
10
10
|
export interface ClickHouseClientConfigOptions {
|
|
11
11
|
/** A ClickHouse instance URL. Default value: `http://localhost:8123`. */
|
|
12
12
|
host?: string;
|
|
13
|
-
/** The timeout to set up a connection in milliseconds. Default value: `10_000`. */
|
|
14
|
-
connect_timeout?: number;
|
|
15
13
|
/** The request timeout in milliseconds. Default value: `30_000`. */
|
|
16
14
|
request_timeout?: number;
|
|
17
15
|
/** Maximum number of sockets to allow per host. Default value: `Infinity`. */
|
|
@@ -52,7 +50,7 @@ export interface BaseParams {
|
|
|
52
50
|
clickhouse_settings?: ClickHouseSettings;
|
|
53
51
|
/** Parameters for query binding. https://clickhouse.com/docs/en/interfaces/http/#cli-queries-with-parameters */
|
|
54
52
|
query_params?: Record<string, unknown>;
|
|
55
|
-
/** AbortSignal instance
|
|
53
|
+
/** AbortSignal instance to cancel a request in progress. */
|
|
56
54
|
abort_signal?: AbortSignal;
|
|
57
55
|
/** A specific `query_id` that will be sent with this request.
|
|
58
56
|
* If it is not set, a random identifier will be generated automatically by the client. */
|
|
@@ -68,6 +66,10 @@ export interface ExecParams extends BaseParams {
|
|
|
68
66
|
/** Statement to execute. */
|
|
69
67
|
query: string;
|
|
70
68
|
}
|
|
69
|
+
export type CommandParams = ExecParams;
|
|
70
|
+
export interface CommandResult {
|
|
71
|
+
query_id: string;
|
|
72
|
+
}
|
|
71
73
|
type InsertValues<T> = ReadonlyArray<T> | Stream.Readable | InputJSON<T> | InputJSONObjectEachRow<T>;
|
|
72
74
|
export interface InsertParams<T = unknown> extends BaseParams {
|
|
73
75
|
/** Name of a table to insert into. */
|
|
@@ -83,10 +85,44 @@ export declare class ClickHouseClient {
|
|
|
83
85
|
private readonly logger;
|
|
84
86
|
constructor(config?: ClickHouseClientConfigOptions);
|
|
85
87
|
private getBaseParams;
|
|
88
|
+
/**
|
|
89
|
+
* Used for most statements that can have a response, such as SELECT.
|
|
90
|
+
* FORMAT clause should be specified separately via {@link QueryParams.format} (default is JSON)
|
|
91
|
+
* Consider using {@link ClickHouseClient.insert} for data insertion,
|
|
92
|
+
* or {@link ClickHouseClient.command} for DDLs.
|
|
93
|
+
*/
|
|
86
94
|
query(params: QueryParams): Promise<ResultSet>;
|
|
87
|
-
|
|
95
|
+
/**
|
|
96
|
+
* It should be used for statements that do not have any output,
|
|
97
|
+
* when the format clause is not applicable, or when you are not interested in the response at all.
|
|
98
|
+
* Response stream is destroyed immediately as we do not expect useful information there.
|
|
99
|
+
* Examples of such statements are DDLs or custom inserts.
|
|
100
|
+
* If you are interested in the response data, consider using {@link ClickHouseClient.exec}
|
|
101
|
+
*/
|
|
102
|
+
command(params: CommandParams): Promise<CommandResult>;
|
|
103
|
+
/**
|
|
104
|
+
* Similar to {@link ClickHouseClient.command}, but for the cases where the output is expected,
|
|
105
|
+
* but format clause is not applicable. The caller of this method is expected to consume the stream,
|
|
106
|
+
* otherwise, the request will eventually be timed out.
|
|
107
|
+
*/
|
|
108
|
+
exec(params: ExecParams): Promise<ExecResult>;
|
|
109
|
+
/**
|
|
110
|
+
* The primary method for data insertion. It is recommended to avoid arrays in case of large inserts
|
|
111
|
+
* to reduce application memory consumption and consider streaming for most of such use cases.
|
|
112
|
+
* As the insert operation does not provide any output, the response stream is immediately destroyed.
|
|
113
|
+
* In case of a custom insert operation, such as, for example, INSERT FROM SELECT,
|
|
114
|
+
* consider using {@link ClickHouseClient.command}, passing the entire raw query there (including FORMAT clause).
|
|
115
|
+
*/
|
|
88
116
|
insert<T>(params: InsertParams<T>): Promise<InsertResult>;
|
|
117
|
+
/**
|
|
118
|
+
* Health-check request. Can throw an error if the connection is refused.
|
|
119
|
+
*/
|
|
89
120
|
ping(): Promise<boolean>;
|
|
121
|
+
/**
|
|
122
|
+
* Shuts down the underlying connection.
|
|
123
|
+
* This method should ideally be called only once per application lifecycle,
|
|
124
|
+
* for example, during the graceful shutdown phase.
|
|
125
|
+
*/
|
|
90
126
|
close(): Promise<void>;
|
|
91
127
|
}
|
|
92
128
|
export declare function validateInsertValues<T>(values: InsertValues<T>, format: DataFormat): void;
|
package/dist/client.js
CHANGED
|
@@ -25,7 +25,7 @@ function createUrl(host) {
|
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
27
|
function normalizeConfig(config) {
|
|
28
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p
|
|
28
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
|
|
29
29
|
let tls = undefined;
|
|
30
30
|
if (config.tls) {
|
|
31
31
|
if ('cert' in config.tls && 'key' in config.tls) {
|
|
@@ -44,21 +44,20 @@ function normalizeConfig(config) {
|
|
|
44
44
|
return {
|
|
45
45
|
application_id: config.application,
|
|
46
46
|
url: createUrl((_a = config.host) !== null && _a !== void 0 ? _a : 'http://localhost:8123'),
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
max_open_connections: (_d = config.max_open_connections) !== null && _d !== void 0 ? _d : Infinity,
|
|
47
|
+
request_timeout: (_b = config.request_timeout) !== null && _b !== void 0 ? _b : 300000,
|
|
48
|
+
max_open_connections: (_c = config.max_open_connections) !== null && _c !== void 0 ? _c : Infinity,
|
|
50
49
|
tls,
|
|
51
50
|
compression: {
|
|
52
|
-
decompress_response: (
|
|
53
|
-
compress_request: (
|
|
51
|
+
decompress_response: (_e = (_d = config.compression) === null || _d === void 0 ? void 0 : _d.response) !== null && _e !== void 0 ? _e : true,
|
|
52
|
+
compress_request: (_g = (_f = config.compression) === null || _f === void 0 ? void 0 : _f.request) !== null && _g !== void 0 ? _g : false,
|
|
54
53
|
},
|
|
55
|
-
username: (
|
|
56
|
-
password: (
|
|
57
|
-
application: (
|
|
58
|
-
database: (
|
|
59
|
-
clickhouse_settings: (
|
|
54
|
+
username: (_h = config.username) !== null && _h !== void 0 ? _h : 'default',
|
|
55
|
+
password: (_j = config.password) !== null && _j !== void 0 ? _j : '',
|
|
56
|
+
application: (_k = config.application) !== null && _k !== void 0 ? _k : 'clickhouse-js',
|
|
57
|
+
database: (_l = config.database) !== null && _l !== void 0 ? _l : 'default',
|
|
58
|
+
clickhouse_settings: (_m = config.clickhouse_settings) !== null && _m !== void 0 ? _m : {},
|
|
60
59
|
log: {
|
|
61
|
-
LoggerClass: (
|
|
60
|
+
LoggerClass: (_p = (_o = config.log) === null || _o === void 0 ? void 0 : _o.LoggerClass) !== null && _p !== void 0 ? _p : logger_1.DefaultLogger,
|
|
62
61
|
},
|
|
63
62
|
session_id: config.session_id,
|
|
64
63
|
};
|
|
@@ -100,6 +99,12 @@ class ClickHouseClient {
|
|
|
100
99
|
query_id: params.query_id,
|
|
101
100
|
};
|
|
102
101
|
}
|
|
102
|
+
/**
|
|
103
|
+
* Used for most statements that can have a response, such as SELECT.
|
|
104
|
+
* FORMAT clause should be specified separately via {@link QueryParams.format} (default is JSON)
|
|
105
|
+
* Consider using {@link ClickHouseClient.insert} for data insertion,
|
|
106
|
+
* or {@link ClickHouseClient.command} for DDLs.
|
|
107
|
+
*/
|
|
103
108
|
async query(params) {
|
|
104
109
|
var _a;
|
|
105
110
|
const format = (_a = params.format) !== null && _a !== void 0 ? _a : 'JSON';
|
|
@@ -110,6 +115,23 @@ class ClickHouseClient {
|
|
|
110
115
|
});
|
|
111
116
|
return new result_1.ResultSet(stream, format, query_id);
|
|
112
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* It should be used for statements that do not have any output,
|
|
120
|
+
* when the format clause is not applicable, or when you are not interested in the response at all.
|
|
121
|
+
* Response stream is destroyed immediately as we do not expect useful information there.
|
|
122
|
+
* Examples of such statements are DDLs or custom inserts.
|
|
123
|
+
* If you are interested in the response data, consider using {@link ClickHouseClient.exec}
|
|
124
|
+
*/
|
|
125
|
+
async command(params) {
|
|
126
|
+
const { stream, query_id } = await this.exec(params);
|
|
127
|
+
stream.destroy();
|
|
128
|
+
return { query_id };
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Similar to {@link ClickHouseClient.command}, but for the cases where the output is expected,
|
|
132
|
+
* but format clause is not applicable. The caller of this method is expected to consume the stream,
|
|
133
|
+
* otherwise, the request will eventually be timed out.
|
|
134
|
+
*/
|
|
113
135
|
async exec(params) {
|
|
114
136
|
const query = removeTrailingSemi(params.query.trim());
|
|
115
137
|
return await this.connection.exec({
|
|
@@ -117,6 +139,13 @@ class ClickHouseClient {
|
|
|
117
139
|
...this.getBaseParams(params),
|
|
118
140
|
});
|
|
119
141
|
}
|
|
142
|
+
/**
|
|
143
|
+
* The primary method for data insertion. It is recommended to avoid arrays in case of large inserts
|
|
144
|
+
* to reduce application memory consumption and consider streaming for most of such use cases.
|
|
145
|
+
* As the insert operation does not provide any output, the response stream is immediately destroyed.
|
|
146
|
+
* In case of a custom insert operation, such as, for example, INSERT FROM SELECT,
|
|
147
|
+
* consider using {@link ClickHouseClient.command}, passing the entire raw query there (including FORMAT clause).
|
|
148
|
+
*/
|
|
120
149
|
async insert(params) {
|
|
121
150
|
const format = params.format || 'JSONCompactEachRow';
|
|
122
151
|
validateInsertValues(params.values, format);
|
|
@@ -127,9 +156,17 @@ class ClickHouseClient {
|
|
|
127
156
|
...this.getBaseParams(params),
|
|
128
157
|
});
|
|
129
158
|
}
|
|
159
|
+
/**
|
|
160
|
+
* Health-check request. Can throw an error if the connection is refused.
|
|
161
|
+
*/
|
|
130
162
|
async ping() {
|
|
131
163
|
return await this.connection.ping();
|
|
132
164
|
}
|
|
165
|
+
/**
|
|
166
|
+
* Shuts down the underlying connection.
|
|
167
|
+
* This method should ideally be called only once per application lifecycle,
|
|
168
|
+
* for example, during the graceful shutdown phase.
|
|
169
|
+
*/
|
|
133
170
|
async close() {
|
|
134
171
|
return await this.connection.close();
|
|
135
172
|
}
|
package/dist/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA2B;AAE3B,6CAAgE;AAEhE,qCAAmD;AACnD,mCAA6C;AAC7C,qDAIyB;AACzB,qCAAoC;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA2B;AAE3B,6CAAgE;AAEhE,qCAAmD;AACnD,mCAA6C;AAC7C,qDAIyB;AACzB,qCAAoC;AA0Fp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KAAK,CACb,gCAAgC,OAAO,MAAM,SAAS,MAAM,SAAS,CACtE,CAAA;AACH,CAAC;AA3BD,oCA2BC;AAED,SAAgB,YAAY,CAC1B,MAAsC;IAEtC,OAAO,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAA;AACrC,CAAC;AAJD,oCAIC;AAED,SAAS,UAAU,CAAC,GAAiC;IACnD,IAAI,GAAG,EAAE;QACP,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAA;KACnB;AACH,CAAC"}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import Stream from 'stream';
|
|
4
4
|
import type Http from 'http';
|
|
5
5
|
import type { Logger } from '../../logger';
|
|
6
|
-
import type {
|
|
6
|
+
import type { Connection, ConnectionParams, ExecParams, ExecResult, InsertParams, InsertResult, QueryParams, QueryResult } from '../connection';
|
|
7
7
|
export interface RequestParams {
|
|
8
8
|
method: 'GET' | 'POST';
|
|
9
9
|
url: URL;
|
|
@@ -19,11 +19,11 @@ export declare abstract class BaseHttpAdapter implements Connection {
|
|
|
19
19
|
protected readonly headers: Http.OutgoingHttpHeaders;
|
|
20
20
|
protected constructor(config: ConnectionParams, logger: Logger, agent: Http.Agent);
|
|
21
21
|
protected buildDefaultHeaders(username: string, password: string): Http.OutgoingHttpHeaders;
|
|
22
|
-
protected abstract createClientRequest(
|
|
22
|
+
protected abstract createClientRequest(params: RequestParams, abort_signal?: AbortSignal): Http.ClientRequest;
|
|
23
23
|
protected request(params: RequestParams): Promise<Stream.Readable>;
|
|
24
24
|
ping(): Promise<boolean>;
|
|
25
|
-
query(params:
|
|
26
|
-
exec(params:
|
|
25
|
+
query(params: QueryParams): Promise<QueryResult>;
|
|
26
|
+
exec(params: ExecParams): Promise<ExecResult>;
|
|
27
27
|
insert(params: InsertParams): Promise<InsertResult>;
|
|
28
28
|
close(): Promise<void>;
|
|
29
29
|
private getQueryId;
|
|
@@ -38,9 +38,6 @@ const uuid = __importStar(require("uuid"));
|
|
|
38
38
|
function isSuccessfulResponse(statusCode) {
|
|
39
39
|
return Boolean(statusCode && 200 <= statusCode && statusCode < 300);
|
|
40
40
|
}
|
|
41
|
-
function isEventTarget(signal) {
|
|
42
|
-
return 'removeEventListener' in signal;
|
|
43
|
-
}
|
|
44
41
|
function withHttpSettings(clickhouse_settings, compression) {
|
|
45
42
|
return {
|
|
46
43
|
...(compression
|
|
@@ -109,10 +106,7 @@ class BaseHttpAdapter {
|
|
|
109
106
|
async request(params) {
|
|
110
107
|
return new Promise((resolve, reject) => {
|
|
111
108
|
const start = Date.now();
|
|
112
|
-
const request = this.createClientRequest(params
|
|
113
|
-
request.once('socket', (socket) => {
|
|
114
|
-
socket.setTimeout(this.config.request_timeout);
|
|
115
|
-
});
|
|
109
|
+
const request = this.createClientRequest(params, params.abort_signal);
|
|
116
110
|
function onError(err) {
|
|
117
111
|
removeRequestListeners();
|
|
118
112
|
reject(err);
|
|
@@ -130,21 +124,6 @@ class BaseHttpAdapter {
|
|
|
130
124
|
reject((0, error_1.parseError)(await (0, utils_1.getAsText)(decompressionResult.response)));
|
|
131
125
|
}
|
|
132
126
|
};
|
|
133
|
-
function onTimeout() {
|
|
134
|
-
removeRequestListeners();
|
|
135
|
-
request.once('error', function () {
|
|
136
|
-
/**
|
|
137
|
-
* catch "Error: ECONNRESET" error which shouldn't be reported to users.
|
|
138
|
-
* see the full sequence of events https://nodejs.org/api/http.html#httprequesturl-options-callback
|
|
139
|
-
* */
|
|
140
|
-
});
|
|
141
|
-
request.destroy();
|
|
142
|
-
reject(new Error('Timeout error'));
|
|
143
|
-
}
|
|
144
|
-
function onAbortSignal() {
|
|
145
|
-
// instead of deprecated request.abort()
|
|
146
|
-
request.destroy(new Error('The request was aborted.'));
|
|
147
|
-
}
|
|
148
127
|
function onAbort() {
|
|
149
128
|
// Prefer 'abort' event since it always triggered unlike 'error' and 'close'
|
|
150
129
|
// see the full sequence of events https://nodejs.org/api/http.html#httprequesturl-options-callback
|
|
@@ -163,36 +142,38 @@ class BaseHttpAdapter {
|
|
|
163
142
|
// It's always the last event, according to https://nodejs.org/docs/latest-v14.x/api/http.html#http_http_request_url_options_callback
|
|
164
143
|
removeRequestListeners();
|
|
165
144
|
}
|
|
145
|
+
const config = this.config;
|
|
146
|
+
function onSocket(socket) {
|
|
147
|
+
// Force KeepAlive usage (workaround due to Node.js bug)
|
|
148
|
+
// https://github.com/nodejs/node/issues/47137#issuecomment-1477075229
|
|
149
|
+
socket.setKeepAlive(true, 1000);
|
|
150
|
+
socket.setTimeout(config.request_timeout, onTimeout);
|
|
151
|
+
}
|
|
152
|
+
function onTimeout() {
|
|
153
|
+
removeRequestListeners();
|
|
154
|
+
request.destroy();
|
|
155
|
+
reject(new Error('Timeout error'));
|
|
156
|
+
}
|
|
166
157
|
function removeRequestListeners() {
|
|
158
|
+
if (request.socket !== null) {
|
|
159
|
+
request.socket.setTimeout(0); // reset previously set timeout
|
|
160
|
+
request.socket.removeListener('timeout', onTimeout);
|
|
161
|
+
}
|
|
162
|
+
request.removeListener('socket', onSocket);
|
|
167
163
|
request.removeListener('response', onResponse);
|
|
168
164
|
request.removeListener('error', onError);
|
|
169
|
-
request.removeListener('timeout', onTimeout);
|
|
170
|
-
request.removeListener('abort', onAbort);
|
|
171
165
|
request.removeListener('close', onClose);
|
|
172
166
|
if (params.abort_signal !== undefined) {
|
|
173
|
-
|
|
174
|
-
params.abort_signal.removeEventListener('abort', onAbortSignal);
|
|
175
|
-
}
|
|
176
|
-
else {
|
|
177
|
-
// @ts-expect-error if it's EventEmitter
|
|
178
|
-
params.abort_signal.removeListener('abort', onAbortSignal);
|
|
179
|
-
}
|
|
167
|
+
request.removeListener('abort', onAbort);
|
|
180
168
|
}
|
|
181
169
|
}
|
|
182
|
-
|
|
183
|
-
// We should use signal API when nodejs v14 is not supported anymore.
|
|
184
|
-
// However, it seems that Http.request doesn't abort after 'response' event.
|
|
185
|
-
// Requires an additional investigation
|
|
186
|
-
// https://nodejs.org/api/globals.html#class-abortsignal
|
|
187
|
-
params.abort_signal.addEventListener('abort', onAbortSignal, {
|
|
188
|
-
once: true,
|
|
189
|
-
});
|
|
190
|
-
}
|
|
170
|
+
request.on('socket', onSocket);
|
|
191
171
|
request.on('response', onResponse);
|
|
192
|
-
request.on('timeout', onTimeout);
|
|
193
172
|
request.on('error', onError);
|
|
194
|
-
request.on('abort', onAbort);
|
|
195
173
|
request.on('close', onClose);
|
|
174
|
+
if (params.abort_signal !== undefined) {
|
|
175
|
+
params.abort_signal.addEventListener('abort', onAbort, { once: true });
|
|
176
|
+
}
|
|
196
177
|
if (!params.body)
|
|
197
178
|
return request.end();
|
|
198
179
|
const bodyStream = (0, utils_1.isStream)(params.body)
|
|
@@ -273,13 +254,14 @@ class BaseHttpAdapter {
|
|
|
273
254
|
session_id: params.session_id,
|
|
274
255
|
query_id,
|
|
275
256
|
});
|
|
276
|
-
await this.request({
|
|
257
|
+
const stream = await this.request({
|
|
277
258
|
method: 'POST',
|
|
278
259
|
url: (0, transform_url_1.transformUrl)({ url: this.config.url, pathname: '/', searchParams }),
|
|
279
260
|
body: params.values,
|
|
280
261
|
abort_signal: params.abort_signal,
|
|
281
262
|
compress_request: this.config.compression.compress_request,
|
|
282
263
|
});
|
|
264
|
+
stream.destroy();
|
|
283
265
|
return { query_id };
|
|
284
266
|
}
|
|
285
267
|
async close() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base_http_adapter.js","sourceRoot":"","sources":["../../../src/connection/adapter/base_http_adapter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA2B;AAE3B,gDAAuB;AACvB,uCAAwC;
|
|
1
|
+
{"version":3,"file":"base_http_adapter.js","sourceRoot":"","sources":["../../../src/connection/adapter/base_http_adapter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA2B;AAE3B,gDAAuB;AACvB,uCAAwC;AAexC,6DAAqD;AACrD,mDAA8C;AAC9C,uCAAiD;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3B;SACF,CAAC,CAAA;IACJ,CAAC;IAES,UAAU,CAAC,MAAqB;QACxC,OAAO;YACL,GAAG,IAAI,CAAC,OAAO;YACf,GAAG,CAAC,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACpE,GAAG,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACnE,CAAA;IACH,CAAC;CACF;AAnQD,0CAmQC"}
|
|
@@ -6,5 +6,5 @@ import type { RequestParams } from './base_http_adapter';
|
|
|
6
6
|
import { BaseHttpAdapter } from './base_http_adapter';
|
|
7
7
|
export declare class HttpAdapter extends BaseHttpAdapter implements Connection {
|
|
8
8
|
constructor(config: ConnectionParams, logger: LogWriter);
|
|
9
|
-
protected createClientRequest(
|
|
9
|
+
protected createClientRequest(params: RequestParams, abort_signal?: AbortSignal): Http.ClientRequest;
|
|
10
10
|
}
|
|
@@ -10,16 +10,16 @@ class HttpAdapter extends base_http_adapter_1.BaseHttpAdapter {
|
|
|
10
10
|
constructor(config, logger) {
|
|
11
11
|
const agent = new http_1.default.Agent({
|
|
12
12
|
keepAlive: true,
|
|
13
|
-
timeout: config.request_timeout,
|
|
14
13
|
maxSockets: config.max_open_connections,
|
|
15
14
|
});
|
|
16
15
|
super(config, logger, agent);
|
|
17
16
|
}
|
|
18
|
-
createClientRequest(
|
|
17
|
+
createClientRequest(params, abort_signal) {
|
|
19
18
|
return http_1.default.request(params.url, {
|
|
20
19
|
method: params.method,
|
|
21
20
|
agent: this.agent,
|
|
22
21
|
headers: this.getHeaders(params),
|
|
22
|
+
signal: abort_signal,
|
|
23
23
|
});
|
|
24
24
|
}
|
|
25
25
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http_adapter.js","sourceRoot":"","sources":["../../../src/connection/adapter/http_adapter.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAuB;AAKvB,2DAAqD;AAErD,MAAa,WAAY,SAAQ,mCAAe;IAC9C,YAAY,MAAwB,EAAE,MAAiB;QACrD,MAAM,KAAK,GAAG,IAAI,cAAI,CAAC,KAAK,CAAC;YAC3B,SAAS,EAAE,IAAI;YACf,
|
|
1
|
+
{"version":3,"file":"http_adapter.js","sourceRoot":"","sources":["../../../src/connection/adapter/http_adapter.ts"],"names":[],"mappings":";;;;;;AAAA,gDAAuB;AAKvB,2DAAqD;AAErD,MAAa,WAAY,SAAQ,mCAAe;IAC9C,YAAY,MAAwB,EAAE,MAAiB;QACrD,MAAM,KAAK,GAAG,IAAI,cAAI,CAAC,KAAK,CAAC;YAC3B,SAAS,EAAE,IAAI;YACf,UAAU,EAAE,MAAM,CAAC,oBAAoB;SACxC,CAAC,CAAA;QACF,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,CAAA;IAC9B,CAAC;IAES,mBAAmB,CAC3B,MAAqB,EACrB,YAA0B;QAE1B,OAAO,cAAI,CAAC,OAAO,CAAC,MAAM,CAAC,GAAG,EAAE;YAC9B,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC;YAChC,MAAM,EAAE,YAAY;SACrB,CAAC,CAAA;IACJ,CAAC;CACF;AApBD,kCAoBC"}
|
|
@@ -7,5 +7,5 @@ import type Http from 'http';
|
|
|
7
7
|
export declare class HttpsAdapter extends BaseHttpAdapter implements Connection {
|
|
8
8
|
constructor(config: ConnectionParams, logger: LogWriter);
|
|
9
9
|
protected buildDefaultHeaders(username: string, password: string): Http.OutgoingHttpHeaders;
|
|
10
|
-
protected createClientRequest(
|
|
10
|
+
protected createClientRequest(params: RequestParams, abort_signal?: AbortSignal): Http.ClientRequest;
|
|
11
11
|
}
|
|
@@ -11,7 +11,6 @@ class HttpsAdapter extends base_http_adapter_1.BaseHttpAdapter {
|
|
|
11
11
|
var _a, _b, _c;
|
|
12
12
|
const agent = new https_1.default.Agent({
|
|
13
13
|
keepAlive: true,
|
|
14
|
-
timeout: config.request_timeout,
|
|
15
14
|
maxSockets: config.max_open_connections,
|
|
16
15
|
ca: (_a = config.tls) === null || _a === void 0 ? void 0 : _a.ca_cert,
|
|
17
16
|
key: ((_b = config.tls) === null || _b === void 0 ? void 0 : _b.type) === 'Mutual' ? config.tls.key : undefined,
|
|
@@ -36,11 +35,12 @@ class HttpsAdapter extends base_http_adapter_1.BaseHttpAdapter {
|
|
|
36
35
|
}
|
|
37
36
|
return super.buildDefaultHeaders(username, password);
|
|
38
37
|
}
|
|
39
|
-
createClientRequest(
|
|
38
|
+
createClientRequest(params, abort_signal) {
|
|
40
39
|
return https_1.default.request(params.url, {
|
|
41
40
|
method: params.method,
|
|
42
41
|
agent: this.agent,
|
|
43
42
|
headers: this.getHeaders(params),
|
|
43
|
+
signal: abort_signal,
|
|
44
44
|
});
|
|
45
45
|
}
|
|
46
46
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"https_adapter.js","sourceRoot":"","sources":["../../../src/connection/adapter/https_adapter.ts"],"names":[],"mappings":";;;;;;AACA,2DAAqD;AAGrD,kDAAyB;AAGzB,MAAa,YAAa,SAAQ,mCAAe;IAC/C,YAAY,MAAwB,EAAE,MAAiB;;QACrD,MAAM,KAAK,GAAG,IAAI,eAAK,CAAC,KAAK,CAAC;YAC5B,SAAS,EAAE,IAAI;YACf,
|
|
1
|
+
{"version":3,"file":"https_adapter.js","sourceRoot":"","sources":["../../../src/connection/adapter/https_adapter.ts"],"names":[],"mappings":";;;;;;AACA,2DAAqD;AAGrD,kDAAyB;AAGzB,MAAa,YAAa,SAAQ,mCAAe;IAC/C,YAAY,MAAwB,EAAE,MAAiB;;QACrD,MAAM,KAAK,GAAG,IAAI,eAAK,CAAC,KAAK,CAAC;YAC5B,SAAS,EAAE,I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YAAY;SACrB,CAAC,CAAA;IACJ,CAAC;CACF;AA3CD,oCA2CC"}
|
|
@@ -6,7 +6,6 @@ import type { ClickHouseSettings } from '../settings';
|
|
|
6
6
|
export interface ConnectionParams {
|
|
7
7
|
url: URL;
|
|
8
8
|
application_id?: string;
|
|
9
|
-
connect_timeout: number;
|
|
10
9
|
request_timeout: number;
|
|
11
10
|
max_open_connections: number;
|
|
12
11
|
compression: {
|
|
@@ -38,18 +37,22 @@ export interface BaseParams {
|
|
|
38
37
|
export interface InsertParams extends BaseParams {
|
|
39
38
|
values: string | Stream.Readable;
|
|
40
39
|
}
|
|
41
|
-
export
|
|
42
|
-
|
|
40
|
+
export type QueryParams = BaseParams;
|
|
41
|
+
export type ExecParams = BaseParams;
|
|
42
|
+
export interface BaseResult {
|
|
43
43
|
query_id: string;
|
|
44
44
|
}
|
|
45
|
-
export interface
|
|
45
|
+
export interface QueryResult extends BaseResult {
|
|
46
|
+
stream: Stream.Readable;
|
|
46
47
|
query_id: string;
|
|
47
48
|
}
|
|
49
|
+
export type InsertResult = BaseResult;
|
|
50
|
+
export type ExecResult = QueryResult;
|
|
48
51
|
export interface Connection {
|
|
49
52
|
ping(): Promise<boolean>;
|
|
50
53
|
close(): Promise<void>;
|
|
51
|
-
query(params:
|
|
52
|
-
exec(params:
|
|
54
|
+
query(params: QueryParams): Promise<QueryResult>;
|
|
55
|
+
exec(params: ExecParams): Promise<ExecResult>;
|
|
53
56
|
insert(params: InsertParams): Promise<InsertResult>;
|
|
54
57
|
}
|
|
55
58
|
export declare function createConnection(params: ConnectionParams, logger: LogWriter): Connection;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../src/connection/connection.ts"],"names":[],"mappings":";;;AAEA,uCAAqD;
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../src/connection/connection.ts"],"names":[],"mappings":";;;AAEA,uCAAqD;AAuErD,SAAgB,gBAAgB,CAC9B,MAAwB,EACxB,MAAiB;IAEjB,oCAAoC;IACpC,QAAQ,MAAM,CAAC,GAAG,CAAC,QAAQ,EAAE;QAC3B,KAAK,OAAO;YACV,OAAO,IAAI,qBAAW,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QACxC,KAAK,QAAQ;YACX,OAAO,IAAI,sBAAY,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;QACzC;YACE,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAA;KACzD;AACH,CAAC;AAbD,4CAaC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ declare const _default: {
|
|
|
4
4
|
createClient: typeof createClient;
|
|
5
5
|
};
|
|
6
6
|
export default _default;
|
|
7
|
-
export { type ClickHouseClientConfigOptions, type ClickHouseClient, type BaseParams, type QueryParams, type ExecParams, type InsertParams, } from './client';
|
|
7
|
+
export { type ClickHouseClientConfigOptions, type ClickHouseClient, type BaseParams, type QueryParams, type ExecParams, type InsertParams, type CommandParams, type CommandResult, } from './client';
|
|
8
8
|
export { Row, ResultSet } from './result';
|
|
9
|
-
export type { Connection } from './connection';
|
|
9
|
+
export type { Connection, ExecResult, InsertResult } from './connection';
|
|
10
10
|
export type { DataFormat } from './data_formatter';
|
|
11
11
|
export type { ClickHouseError } from './error';
|
|
12
12
|
export type { Logger } from './logger';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AAE9B,6FAFA,qBAAY,OAEA;AACrB,kBAAe;IACb,YAAY,EAAZ,qBAAY;CACb,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,qCAAuC;AAE9B,6FAFA,qBAAY,OAEA;AACrB,kBAAe;IACb,YAAY,EAAZ,qBAAY;CACb,CAAA;AAaD,mCAAyC;AAA3B,mGAAA,SAAS,OAAA;AAYvB,uCAAwC;AAA/B,uGAAA,WAAW,OAAA"}
|
package/dist/schema/table.d.ts
CHANGED
|
@@ -27,18 +27,18 @@ export interface SelectOptions<S extends Shape> {
|
|
|
27
27
|
where?: WhereExpr<S>;
|
|
28
28
|
order_by?: NonEmptyArray<[keyof S, 'ASC' | 'DESC']>;
|
|
29
29
|
clickhouse_settings?: ClickHouseSettings;
|
|
30
|
-
|
|
30
|
+
abort_controller?: AbortController;
|
|
31
31
|
}
|
|
32
32
|
export interface InsertOptions<S extends Shape> {
|
|
33
33
|
values: Infer<S>[] | InsertStream<Infer<S>>;
|
|
34
34
|
clickhouse_settings?: ClickHouseSettings;
|
|
35
|
-
|
|
35
|
+
abort_controller?: AbortController;
|
|
36
36
|
}
|
|
37
37
|
export declare class Table<S extends Shape> {
|
|
38
38
|
private readonly client;
|
|
39
39
|
private readonly options;
|
|
40
40
|
constructor(client: ClickHouseClient, options: TableOptions<S>);
|
|
41
41
|
create(options: CreateTableOptions<S>): Promise<Stream.Readable>;
|
|
42
|
-
insert({
|
|
43
|
-
select({
|
|
42
|
+
insert({ abort_controller, clickhouse_settings, values, }: InsertOptions<S>): Promise<void>;
|
|
43
|
+
select({ abort_controller, clickhouse_settings, columns, order_by, where, }?: SelectOptions<S>): Promise<SelectResult<Infer<S>>>;
|
|
44
44
|
}
|
package/dist/schema/table.js
CHANGED
|
@@ -26,21 +26,21 @@ class Table {
|
|
|
26
26
|
});
|
|
27
27
|
return stream;
|
|
28
28
|
}
|
|
29
|
-
async insert({
|
|
29
|
+
async insert({ abort_controller, clickhouse_settings, values, }) {
|
|
30
30
|
await this.client.insert({
|
|
31
31
|
clickhouse_settings,
|
|
32
|
-
abort_signal,
|
|
32
|
+
abort_signal: abort_controller === null || abort_controller === void 0 ? void 0 : abort_controller.signal,
|
|
33
33
|
table: (0, query_formatter_1.getTableName)(this.options),
|
|
34
34
|
format: 'JSONEachRow',
|
|
35
35
|
values,
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
|
-
async select({
|
|
38
|
+
async select({ abort_controller, clickhouse_settings, columns, order_by, where, } = {}) {
|
|
39
39
|
const query = query_formatter_1.QueryFormatter.select(this.options, where, columns, order_by);
|
|
40
40
|
const rs = await this.client.query({
|
|
41
41
|
query,
|
|
42
42
|
clickhouse_settings,
|
|
43
|
-
abort_signal,
|
|
43
|
+
abort_signal: abort_controller === null || abort_controller === void 0 ? void 0 : abort_controller.signal,
|
|
44
44
|
format: 'JSONEachRow',
|
|
45
45
|
});
|
|
46
46
|
const stream = rs.stream();
|
package/dist/schema/table.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.js","sourceRoot":"","sources":["../../src/schema/table.ts"],"names":[],"mappings":";;;AAGA,uDAAgE;AA4ChE,MAAa,KAAK;IAChB,YACmB,MAAwB,EACxB,OAAwB;;;;;mBADxB;;;;;;mBACA;;IAChB,CAAC;IAEJ,qBAAqB;IACrB,KAAK,CAAC,MAAM,CAAC,OAA8B;QACzC,MAAM,KAAK,GAAG,gCAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAA;QAC/D,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YACxC,KAAK;YACL,mBAAmB,EAAE,OAAO,CAAC,mBAAmB;SACjD,CAAC,CAAA;QACF,OAAO,MAAM,CAAA;IACf,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,EACX,
|
|
1
|
+
{"version":3,"file":"table.js","sourceRoot":"","sources":["../../src/schema/table.ts"],"names":[],"mappings":";;;AAGA,uDAAgE;AA4ChE,MAAa,KAAK;IAChB,YACmB,MAAwB,EACxB,OAAwB;;;;;mBADxB;;;;;;mBACA;;IAChB,CAAC;IAEJ,qBAAqB;IACrB,KAAK,CAAC,MAAM,CAAC,OAA8B;QACzC,MAAM,KAAK,GAAG,gCAAc,CAAC,WAAW,CAAC,IAAI,CAAC,OAA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B,CAAA;iBACxB;aACF;QACH,CAAC;QAED,OAAO;YACL,cAAc;YACd,IAAI,EAAE,KAAK,IAAI,EAAE;gBACf,MAAM,MAAM,GAAG,EAAE,CAAA;gBACjB,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,cAAc,EAAE,EAAE;oBAC1C,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE;wBACxB,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAA;qBACtB;yBAAM;wBACL,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;qBACnB;iBACF;gBACD,OAAO,MAAM,CAAA;YACf,CAAC;SACF,CAAA;IACH,CAAC;CACF;AAtED,sBAsEC"}
|
package/dist/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "0.0
|
|
1
|
+
declare const _default: "0.1.0";
|
|
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,OAAO,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@clickhouse/client",
|
|
3
|
-
"version": "0.0
|
|
3
|
+
"version": "0.1.0",
|
|
4
4
|
"description": "Official JS client for ClickHouse DB",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
"dist"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"node-abort-controller": "^3.0.1",
|
|
41
40
|
"uuid": "^9.0.0"
|
|
42
41
|
},
|
|
43
42
|
"devDependencies": {
|