@clickhouse/client-common 1.6.0 → 1.8.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/README.md +2 -0
- package/dist/clickhouse_types.d.ts +7 -0
- package/dist/clickhouse_types.js +9 -0
- package/dist/clickhouse_types.js.map +1 -1
- package/dist/client.d.ts +5 -0
- package/dist/client.js +9 -0
- package/dist/client.js.map +1 -1
- package/dist/config.d.ts +3 -0
- package/dist/config.js +9 -10
- package/dist/config.js.map +1 -1
- package/dist/connection.d.ts +1 -0
- package/dist/data_formatter/format_query_params.js +1 -2
- package/dist/data_formatter/format_query_params.js.map +1 -1
- package/dist/data_formatter/format_query_settings.js +1 -2
- package/dist/data_formatter/format_query_settings.js.map +1 -1
- package/dist/data_formatter/formatter.d.ts +3 -3
- package/dist/data_formatter/formatter.js +7 -6
- package/dist/data_formatter/formatter.js.map +1 -1
- package/dist/error/parse_error.js +2 -2
- package/dist/error/parse_error.js.map +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/dist/parse/column_types.d.ts +127 -0
- package/dist/parse/column_types.js +545 -0
- package/dist/parse/column_types.js.map +1 -0
- package/dist/parse/index.d.ts +1 -0
- package/dist/parse/index.js +18 -0
- package/dist/parse/index.js.map +1 -0
- package/dist/result.d.ts +6 -3
- package/dist/utils/connection.js +3 -4
- package/dist/utils/connection.js.map +1 -1
- package/dist/utils/sleep.js +1 -2
- package/dist/utils/sleep.js.map +1 -1
- package/dist/utils/url.d.ts +2 -1
- package/dist/utils/url.js +13 -4
- package/dist/utils/url.js.map +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,545 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SimpleColumnTypes = exports.ColumnTypeParseError = void 0;
|
|
4
|
+
exports.parseColumnType = parseColumnType;
|
|
5
|
+
exports.parseDecimalType = parseDecimalType;
|
|
6
|
+
exports.parseEnumType = parseEnumType;
|
|
7
|
+
exports.parseMapType = parseMapType;
|
|
8
|
+
exports.parseTupleType = parseTupleType;
|
|
9
|
+
exports.parseArrayType = parseArrayType;
|
|
10
|
+
exports.parseDateTimeType = parseDateTimeType;
|
|
11
|
+
exports.parseDateTime64Type = parseDateTime64Type;
|
|
12
|
+
exports.parseFixedStringType = parseFixedStringType;
|
|
13
|
+
exports.asNullableType = asNullableType;
|
|
14
|
+
exports.getElementsTypes = getElementsTypes;
|
|
15
|
+
class ColumnTypeParseError extends Error {
|
|
16
|
+
constructor(message, args) {
|
|
17
|
+
super(message);
|
|
18
|
+
Object.defineProperty(this, "args", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
configurable: true,
|
|
21
|
+
writable: true,
|
|
22
|
+
value: void 0
|
|
23
|
+
});
|
|
24
|
+
this.args = args ?? {};
|
|
25
|
+
// Set the prototype explicitly, see:
|
|
26
|
+
// https://github.com/Microsoft/TypeScript/wiki/Breaking-Changes#extending-built-ins-like-error-array-and-map-may-no-longer-work
|
|
27
|
+
Object.setPrototypeOf(this, ColumnTypeParseError.prototype);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.ColumnTypeParseError = ColumnTypeParseError;
|
|
31
|
+
exports.SimpleColumnTypes = [
|
|
32
|
+
'Bool',
|
|
33
|
+
'UInt8',
|
|
34
|
+
'Int8',
|
|
35
|
+
'UInt16',
|
|
36
|
+
'Int16',
|
|
37
|
+
'UInt32',
|
|
38
|
+
'Int32',
|
|
39
|
+
'UInt64',
|
|
40
|
+
'Int64',
|
|
41
|
+
'UInt128',
|
|
42
|
+
'Int128',
|
|
43
|
+
'UInt256',
|
|
44
|
+
'Int256',
|
|
45
|
+
'Float32',
|
|
46
|
+
'Float64',
|
|
47
|
+
'String',
|
|
48
|
+
'UUID',
|
|
49
|
+
'Date',
|
|
50
|
+
'Date32',
|
|
51
|
+
'IPv4',
|
|
52
|
+
'IPv6',
|
|
53
|
+
];
|
|
54
|
+
/**
|
|
55
|
+
* @experimental - incomplete, unstable API;
|
|
56
|
+
* originally intended to be used for RowBinary/Native header parsing internally.
|
|
57
|
+
* Currently unsupported source types:
|
|
58
|
+
* * Geo
|
|
59
|
+
* * (Simple)AggregateFunction
|
|
60
|
+
* * Nested
|
|
61
|
+
* * Old/new JSON
|
|
62
|
+
* * Dynamic
|
|
63
|
+
* * Variant
|
|
64
|
+
*/
|
|
65
|
+
function parseColumnType(sourceType) {
|
|
66
|
+
let columnType = sourceType;
|
|
67
|
+
let isNullable = false;
|
|
68
|
+
if (columnType.startsWith(LowCardinalityPrefix)) {
|
|
69
|
+
columnType = columnType.slice(LowCardinalityPrefix.length, -1);
|
|
70
|
+
}
|
|
71
|
+
if (columnType.startsWith(NullablePrefix)) {
|
|
72
|
+
columnType = columnType.slice(NullablePrefix.length, -1);
|
|
73
|
+
isNullable = true;
|
|
74
|
+
}
|
|
75
|
+
let result;
|
|
76
|
+
if (exports.SimpleColumnTypes.includes(columnType)) {
|
|
77
|
+
result = {
|
|
78
|
+
type: 'Simple',
|
|
79
|
+
columnType: columnType,
|
|
80
|
+
sourceType,
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
else if (columnType.startsWith(DecimalPrefix)) {
|
|
84
|
+
result = parseDecimalType({
|
|
85
|
+
sourceType,
|
|
86
|
+
columnType,
|
|
87
|
+
});
|
|
88
|
+
}
|
|
89
|
+
else if (columnType.startsWith(DateTime64Prefix)) {
|
|
90
|
+
result = parseDateTime64Type({ sourceType, columnType });
|
|
91
|
+
}
|
|
92
|
+
else if (columnType.startsWith(DateTimePrefix)) {
|
|
93
|
+
result = parseDateTimeType({ sourceType, columnType });
|
|
94
|
+
}
|
|
95
|
+
else if (columnType.startsWith(FixedStringPrefix)) {
|
|
96
|
+
result = parseFixedStringType({ sourceType, columnType });
|
|
97
|
+
}
|
|
98
|
+
else if (columnType.startsWith(Enum8Prefix) ||
|
|
99
|
+
columnType.startsWith(Enum16Prefix)) {
|
|
100
|
+
result = parseEnumType({ sourceType, columnType });
|
|
101
|
+
}
|
|
102
|
+
else if (columnType.startsWith(ArrayPrefix)) {
|
|
103
|
+
result = parseArrayType({ sourceType, columnType });
|
|
104
|
+
}
|
|
105
|
+
else if (columnType.startsWith(MapPrefix)) {
|
|
106
|
+
result = parseMapType({ sourceType, columnType });
|
|
107
|
+
}
|
|
108
|
+
else if (columnType.startsWith(TuplePrefix)) {
|
|
109
|
+
result = parseTupleType({ sourceType, columnType });
|
|
110
|
+
}
|
|
111
|
+
else {
|
|
112
|
+
throw new ColumnTypeParseError('Unsupported column type', { columnType });
|
|
113
|
+
}
|
|
114
|
+
if (isNullable) {
|
|
115
|
+
return asNullableType(result, sourceType);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
return result;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
function parseDecimalType({ columnType, sourceType, }) {
|
|
122
|
+
if (!columnType.startsWith(DecimalPrefix) ||
|
|
123
|
+
columnType.length < DecimalPrefix.length + 5 // Decimal(1, 0) is the shortest valid definition
|
|
124
|
+
) {
|
|
125
|
+
throw new ColumnTypeParseError('Invalid Decimal type', {
|
|
126
|
+
sourceType,
|
|
127
|
+
columnType,
|
|
128
|
+
});
|
|
129
|
+
}
|
|
130
|
+
const split = columnType.slice(DecimalPrefix.length, -1).split(', ');
|
|
131
|
+
if (split.length !== 2) {
|
|
132
|
+
throw new ColumnTypeParseError('Expected Decimal type to have both precision and scale', {
|
|
133
|
+
sourceType,
|
|
134
|
+
columnType,
|
|
135
|
+
split,
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
let intSize = 32;
|
|
139
|
+
const precision = parseInt(split[0], 10);
|
|
140
|
+
if (Number.isNaN(precision) || precision < 1 || precision > 76) {
|
|
141
|
+
throw new ColumnTypeParseError('Invalid Decimal precision', {
|
|
142
|
+
columnType,
|
|
143
|
+
sourceType,
|
|
144
|
+
precision,
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
const scale = parseInt(split[1], 10);
|
|
148
|
+
if (Number.isNaN(scale) || scale < 0 || scale > precision) {
|
|
149
|
+
throw new ColumnTypeParseError('Invalid Decimal scale', {
|
|
150
|
+
columnType,
|
|
151
|
+
sourceType,
|
|
152
|
+
precision,
|
|
153
|
+
scale,
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
if (precision > 38) {
|
|
157
|
+
intSize = 256;
|
|
158
|
+
}
|
|
159
|
+
else if (precision > 18) {
|
|
160
|
+
intSize = 128;
|
|
161
|
+
}
|
|
162
|
+
else if (precision > 9) {
|
|
163
|
+
intSize = 64;
|
|
164
|
+
}
|
|
165
|
+
return {
|
|
166
|
+
type: 'Decimal',
|
|
167
|
+
params: {
|
|
168
|
+
precision,
|
|
169
|
+
scale,
|
|
170
|
+
intSize,
|
|
171
|
+
},
|
|
172
|
+
sourceType,
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
function parseEnumType({ columnType, sourceType, }) {
|
|
176
|
+
let intSize;
|
|
177
|
+
if (columnType.startsWith(Enum8Prefix)) {
|
|
178
|
+
columnType = columnType.slice(Enum8Prefix.length, -1);
|
|
179
|
+
intSize = 8;
|
|
180
|
+
}
|
|
181
|
+
else if (columnType.startsWith(Enum16Prefix)) {
|
|
182
|
+
columnType = columnType.slice(Enum16Prefix.length, -1);
|
|
183
|
+
intSize = 16;
|
|
184
|
+
}
|
|
185
|
+
else {
|
|
186
|
+
throw new ColumnTypeParseError('Expected Enum to be either Enum8 or Enum16', {
|
|
187
|
+
columnType,
|
|
188
|
+
sourceType,
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
// The minimal allowed Enum definition is Enum8('' = 0), i.e. 6 chars inside.
|
|
192
|
+
if (columnType.length < 6) {
|
|
193
|
+
throw new ColumnTypeParseError('Invalid Enum type values', {
|
|
194
|
+
columnType,
|
|
195
|
+
sourceType,
|
|
196
|
+
});
|
|
197
|
+
}
|
|
198
|
+
const names = [];
|
|
199
|
+
const indices = [];
|
|
200
|
+
let parsingName = true; // false when parsing the index
|
|
201
|
+
let charEscaped = false; // we should ignore escaped ticks
|
|
202
|
+
let startIndex = 1; // Skip the first '
|
|
203
|
+
// Should support the most complicated enums, such as Enum8('f\'' = 1, 'x =' = 2, 'b\'\'\'' = 3, '\'c=4=' = 42, '4' = 100)
|
|
204
|
+
for (let i = 1; i < columnType.length; i++) {
|
|
205
|
+
if (parsingName) {
|
|
206
|
+
if (charEscaped) {
|
|
207
|
+
charEscaped = false;
|
|
208
|
+
}
|
|
209
|
+
else {
|
|
210
|
+
if (columnType.charCodeAt(i) === BackslashASCII) {
|
|
211
|
+
charEscaped = true;
|
|
212
|
+
}
|
|
213
|
+
else if (columnType.charCodeAt(i) === SingleQuoteASCII) {
|
|
214
|
+
// non-escaped closing tick - push the name
|
|
215
|
+
const name = columnType.slice(startIndex, i);
|
|
216
|
+
if (names.includes(name)) {
|
|
217
|
+
throw new ColumnTypeParseError('Duplicate Enum name', {
|
|
218
|
+
columnType,
|
|
219
|
+
sourceType,
|
|
220
|
+
name,
|
|
221
|
+
names,
|
|
222
|
+
indices,
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
names.push(name);
|
|
226
|
+
i += 4; // skip ` = ` and the first digit, as it will always have at least one.
|
|
227
|
+
startIndex = i;
|
|
228
|
+
parsingName = false;
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
// Parsing the index, skipping next iterations until the first non-digit one
|
|
233
|
+
else if (columnType.charCodeAt(i) < ZeroASCII ||
|
|
234
|
+
columnType.charCodeAt(i) > NineASCII) {
|
|
235
|
+
pushEnumIndex(startIndex, i);
|
|
236
|
+
// the char at this index should be comma.
|
|
237
|
+
i += 2; // skip ` '`, but not the first char - ClickHouse allows something like Enum8('foo' = 0, '' = 42)
|
|
238
|
+
startIndex = i + 1;
|
|
239
|
+
parsingName = true;
|
|
240
|
+
charEscaped = false;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
// Push the last index
|
|
244
|
+
pushEnumIndex(startIndex, columnType.length);
|
|
245
|
+
if (names.length !== indices.length) {
|
|
246
|
+
throw new ColumnTypeParseError('Expected Enum to have the same number of names and indices', { columnType, sourceType, names, indices });
|
|
247
|
+
}
|
|
248
|
+
const values = {};
|
|
249
|
+
for (let i = 0; i < names.length; i++) {
|
|
250
|
+
values[indices[i]] = names[i];
|
|
251
|
+
}
|
|
252
|
+
return {
|
|
253
|
+
type: 'Enum',
|
|
254
|
+
values,
|
|
255
|
+
intSize,
|
|
256
|
+
sourceType,
|
|
257
|
+
};
|
|
258
|
+
function pushEnumIndex(start, end) {
|
|
259
|
+
const index = parseInt(columnType.slice(start, end), 10);
|
|
260
|
+
if (Number.isNaN(index) || index < 0) {
|
|
261
|
+
throw new ColumnTypeParseError('Expected Enum index to be a valid number', {
|
|
262
|
+
columnType,
|
|
263
|
+
sourceType,
|
|
264
|
+
names,
|
|
265
|
+
indices,
|
|
266
|
+
index,
|
|
267
|
+
start,
|
|
268
|
+
end,
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
if (indices.includes(index)) {
|
|
272
|
+
throw new ColumnTypeParseError('Duplicate Enum index', {
|
|
273
|
+
columnType,
|
|
274
|
+
sourceType,
|
|
275
|
+
index,
|
|
276
|
+
names,
|
|
277
|
+
indices,
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
indices.push(index);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
function parseMapType({ columnType, sourceType, }) {
|
|
284
|
+
if (!columnType.startsWith(MapPrefix) ||
|
|
285
|
+
columnType.length < MapPrefix.length + 11 // the shortest definition seems to be Map(Int8, Int8)
|
|
286
|
+
) {
|
|
287
|
+
throw new ColumnTypeParseError('Invalid Map type', {
|
|
288
|
+
columnType,
|
|
289
|
+
sourceType,
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
columnType = columnType.slice(MapPrefix.length, -1);
|
|
293
|
+
const [keyType, valueType] = getElementsTypes({ columnType, sourceType }, 2);
|
|
294
|
+
const key = parseColumnType(keyType);
|
|
295
|
+
if (key.type === 'DateTime64' ||
|
|
296
|
+
key.type === 'Nullable' ||
|
|
297
|
+
key.type === 'Array' ||
|
|
298
|
+
key.type === 'Map' ||
|
|
299
|
+
key.type === 'Decimal' ||
|
|
300
|
+
key.type === 'Tuple') {
|
|
301
|
+
throw new ColumnTypeParseError('Invalid Map key type', {
|
|
302
|
+
key,
|
|
303
|
+
sourceType,
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
const value = parseColumnType(valueType);
|
|
307
|
+
return {
|
|
308
|
+
type: 'Map',
|
|
309
|
+
key,
|
|
310
|
+
value,
|
|
311
|
+
sourceType,
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
function parseTupleType({ columnType, sourceType, }) {
|
|
315
|
+
if (!columnType.startsWith(TuplePrefix) ||
|
|
316
|
+
columnType.length < TuplePrefix.length + 5 // Tuple(Int8) is the shortest valid definition
|
|
317
|
+
) {
|
|
318
|
+
throw new ColumnTypeParseError('Invalid Tuple type', {
|
|
319
|
+
columnType,
|
|
320
|
+
sourceType,
|
|
321
|
+
});
|
|
322
|
+
}
|
|
323
|
+
columnType = columnType.slice(TuplePrefix.length, -1);
|
|
324
|
+
const elements = getElementsTypes({ columnType, sourceType }, 1).map((type) => parseColumnType(type));
|
|
325
|
+
return {
|
|
326
|
+
type: 'Tuple',
|
|
327
|
+
elements,
|
|
328
|
+
sourceType,
|
|
329
|
+
};
|
|
330
|
+
}
|
|
331
|
+
function parseArrayType({ columnType, sourceType, }) {
|
|
332
|
+
if (!columnType.startsWith(ArrayPrefix) ||
|
|
333
|
+
columnType.length < ArrayPrefix.length + 5 // Array(Int8) is the shortest valid definition
|
|
334
|
+
) {
|
|
335
|
+
throw new ColumnTypeParseError('Invalid Array type', {
|
|
336
|
+
columnType,
|
|
337
|
+
sourceType,
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
let dimensions = 0;
|
|
341
|
+
while (columnType.length > 0) {
|
|
342
|
+
if (columnType.startsWith(ArrayPrefix)) {
|
|
343
|
+
columnType = columnType.slice(ArrayPrefix.length, -1); // Array(T) -> T
|
|
344
|
+
dimensions++;
|
|
345
|
+
}
|
|
346
|
+
else {
|
|
347
|
+
break;
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
if (dimensions === 0 || dimensions > 10) {
|
|
351
|
+
// TODO: check how many we can handle; max 10 seems more than enough.
|
|
352
|
+
throw new ColumnTypeParseError('Expected Array to have between 1 and 10 dimensions', { columnType });
|
|
353
|
+
}
|
|
354
|
+
const value = parseColumnType(columnType);
|
|
355
|
+
if (value.type === 'Array') {
|
|
356
|
+
throw new ColumnTypeParseError('Unexpected Array as value type', {
|
|
357
|
+
columnType,
|
|
358
|
+
sourceType,
|
|
359
|
+
});
|
|
360
|
+
}
|
|
361
|
+
return {
|
|
362
|
+
type: 'Array',
|
|
363
|
+
value,
|
|
364
|
+
dimensions,
|
|
365
|
+
sourceType,
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
function parseDateTimeType({ columnType, sourceType, }) {
|
|
369
|
+
if (columnType.startsWith(DateTimeWithTimezonePrefix) &&
|
|
370
|
+
columnType.length > DateTimeWithTimezonePrefix.length + 4 // DateTime('GB') has the least amount of chars
|
|
371
|
+
) {
|
|
372
|
+
const timezone = columnType.slice(DateTimeWithTimezonePrefix.length + 1, -2);
|
|
373
|
+
return {
|
|
374
|
+
type: 'DateTime',
|
|
375
|
+
timezone,
|
|
376
|
+
sourceType,
|
|
377
|
+
};
|
|
378
|
+
}
|
|
379
|
+
else if (columnType.startsWith(DateTimePrefix) &&
|
|
380
|
+
columnType.length === DateTimePrefix.length) {
|
|
381
|
+
return {
|
|
382
|
+
type: 'DateTime',
|
|
383
|
+
timezone: null,
|
|
384
|
+
sourceType,
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
else {
|
|
388
|
+
throw new ColumnTypeParseError('Invalid DateTime type', {
|
|
389
|
+
columnType,
|
|
390
|
+
sourceType,
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
function parseDateTime64Type({ columnType, sourceType, }) {
|
|
395
|
+
if (!columnType.startsWith(DateTime64Prefix) ||
|
|
396
|
+
columnType.length < DateTime64Prefix.length + 2 // should at least have a precision
|
|
397
|
+
) {
|
|
398
|
+
throw new ColumnTypeParseError('Invalid DateTime64 type', {
|
|
399
|
+
columnType,
|
|
400
|
+
sourceType,
|
|
401
|
+
});
|
|
402
|
+
}
|
|
403
|
+
const precision = parseInt(columnType[DateTime64Prefix.length], 10);
|
|
404
|
+
if (Number.isNaN(precision) || precision < 0 || precision > 9) {
|
|
405
|
+
throw new ColumnTypeParseError('Invalid DateTime64 precision', {
|
|
406
|
+
columnType,
|
|
407
|
+
sourceType,
|
|
408
|
+
precision,
|
|
409
|
+
});
|
|
410
|
+
}
|
|
411
|
+
let timezone = null;
|
|
412
|
+
if (columnType.length > DateTime64Prefix.length + 2) {
|
|
413
|
+
// e.g. DateTime64(3, 'UTC') -> UTC
|
|
414
|
+
timezone = columnType.slice(DateTime64Prefix.length + 4, -2);
|
|
415
|
+
}
|
|
416
|
+
return {
|
|
417
|
+
type: 'DateTime64',
|
|
418
|
+
timezone,
|
|
419
|
+
precision,
|
|
420
|
+
sourceType,
|
|
421
|
+
};
|
|
422
|
+
}
|
|
423
|
+
function parseFixedStringType({ columnType, sourceType, }) {
|
|
424
|
+
if (!columnType.startsWith(FixedStringPrefix) ||
|
|
425
|
+
columnType.length < FixedStringPrefix.length + 2 // i.e. at least FixedString(1)
|
|
426
|
+
) {
|
|
427
|
+
throw new ColumnTypeParseError('Invalid FixedString type', {
|
|
428
|
+
columnType,
|
|
429
|
+
sourceType,
|
|
430
|
+
});
|
|
431
|
+
}
|
|
432
|
+
const sizeBytes = parseInt(columnType.slice(FixedStringPrefix.length, -1), 10);
|
|
433
|
+
if (Number.isNaN(sizeBytes) || sizeBytes < 1) {
|
|
434
|
+
throw new ColumnTypeParseError('Invalid FixedString size in bytes', {
|
|
435
|
+
columnType,
|
|
436
|
+
sourceType,
|
|
437
|
+
sizeBytes,
|
|
438
|
+
});
|
|
439
|
+
}
|
|
440
|
+
return {
|
|
441
|
+
type: 'FixedString',
|
|
442
|
+
sizeBytes,
|
|
443
|
+
sourceType,
|
|
444
|
+
};
|
|
445
|
+
}
|
|
446
|
+
function asNullableType(value, sourceType) {
|
|
447
|
+
if (value.type === 'Array' ||
|
|
448
|
+
value.type === 'Map' ||
|
|
449
|
+
value.type === 'Tuple' ||
|
|
450
|
+
value.type === 'Nullable') {
|
|
451
|
+
throw new ColumnTypeParseError(`${value.type} cannot be Nullable`, {
|
|
452
|
+
sourceType,
|
|
453
|
+
});
|
|
454
|
+
}
|
|
455
|
+
if (value.sourceType.startsWith(NullablePrefix)) {
|
|
456
|
+
value.sourceType = value.sourceType.slice(NullablePrefix.length, -1);
|
|
457
|
+
}
|
|
458
|
+
return {
|
|
459
|
+
type: 'Nullable',
|
|
460
|
+
sourceType,
|
|
461
|
+
value,
|
|
462
|
+
};
|
|
463
|
+
}
|
|
464
|
+
/** Used for Map key/value types and Tuple elements.
|
|
465
|
+
* * `String, UInt8` results in [`String`, `UInt8`].
|
|
466
|
+
* * `String, UInt8, Array(String)` results in [`String`, `UInt8`, `Array(String)`].
|
|
467
|
+
* * Throws if parsed values are below the required minimum. */
|
|
468
|
+
function getElementsTypes({ columnType, sourceType }, minElements) {
|
|
469
|
+
const elements = [];
|
|
470
|
+
/** Consider the element type parsed once we reach a comma outside of parens AND after an unescaped tick.
|
|
471
|
+
* The most complicated cases are values names in the self-defined Enum types:
|
|
472
|
+
* * `Tuple(Enum8('f\'()' = 1))` -> `f\'()`
|
|
473
|
+
* * `Tuple(Enum8('(' = 1))` -> `(`
|
|
474
|
+
* See also: {@link parseEnumType }, which works similarly (but has to deal with the indices following the names). */
|
|
475
|
+
let openParens = 0;
|
|
476
|
+
let quoteOpen = false;
|
|
477
|
+
let charEscaped = false;
|
|
478
|
+
let lastElementIndex = 0;
|
|
479
|
+
for (let i = 0; i < columnType.length; i++) {
|
|
480
|
+
// prettier-ignore
|
|
481
|
+
// console.log(i, 'Current char:', columnType[i], 'openParens:', openParens, 'quoteOpen:', quoteOpen, 'charEscaped:', charEscaped)
|
|
482
|
+
if (charEscaped) {
|
|
483
|
+
charEscaped = false;
|
|
484
|
+
}
|
|
485
|
+
else if (columnType.charCodeAt(i) === BackslashASCII) {
|
|
486
|
+
charEscaped = true;
|
|
487
|
+
}
|
|
488
|
+
else if (columnType.charCodeAt(i) === SingleQuoteASCII) {
|
|
489
|
+
quoteOpen = !quoteOpen; // unescaped quote
|
|
490
|
+
}
|
|
491
|
+
else {
|
|
492
|
+
if (!quoteOpen) {
|
|
493
|
+
if (columnType.charCodeAt(i) === LeftParenASCII) {
|
|
494
|
+
openParens++;
|
|
495
|
+
}
|
|
496
|
+
else if (columnType.charCodeAt(i) === RightParenASCII) {
|
|
497
|
+
openParens--;
|
|
498
|
+
}
|
|
499
|
+
else if (columnType.charCodeAt(i) === CommaASCII) {
|
|
500
|
+
if (openParens === 0) {
|
|
501
|
+
elements.push(columnType.slice(lastElementIndex, i));
|
|
502
|
+
// console.log('Pushed element:', elements[elements.length - 1])
|
|
503
|
+
i += 2; // skip ', '
|
|
504
|
+
lastElementIndex = i;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
// prettier-ignore
|
|
511
|
+
// console.log('Final elements:', elements, 'nextElementIndex:', lastElementIndex, 'minElements:', minElements, 'openParens:', openParens)
|
|
512
|
+
// Push the remaining part of the type if it seems to be valid (at least all parentheses are closed)
|
|
513
|
+
if (!openParens && lastElementIndex < columnType.length - 1) {
|
|
514
|
+
elements.push(columnType.slice(lastElementIndex));
|
|
515
|
+
}
|
|
516
|
+
if (elements.length < minElements) {
|
|
517
|
+
throw new ColumnTypeParseError('Expected more elements in the type', {
|
|
518
|
+
sourceType,
|
|
519
|
+
columnType,
|
|
520
|
+
elements,
|
|
521
|
+
minElements,
|
|
522
|
+
});
|
|
523
|
+
}
|
|
524
|
+
return elements;
|
|
525
|
+
}
|
|
526
|
+
const NullablePrefix = 'Nullable(';
|
|
527
|
+
const LowCardinalityPrefix = 'LowCardinality(';
|
|
528
|
+
const DecimalPrefix = 'Decimal(';
|
|
529
|
+
const ArrayPrefix = 'Array(';
|
|
530
|
+
const MapPrefix = 'Map(';
|
|
531
|
+
const Enum8Prefix = 'Enum8(';
|
|
532
|
+
const Enum16Prefix = 'Enum16(';
|
|
533
|
+
const TuplePrefix = 'Tuple(';
|
|
534
|
+
const DateTimePrefix = 'DateTime';
|
|
535
|
+
const DateTimeWithTimezonePrefix = 'DateTime(';
|
|
536
|
+
const DateTime64Prefix = 'DateTime64(';
|
|
537
|
+
const FixedStringPrefix = 'FixedString(';
|
|
538
|
+
const SingleQuoteASCII = 39;
|
|
539
|
+
const LeftParenASCII = 40;
|
|
540
|
+
const RightParenASCII = 41;
|
|
541
|
+
const CommaASCII = 44;
|
|
542
|
+
const ZeroASCII = 48;
|
|
543
|
+
const NineASCII = 57;
|
|
544
|
+
const BackslashASCII = 92;
|
|
545
|
+
//# sourceMappingURL=column_types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"column_types.js","sourceRoot":"","sources":["../../../../packages/client-common/src/parse/column_types.ts"],"names":[],"mappings":";;;AAgLA,0CA+CC;AAED,4CA0DC;AAED,sCA0HC;AAED,oCAoCC;AAED,wCAsBC;AAED,wCA2CC;AAED,8CA6BC;AAED,kDAgCC;AAED,oDA0BC;AAED,wCAsBC;AAMD,4CAyDC;AAtrBD,MAAa,oBAAqB,SAAQ,KAAK;IAE7C,YAAY,OAAe,EAAE,IAA8B;QACzD,KAAK,CAAC,OAAO,CAAC,CAAA;QAFP;;;;;WAA6B;QAGp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+1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./column_types"), exports);
|
|
18
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../packages/client-common/src/parse/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA8B"}
|
package/dist/result.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import type { ResponseHeaders, ResponseJSON } from './clickhouse_types';
|
|
1
|
+
import type { ProgressRow, ResponseHeaders, ResponseJSON } from './clickhouse_types';
|
|
2
2
|
import type { DataFormat, RawDataFormat, RecordsJSONFormat, SingleDocumentJSONFormat, StreamableDataFormat, StreamableJSONDataFormat } from './data_formatter';
|
|
3
|
+
export type RowOrProgress<T> = {
|
|
4
|
+
row: T;
|
|
5
|
+
} | ProgressRow;
|
|
3
6
|
export type ResultStream<Format extends DataFormat | unknown, Stream> = Format extends StreamableDataFormat ? Stream : Format extends SingleDocumentJSONFormat ? never : Format extends RecordsJSONFormat ? never : Stream;
|
|
4
|
-
export type ResultJSONType<T, F extends DataFormat | unknown> = 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
|
|
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
|
|
5
8
|
T[] | Record<string, T> | ResponseJSON<T>;
|
|
6
|
-
export type RowJSONType<T, F extends DataFormat | unknown> = F extends StreamableJSONDataFormat ? T : F extends RawDataFormat | SingleDocumentJSONFormat | RecordsJSONFormat ? never : 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;
|
|
7
10
|
export interface Row<JSONType = unknown, Format extends DataFormat | unknown = unknown> {
|
|
8
11
|
/** A string representation of a row. */
|
|
9
12
|
text: string;
|
package/dist/utils/connection.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.withCompressionHeaders = withCompressionHeaders;
|
|
4
|
+
exports.withHttpSettings = withHttpSettings;
|
|
5
|
+
exports.isSuccessfulResponse = isSuccessfulResponse;
|
|
4
6
|
function withCompressionHeaders({ headers, enable_request_compression, enable_response_compression, }) {
|
|
5
7
|
return {
|
|
6
8
|
...headers,
|
|
@@ -8,7 +10,6 @@ function withCompressionHeaders({ headers, enable_request_compression, enable_re
|
|
|
8
10
|
...(enable_request_compression ? { 'Content-Encoding': 'gzip' } : {}),
|
|
9
11
|
};
|
|
10
12
|
}
|
|
11
|
-
exports.withCompressionHeaders = withCompressionHeaders;
|
|
12
13
|
function withHttpSettings(clickhouse_settings, compression) {
|
|
13
14
|
return {
|
|
14
15
|
...(compression
|
|
@@ -19,9 +20,7 @@ function withHttpSettings(clickhouse_settings, compression) {
|
|
|
19
20
|
...clickhouse_settings,
|
|
20
21
|
};
|
|
21
22
|
}
|
|
22
|
-
exports.withHttpSettings = withHttpSettings;
|
|
23
23
|
function isSuccessfulResponse(statusCode) {
|
|
24
24
|
return Boolean(statusCode && 200 <= statusCode && statusCode < 300);
|
|
25
25
|
}
|
|
26
|
-
exports.isSuccessfulResponse = isSuccessfulResponse;
|
|
27
26
|
//# sourceMappingURL=connection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../../packages/client-common/src/utils/connection.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"connection.js","sourceRoot":"","sources":["../../../../packages/client-common/src/utils/connection.ts"],"names":[],"mappings":";;AAKA,wDAcC;AAED,4CAYC;AAED,oDAEC;AAhCD,SAAgB,sBAAsB,CAAC,EACrC,OAAO,EACP,0BAA0B,EAC1B,2BAA2B,GAK5B;IACC,OAAO;QACL,GAAG,OAAO;QACV,GAAG,CAAC,2BAA2B,CAAC,CAAC,CAAC,EAAE,iBAAiB,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACrE,GAAG,CAAC,0BAA0B,CAAC,CAAC,CAAC,EAAE,kBAAkB,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;KACtE,CAAA;AACH,CAAC;AAED,SAAgB,gBAAgB,CAC9B,mBAAwC,EACxC,WAAqB;IAErB,OAAO;QACL,GAAG,CAAC,WAAW;YACb,CAAC,CAAC;gBACE,uBAAuB,EAAE,CAAC;aAC3B;YACH,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,mBAAmB;KACvB,CAAA;AACH,CAAC;AAED,SAAgB,oBAAoB,CAAC,UAAmB;IACtD,OAAO,OAAO,CAAC,UAAU,IAAI,GAAG,IAAI,UAAU,IAAI,UAAU,GAAG,GAAG,CAAC,CAAA;AACrE,CAAC"}
|
package/dist/utils/sleep.js
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.sleep =
|
|
3
|
+
exports.sleep = sleep;
|
|
4
4
|
async function sleep(ms) {
|
|
5
5
|
await new Promise((resolve) => setTimeout(() => {
|
|
6
6
|
resolve(void 0);
|
|
7
7
|
}, ms));
|
|
8
8
|
}
|
|
9
|
-
exports.sleep = sleep;
|
|
10
9
|
//# sourceMappingURL=sleep.js.map
|
package/dist/utils/sleep.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sleep.js","sourceRoot":"","sources":["../../../../packages/client-common/src/utils/sleep.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sleep.js","sourceRoot":"","sources":["../../../../packages/client-common/src/utils/sleep.ts"],"names":[],"mappings":";;AAAA,sBAMC;AANM,KAAK,UAAU,KAAK,CAAC,EAAU;IACpC,MAAM,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAC5B,UAAU,CAAC,GAAG,EAAE;QACd,OAAO,CAAC,KAAK,CAAC,CAAC,CAAA;IACjB,CAAC,EAAE,EAAE,CAAC,CACP,CAAA;AACH,CAAC"}
|
package/dist/utils/url.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ type ToSearchParamsOptions = {
|
|
|
11
11
|
query?: string;
|
|
12
12
|
session_id?: string;
|
|
13
13
|
query_id: string;
|
|
14
|
+
role?: string | Array<string>;
|
|
14
15
|
};
|
|
15
|
-
export declare function toSearchParams({ database, query, query_params, clickhouse_settings, session_id, query_id, }: ToSearchParamsOptions): URLSearchParams;
|
|
16
|
+
export declare function toSearchParams({ database, query, query_params, clickhouse_settings, session_id, query_id, role, }: ToSearchParamsOptions): URLSearchParams;
|
|
16
17
|
export {};
|