@clickhouse/client 1.22.0 → 1.23.0-head.287977a.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 +2 -1
- package/dist/client.d.ts +2 -2
- package/dist/client.js +11 -4
- package/dist/client.js.map +1 -1
- package/dist/common/clickhouse_types.d.ts +98 -0
- package/dist/common/clickhouse_types.js +30 -0
- package/dist/common/clickhouse_types.js.map +1 -0
- package/dist/common/client.d.ts +233 -0
- package/dist/common/client.js +414 -0
- package/dist/common/client.js.map +1 -0
- package/dist/common/config.d.ts +234 -0
- package/dist/common/config.js +364 -0
- package/dist/common/config.js.map +1 -0
- package/dist/common/connection.d.ts +124 -0
- package/dist/common/connection.js +3 -0
- package/dist/common/connection.js.map +1 -0
- package/dist/common/data_formatter/format_query_params.d.ts +11 -0
- package/dist/common/data_formatter/format_query_params.js +128 -0
- package/dist/common/data_formatter/format_query_params.js.map +1 -0
- package/dist/common/data_formatter/format_query_settings.d.ts +2 -0
- package/dist/common/data_formatter/format_query_settings.js +20 -0
- package/dist/common/data_formatter/format_query_settings.js.map +1 -0
- package/dist/common/data_formatter/formatter.d.ts +41 -0
- package/dist/common/data_formatter/formatter.js +78 -0
- package/dist/common/data_formatter/formatter.js.map +1 -0
- package/dist/common/data_formatter/index.d.ts +3 -0
- package/dist/common/data_formatter/index.js +24 -0
- package/dist/common/data_formatter/index.js.map +1 -0
- package/dist/common/error/error.d.ts +20 -0
- package/dist/common/error/error.js +73 -0
- package/dist/common/error/error.js.map +1 -0
- package/dist/common/error/index.d.ts +1 -0
- package/dist/common/error/index.js +18 -0
- package/dist/common/error/index.js.map +1 -0
- package/dist/common/index.d.ts +67 -0
- package/dist/common/index.js +97 -0
- package/dist/common/index.js.map +1 -0
- package/dist/common/logger.d.ts +80 -0
- package/dist/common/logger.js +154 -0
- package/dist/common/logger.js.map +1 -0
- package/dist/common/parse/column_types.d.ts +155 -0
- package/dist/common/parse/column_types.js +594 -0
- package/dist/common/parse/column_types.js.map +1 -0
- package/dist/common/parse/index.d.ts +2 -0
- package/dist/common/parse/index.js +19 -0
- package/dist/common/parse/index.js.map +1 -0
- package/dist/common/parse/json_handling.d.ts +19 -0
- package/dist/common/parse/json_handling.js +8 -0
- package/dist/common/parse/json_handling.js.map +1 -0
- package/dist/common/result.d.ts +90 -0
- package/dist/common/result.js +3 -0
- package/dist/common/result.js.map +1 -0
- package/dist/common/settings.d.ts +2007 -0
- package/dist/common/settings.js +19 -0
- package/dist/common/settings.js.map +1 -0
- package/dist/common/tracing.d.ts +146 -0
- package/dist/common/tracing.js +76 -0
- package/dist/common/tracing.js.map +1 -0
- package/dist/common/ts_utils.d.ts +4 -0
- package/dist/common/ts_utils.js +3 -0
- package/dist/common/ts_utils.js.map +1 -0
- package/dist/common/utils/connection.d.ts +21 -0
- package/dist/common/utils/connection.js +43 -0
- package/dist/common/utils/connection.js.map +1 -0
- package/dist/common/utils/index.d.ts +5 -0
- package/dist/common/utils/index.js +22 -0
- package/dist/common/utils/index.js.map +1 -0
- package/dist/common/utils/multipart.d.ts +34 -0
- package/dist/common/utils/multipart.js +81 -0
- package/dist/common/utils/multipart.js.map +1 -0
- package/dist/common/utils/sleep.d.ts +4 -0
- package/dist/common/utils/sleep.js +12 -0
- package/dist/common/utils/sleep.js.map +1 -0
- package/dist/common/utils/stream.d.ts +15 -0
- package/dist/common/utils/stream.js +50 -0
- package/dist/common/utils/stream.js.map +1 -0
- package/dist/common/utils/url.d.ts +20 -0
- package/dist/common/utils/url.js +67 -0
- package/dist/common/utils/url.js.map +1 -0
- package/dist/common/version.d.ts +2 -0
- package/dist/common/version.js +4 -0
- package/dist/common/version.js.map +1 -0
- package/dist/config.d.ts +22 -2
- package/dist/config.js +2 -2
- package/dist/config.js.map +1 -1
- package/dist/connection/compression.d.ts +2 -2
- package/dist/connection/compression.js +4 -4
- package/dist/connection/compression.js.map +1 -1
- package/dist/connection/create_connection.d.ts +1 -1
- package/dist/connection/node_base_connection.d.ts +3 -3
- package/dist/connection/node_base_connection.js +22 -22
- package/dist/connection/node_base_connection.js.map +1 -1
- package/dist/connection/node_custom_agent_connection.js +2 -2
- package/dist/connection/node_custom_agent_connection.js.map +1 -1
- package/dist/connection/node_http_connection.js +2 -2
- package/dist/connection/node_http_connection.js.map +1 -1
- package/dist/connection/node_https_connection.d.ts +1 -1
- package/dist/connection/node_https_connection.js +3 -3
- package/dist/connection/node_https_connection.js.map +1 -1
- package/dist/connection/socket_pool.d.ts +1 -1
- package/dist/connection/socket_pool.js +30 -30
- package/dist/connection/socket_pool.js.map +1 -1
- package/dist/connection/stream.d.ts +1 -1
- package/dist/connection/stream.js +9 -9
- package/dist/connection/stream.js.map +1 -1
- package/dist/index.d.ts +9 -7
- package/dist/index.js +26 -24
- package/dist/index.js.map +1 -1
- package/dist/result_set.d.ts +1 -1
- package/dist/result_set.js +10 -10
- package/dist/result_set.js.map +1 -1
- package/dist/utils/encoder.d.ts +1 -1
- package/dist/utils/encoder.js +5 -5
- package/dist/utils/encoder.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 +7 -5
- package/skills/clickhouse-js-node-rowbinary-parser/EXAMPLES.md +48 -0
- package/skills/clickhouse-js-node-rowbinary-parser/README.md +255 -0
- package/skills/clickhouse-js-node-rowbinary-parser/SKILL.md +206 -0
- package/skills/clickhouse-js-node-rowbinary-parser/case-studies/iot-rowbinary-vs-json.md +83 -0
- package/skills/clickhouse-js-node-rowbinary-parser/case-studies/ledger-rowbinary-vs-json.md +103 -0
- package/skills/clickhouse-js-node-rowbinary-parser/case-studies/logs-json-wins.md +86 -0
- package/skills/clickhouse-js-node-rowbinary-parser/case-studies/wasm-vs-js.md +172 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/aggregateFunction.ts +34 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/bool.ts +10 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/columnar.ts +125 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/compile.ts +318 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/composite.ts +181 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/core.ts +77 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/datetime.ts +113 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/decimals.ts +57 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/dynamic.ts +328 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/enums.ts +28 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/examples/carts.ts +71 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/examples/events.ts +51 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/examples/iot.ts +158 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/examples/ledger.ts +98 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/examples/logs.ts +73 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/examples/observability.ts +142 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/examples/orders.ts +65 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/examples/profiles.ts +60 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/examples/telemetry.ts +102 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/floats.ts +32 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/geo.ts +109 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/header.ts +29 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/integers.ts +95 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/interval.ts +54 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/ip.ts +93 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/json.ts +33 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/lowCardinality.ts +18 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/nested.ts +23 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/nothing.ts +29 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/reader.ts +68 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/rowBinaryWithNamesAndTypes.ts +155 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/rows.ts +58 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/simpleAggregateFunction.ts +20 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/stream.ts +276 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/strings.ts +55 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/time.ts +61 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/uuid.ts +153 -0
- package/skills/clickhouse-js-node-rowbinary-parser/src/varint.ts +70 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import type { ProgressRow, ResponseHeaders, ResponseJSON, SpecialEventRow } from "./clickhouse_types";
|
|
2
|
+
import type { DataFormat, RawDataFormat, RecordsJSONFormat, SingleDocumentJSONFormat, StreamableDataFormat, StreamableJSONDataFormat } from "./data_formatter";
|
|
3
|
+
export type RowOrProgress<T> = {
|
|
4
|
+
row: T;
|
|
5
|
+
} | ProgressRow | SpecialEventRow<T>;
|
|
6
|
+
export type ResultStream<Format extends DataFormat | unknown, Stream> = Format extends StreamableDataFormat ? Stream : Format extends SingleDocumentJSONFormat ? never : Format extends RecordsJSONFormat ? never : Stream;
|
|
7
|
+
export type ResultJSONType<T, F extends DataFormat | unknown> = F extends "JSONEachRowWithProgress" ? RowOrProgress<T>[] : F extends StreamableJSONDataFormat ? T[] : F extends SingleDocumentJSONFormat ? ResponseJSON<T> : F extends RecordsJSONFormat ? Record<string, T> : F extends RawDataFormat ? never : // happens only when Format could not be inferred from a literal
|
|
8
|
+
T[] | Record<string, T> | ResponseJSON<T>;
|
|
9
|
+
export type RowJSONType<T, F extends DataFormat | unknown> = F extends "JSONEachRowWithProgress" ? RowOrProgress<T> : F extends StreamableJSONDataFormat ? T : F extends RawDataFormat | SingleDocumentJSONFormat | RecordsJSONFormat ? never : T;
|
|
10
|
+
export interface Row<JSONType = unknown, Format extends DataFormat | unknown = unknown> {
|
|
11
|
+
/** A string representation of a row. */
|
|
12
|
+
text: string;
|
|
13
|
+
/**
|
|
14
|
+
* Returns a JSON representation of a row.
|
|
15
|
+
* The method will throw if called on a response in JSON incompatible format.
|
|
16
|
+
* It is safe to call this method multiple times.
|
|
17
|
+
*/
|
|
18
|
+
json<T = JSONType>(): RowJSONType<T, Format>;
|
|
19
|
+
}
|
|
20
|
+
export interface BaseResultSet<Stream, Format extends DataFormat | unknown> {
|
|
21
|
+
/**
|
|
22
|
+
* The method waits for all the rows to be fully loaded
|
|
23
|
+
* and returns the result as a string.
|
|
24
|
+
*
|
|
25
|
+
* It is possible to call this method for all supported formats.
|
|
26
|
+
*
|
|
27
|
+
* The method should throw if the underlying stream was already consumed
|
|
28
|
+
* by calling the other methods.
|
|
29
|
+
*/
|
|
30
|
+
text(): Promise<string>;
|
|
31
|
+
/**
|
|
32
|
+
* The method waits for the all the rows to be fully loaded.
|
|
33
|
+
* When the response is received in full, it will be decoded to return JSON.
|
|
34
|
+
*
|
|
35
|
+
* Should be called only for JSON* formats family.
|
|
36
|
+
*
|
|
37
|
+
* The method should throw if the underlying stream was already consumed
|
|
38
|
+
* by calling the other methods, or if it is called for non-JSON formats,
|
|
39
|
+
* such as CSV, TSV, etc.
|
|
40
|
+
*/
|
|
41
|
+
json<T = unknown>(): Promise<ResultJSONType<T, Format>>;
|
|
42
|
+
/**
|
|
43
|
+
* Returns a readable stream for responses that can be streamed.
|
|
44
|
+
*
|
|
45
|
+
* Formats that CAN be streamed ({@link StreamableDataFormat}):
|
|
46
|
+
* * JSONEachRow
|
|
47
|
+
* * JSONStringsEachRow
|
|
48
|
+
* * JSONCompactEachRow
|
|
49
|
+
* * JSONCompactStringsEachRow
|
|
50
|
+
* * JSONCompactEachRowWithNames
|
|
51
|
+
* * JSONCompactEachRowWithNamesAndTypes
|
|
52
|
+
* * JSONCompactStringsEachRowWithNames
|
|
53
|
+
* * JSONCompactStringsEachRowWithNamesAndTypes
|
|
54
|
+
* * CSV
|
|
55
|
+
* * CSVWithNames
|
|
56
|
+
* * CSVWithNamesAndTypes
|
|
57
|
+
* * TabSeparated
|
|
58
|
+
* * TabSeparatedRaw
|
|
59
|
+
* * TabSeparatedWithNames
|
|
60
|
+
* * TabSeparatedWithNamesAndTypes
|
|
61
|
+
* * CustomSeparated
|
|
62
|
+
* * CustomSeparatedWithNames
|
|
63
|
+
* * CustomSeparatedWithNamesAndTypes
|
|
64
|
+
* * Parquet
|
|
65
|
+
*
|
|
66
|
+
* Formats that CANNOT be streamed (the method returns "never" in TS):
|
|
67
|
+
* * JSON
|
|
68
|
+
* * JSONStrings
|
|
69
|
+
* * JSONCompact
|
|
70
|
+
* * JSONCompactStrings
|
|
71
|
+
* * JSONColumnsWithMetadata
|
|
72
|
+
* * JSONObjectEachRow
|
|
73
|
+
*
|
|
74
|
+
* Every iteration provides an array of {@link Row} instances
|
|
75
|
+
* for {@link StreamableDataFormat} format.
|
|
76
|
+
*
|
|
77
|
+
* Should be called only once.
|
|
78
|
+
*
|
|
79
|
+
* The method should throw if called on a response in non-streamable format,
|
|
80
|
+
* and if the underlying stream was already consumed
|
|
81
|
+
* by calling the other methods.
|
|
82
|
+
*/
|
|
83
|
+
stream(): ResultStream<Format, Stream>;
|
|
84
|
+
/** Close the underlying stream. */
|
|
85
|
+
close(): void;
|
|
86
|
+
/** ClickHouse server QueryID. */
|
|
87
|
+
query_id: string;
|
|
88
|
+
/** Response headers. */
|
|
89
|
+
response_headers: ResponseHeaders;
|
|
90
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"result.js","sourceRoot":"","sources":["../../src/common/result.ts"],"names":[],"mappings":""}
|