@akohn/dashql 0.0.19-dev.299.g3adbd8a4b → 0.0.19-dev.368.g7091b292b
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 +1 -2
- package/dist/core/api.d.ts +25 -18
- package/dist/core/api.js +45 -46
- package/dist/core/connection.d.ts +1 -1
- package/dist/core/index.d.ts +0 -4
- package/dist/core/index.js +1 -4
- package/dist/core/runtime.d.ts +1 -1
- package/dist/core/workbook.d.ts +1 -1
- package/dist/platform/compute/arrow_formatter.d.ts +3 -1
- package/dist/platform/compute/arrow_formatter.js +23 -20
- package/dist/platform/compute/computation_types.d.ts +7 -12
- package/dist/platform/compute/computation_types.js +6 -3
- package/dist/platform/compute/query_result_search_sql.d.ts +0 -7
- package/dist/platform/compute/query_result_search_sql.js +1 -19
- package/dist/platform/connections/connection_params.d.ts +5 -6
- package/dist/platform/connections/connection_params.js +14 -25
- package/dist/platform/connections/connection_state.d.ts +1 -1
- package/dist/platform/connections/connector_configs.d.ts +2 -3
- package/dist/platform/connections/connector_info.d.ts +4 -14
- package/dist/platform/connections/connector_info.js +1 -25
- package/dist/platform/connections/embedded_database_channel.d.ts +3 -3
- package/dist/platform/connections/embedded_database_channel.js +12 -6
- package/dist/platform/connections/hyper/hyper_error_info.d.ts +0 -15
- package/dist/platform/connections/hyper/hyper_error_info.js +1 -18
- package/dist/platform/connections/query_execution.js +9 -7
- package/dist/platform/connections/query_execution_args.d.ts +2 -2
- package/dist/platform/http_client.d.ts +1 -1
- package/dist/platform/logger/logger.d.ts +3 -3
- package/dist/platform/query/query_execution_state.d.ts +11 -38
- package/dist/platform/query/query_execution_state.js +6 -1
- package/dist/platform/query/query_progress.d.ts +0 -14
- package/dist/platform/query/query_result_cache.d.ts +2 -2
- package/dist/platform/storage/composite_storage_backend.d.ts +64 -0
- package/dist/platform/storage/composite_storage_backend.js +321 -0
- package/dist/platform/storage/native_storage_backend.d.ts +1 -1
- package/dist/platform/storage/native_storage_backend.js +1 -1
- package/dist/platform/storage/opfs_query_result_cache.d.ts +0 -2
- package/dist/platform/storage/opfs_query_result_cache.js +3 -5
- package/dist/platform/storage/opfs_storage_backend.d.ts +67 -0
- package/dist/platform/storage/opfs_storage_backend.js +494 -0
- package/dist/platform/storage/workbook_locator.d.ts +7 -0
- package/dist/platform/storage/workbook_locator.js +14 -0
- package/dist/platform/storage/workbook_tables.d.ts +1 -4
- package/dist/platform/storage/workbook_tables.js +3 -17
- package/dist/platform/storage/workbook_transfer.d.ts +9 -0
- package/dist/platform/storage/workbook_transfer.js +84 -0
- package/dist/platform/storage/workbook_tree.d.ts +30 -9
- package/dist/platform/storage/workbook_tree.js +17 -96
- package/dist/platform/utils/base64.js +4 -4
- package/dist/platform/web_http_client.d.ts +1 -4
- package/dist/platform/web_http_client.js +0 -5
- package/dist/platform/workbook/attachment_mounts.d.ts +12 -4
- package/dist/platform/workbook/attachment_mounts.js +69 -60
- package/dist/platform/workbook/run_events.js +1 -1
- package/dist/platform/workbook/script_compilation.d.ts +0 -1
- package/dist/platform/workbook/script_compilation.js +1 -14
- package/dist/platform/workbook/script_reference_check.js +7 -6
- package/dist/platform/workbook/script_types.d.ts +1 -1
- package/dist/platform/workbook/script_types.js +1 -10
- package/dist/platform/workbook/workbook_execution.d.ts +0 -2
- package/dist/platform/workbook/workbook_execution.js +1 -4
- package/dist/platform/workbook/workbook_inputs.d.ts +7 -7
- package/dist/platform/workbook/workbook_inputs.js +4 -4
- package/dist/platform/workbook/workbook_scripts.d.ts +2 -2
- package/dist/runtime/compute_platform.js +2 -2
- package/dist/runtime/node/node_platform.js +1 -1
- package/dist/runtime/platform_requests.js +1 -1
- package/dist/runtime/query/query_channels.d.ts +0 -2
- package/dist/runtime/query/query_channels.js +36 -55
- package/dist/runtime/run_mounts.d.ts +2 -1
- package/dist/runtime/run_mounts.js +4 -5
- package/dist/runtime/runtime.d.ts +3 -0
- package/dist/runtime/runtime.js +10 -6
- package/dist/runtime/runtime_storage.d.ts +2 -5
- package/dist/runtime/runtime_storage.js +4 -13
- package/dist/runtime/workbook_projection.js +2 -2
- package/dist/runtime/workbook_run_report.d.ts +3 -6
- package/dist/runtime/workbook_run_report.js +33 -47
- package/dist/wasm/dashql_core.d.ts +2206 -1922
- package/dist/wasm/dashql_core.js +428 -223
- package/dist/wasm/dashql_core.wasm +0 -0
- package/dist/wasm/dashql_dataflow.wasm +0 -0
- package/package.json +1 -1
- package/dist/core/format.d.ts +0 -4
- package/dist/core/format.js +0 -23
- package/dist/core/lookup.d.ts +0 -10
- package/dist/core/lookup.js +0 -129
- package/dist/core/tokens.d.ts +0 -9
- package/dist/core/tokens.js +0 -78
- package/dist/core/variant.d.ts +0 -4
- package/dist/core/variant.js +0 -0
- package/dist/platform/connections/hyper/local_cloud.d.ts +0 -15
- package/dist/platform/connections/hyper/local_cloud.js +0 -14
- package/dist/platform/connections/query_channel.d.ts +0 -3
- package/dist/platform/connections/query_channel.js +0 -11
- package/dist/platform/hyper_link_target.d.ts +0 -8
- package/dist/platform/hyper_link_target.js +0 -35
- package/dist/platform/sql/sql_format.d.ts +0 -9
- package/dist/platform/sql/sql_format.js +0 -40
- package/dist/platform/sql/sql_lint.d.ts +0 -27
- package/dist/platform/sql/sql_lint.js +0 -69
- package/dist/platform/sql/sql_report.d.ts +0 -18
- package/dist/platform/sql/sql_report.js +0 -80
- package/dist/platform/storage/storage_versions.d.ts +0 -3
- package/dist/platform/storage/storage_versions.js +0 -13
- package/dist/platform/utils/async_consumer.d.ts +0 -14
- package/dist/platform/utils/async_consumer.js +0 -24
- package/dist/platform/workbook/attachment_mirror.d.ts +0 -2
- package/dist/platform/workbook/attachment_mirror.js +0 -25
package/dist/wasm/dashql_core.js
CHANGED
|
@@ -25,14 +25,11 @@ var dashql_core_exports = /* @__PURE__ */ __exportAll({
|
|
|
25
25
|
TableParameters: () => TableParameters,
|
|
26
26
|
TaskStatus: () => TaskStatus,
|
|
27
27
|
WorkbookScriptSession: () => WorkbookScriptSession,
|
|
28
|
-
checkScriptReferences: () => checkScriptReferences,
|
|
29
28
|
collectSessionInputs: () => collectSessionInputs,
|
|
30
29
|
default: () => __wbg_init,
|
|
31
|
-
deriveSessionDataflow: () => deriveSessionDataflow,
|
|
32
30
|
initSync: () => initSync,
|
|
33
31
|
inputLiteral: () => inputLiteral,
|
|
34
32
|
installPanicHook: () => installPanicHook,
|
|
35
|
-
planSession: () => planSession,
|
|
36
33
|
processBatch: () => processBatch,
|
|
37
34
|
quoteColumnName: () => quoteColumnName,
|
|
38
35
|
quoteIdentifier: () => quoteIdentifier,
|
|
@@ -199,6 +196,20 @@ function makeMutClosure(arg0, arg1, dtor, f) {
|
|
|
199
196
|
CLOSURE_DTORS.register(real, state, state);
|
|
200
197
|
return real;
|
|
201
198
|
}
|
|
199
|
+
function _assertClass(instance, klass) {
|
|
200
|
+
if (!(instance instanceof klass)) throw new Error(`expected instance of ${klass.name}`);
|
|
201
|
+
}
|
|
202
|
+
function takeFromExternrefTable0(idx) {
|
|
203
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
204
|
+
wasm.__externref_table_dealloc(idx);
|
|
205
|
+
return value;
|
|
206
|
+
}
|
|
207
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
208
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
209
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
210
|
+
WASM_VECTOR_LEN = arg.length;
|
|
211
|
+
return ptr;
|
|
212
|
+
}
|
|
202
213
|
function passArrayJsValueToWasm0(array, malloc) {
|
|
203
214
|
const ptr = malloc(array.length * 4, 4) >>> 0;
|
|
204
215
|
for (let i = 0; i < array.length; i++) {
|
|
@@ -208,35 +219,21 @@ function passArrayJsValueToWasm0(array, malloc) {
|
|
|
208
219
|
WASM_VECTOR_LEN = array.length;
|
|
209
220
|
return ptr;
|
|
210
221
|
}
|
|
211
|
-
function takeFromExternrefTable0(idx) {
|
|
212
|
-
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
213
|
-
wasm.__externref_table_dealloc(idx);
|
|
214
|
-
return value;
|
|
215
|
-
}
|
|
216
222
|
var cachedUint32ArrayMemory0 = null;
|
|
217
223
|
function getUint32ArrayMemory0() {
|
|
218
224
|
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
219
225
|
return cachedUint32ArrayMemory0;
|
|
220
226
|
}
|
|
227
|
+
function getArrayU32FromWasm0(ptr, len) {
|
|
228
|
+
ptr = ptr >>> 0;
|
|
229
|
+
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
230
|
+
}
|
|
221
231
|
function passArray32ToWasm0(arg, malloc) {
|
|
222
232
|
const ptr = malloc(arg.length * 4, 4) >>> 0;
|
|
223
233
|
getUint32ArrayMemory0().set(arg, ptr / 4);
|
|
224
234
|
WASM_VECTOR_LEN = arg.length;
|
|
225
235
|
return ptr;
|
|
226
236
|
}
|
|
227
|
-
function passArray8ToWasm0(arg, malloc) {
|
|
228
|
-
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
229
|
-
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
230
|
-
WASM_VECTOR_LEN = arg.length;
|
|
231
|
-
return ptr;
|
|
232
|
-
}
|
|
233
|
-
function _assertClass(instance, klass) {
|
|
234
|
-
if (!(instance instanceof klass)) throw new Error(`expected instance of ${klass.name}`);
|
|
235
|
-
}
|
|
236
|
-
function getArrayU32FromWasm0(ptr, len) {
|
|
237
|
-
ptr = ptr >>> 0;
|
|
238
|
-
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
239
|
-
}
|
|
240
237
|
/**
|
|
241
238
|
* Report panics to `globalThis.__dashqlCorePanic` before the module traps.
|
|
242
239
|
*
|
|
@@ -247,6 +244,44 @@ function installPanicHook() {
|
|
|
247
244
|
wasm.installPanicHook();
|
|
248
245
|
}
|
|
249
246
|
/**
|
|
247
|
+
* Quote a column name for a column reference in SQL text, also quotes keywords that are not unreserved, e.g. `"user"`
|
|
248
|
+
* @param {string} text
|
|
249
|
+
* @returns {string}
|
|
250
|
+
*/
|
|
251
|
+
function quoteColumnName(text) {
|
|
252
|
+
let deferred2_0;
|
|
253
|
+
let deferred2_1;
|
|
254
|
+
try {
|
|
255
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
256
|
+
const len0 = WASM_VECTOR_LEN;
|
|
257
|
+
const ret = wasm.quoteColumnName(ptr0, len0);
|
|
258
|
+
deferred2_0 = ret[0];
|
|
259
|
+
deferred2_1 = ret[1];
|
|
260
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
261
|
+
} finally {
|
|
262
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Quote an identifier if it would not read back unquoted, e.g. the name of a script reference `:"foo-2"`
|
|
267
|
+
* @param {string} text
|
|
268
|
+
* @returns {string}
|
|
269
|
+
*/
|
|
270
|
+
function quoteIdentifier(text) {
|
|
271
|
+
let deferred2_0;
|
|
272
|
+
let deferred2_1;
|
|
273
|
+
try {
|
|
274
|
+
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
275
|
+
const len0 = WASM_VECTOR_LEN;
|
|
276
|
+
const ret = wasm.quoteIdentifier(ptr0, len0);
|
|
277
|
+
deferred2_0 = ret[0];
|
|
278
|
+
deferred2_1 = ret[1];
|
|
279
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
280
|
+
} finally {
|
|
281
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
/**
|
|
250
285
|
* Collect the inputs of the scripts of a session (`session_inputs::collect_session_inputs`), returns the packed
|
|
251
286
|
* `SessionInputs`. Ignores the targets, the materialized scripts and the mount prefix.
|
|
252
287
|
* @param {SessionPlanRequest} request
|
|
@@ -290,47 +325,6 @@ function inputLiteral(value, sql_type) {
|
|
|
290
325
|
}
|
|
291
326
|
}
|
|
292
327
|
/**
|
|
293
|
-
* The change from one text to another (`workbook::text_change`): the range between their common prefix and suffix, on
|
|
294
|
-
* character boundaries, its offsets in UTF-16 code units like those of the editors
|
|
295
|
-
* @param {string} from
|
|
296
|
-
* @param {string} to
|
|
297
|
-
* @returns {WorkbookTextChange}
|
|
298
|
-
*/
|
|
299
|
-
function textChange(from, to) {
|
|
300
|
-
const ptr0 = passStringToWasm0(from, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
301
|
-
const len0 = WASM_VECTOR_LEN;
|
|
302
|
-
const ptr1 = passStringToWasm0(to, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
303
|
-
const len1 = WASM_VECTOR_LEN;
|
|
304
|
-
const ret = wasm.textChange(ptr0, len0, ptr1, len1);
|
|
305
|
-
if (ret[2]) throw takeFromExternrefTable0(ret[1]);
|
|
306
|
-
return takeFromExternrefTable0(ret[0]);
|
|
307
|
-
}
|
|
308
|
-
/**
|
|
309
|
-
* Derive the dataflow of the scripts of a session (`dataflow::derive_session_dataflow`), returns the packed
|
|
310
|
-
* `SessionDataflow`. The text spans are in the offset unit of the session of each script.
|
|
311
|
-
* @param {SessionPlanRequest} request
|
|
312
|
-
* @returns {Uint8Array}
|
|
313
|
-
*/
|
|
314
|
-
function deriveSessionDataflow(request) {
|
|
315
|
-
_assertClass(request, SessionPlanRequest);
|
|
316
|
-
const ret = wasm.deriveSessionDataflow(request.__wbg_ptr);
|
|
317
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
318
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
319
|
-
return v1;
|
|
320
|
-
}
|
|
321
|
-
/**
|
|
322
|
-
* Plan the current analysis of the scripts of a session across connections, returns the packed `ExecutionGraph`
|
|
323
|
-
* @param {SessionPlanRequest} request
|
|
324
|
-
* @returns {Uint8Array}
|
|
325
|
-
*/
|
|
326
|
-
function planSession(request) {
|
|
327
|
-
_assertClass(request, SessionPlanRequest);
|
|
328
|
-
const ret = wasm.planSession(request.__wbg_ptr);
|
|
329
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
330
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
331
|
-
return v1;
|
|
332
|
-
}
|
|
333
|
-
/**
|
|
334
328
|
* The relations that the statements of a text create or drop, returns packed `TouchedRelations`
|
|
335
329
|
* @param {string} text
|
|
336
330
|
* @returns {Uint8Array}
|
|
@@ -344,23 +338,20 @@ function touchedRelations(text) {
|
|
|
344
338
|
return v2;
|
|
345
339
|
}
|
|
346
340
|
/**
|
|
347
|
-
*
|
|
348
|
-
*
|
|
349
|
-
* @
|
|
341
|
+
* The change from one text to another (`workbook::text_change`): the range between their common prefix and suffix, on
|
|
342
|
+
* character boundaries, its offsets in UTF-16 code units like those of the editors
|
|
343
|
+
* @param {string} from
|
|
344
|
+
* @param {string} to
|
|
345
|
+
* @returns {WorkbookTextChange}
|
|
350
346
|
*/
|
|
351
|
-
function
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
deferred2_1 = ret[1];
|
|
360
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
361
|
-
} finally {
|
|
362
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
363
|
-
}
|
|
347
|
+
function textChange(from, to) {
|
|
348
|
+
const ptr0 = passStringToWasm0(from, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
349
|
+
const len0 = WASM_VECTOR_LEN;
|
|
350
|
+
const ptr1 = passStringToWasm0(to, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
351
|
+
const len1 = WASM_VECTOR_LEN;
|
|
352
|
+
const ret = wasm.textChange(ptr0, len0, ptr1, len1);
|
|
353
|
+
if (ret[2]) throw takeFromExternrefTable0(ret[1]);
|
|
354
|
+
return takeFromExternrefTable0(ret[0]);
|
|
364
355
|
}
|
|
365
356
|
/**
|
|
366
357
|
* Process a batch request into a `BatchResult`
|
|
@@ -376,39 +367,6 @@ function processBatch(request) {
|
|
|
376
367
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
377
368
|
return v2;
|
|
378
369
|
}
|
|
379
|
-
/**
|
|
380
|
-
* Check the script references of the scripts of a session, returns the packed `ScriptReferenceCheck`. The text spans
|
|
381
|
-
* are in the offset unit of the session of each script. Ignores the targets, the materialized scripts and the mount
|
|
382
|
-
* prefix.
|
|
383
|
-
* @param {SessionPlanRequest} request
|
|
384
|
-
* @returns {Uint8Array}
|
|
385
|
-
*/
|
|
386
|
-
function checkScriptReferences(request) {
|
|
387
|
-
_assertClass(request, SessionPlanRequest);
|
|
388
|
-
const ret = wasm.checkScriptReferences(request.__wbg_ptr);
|
|
389
|
-
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
390
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
391
|
-
return v1;
|
|
392
|
-
}
|
|
393
|
-
/**
|
|
394
|
-
* Quote an identifier if it would not read back unquoted, e.g. the name of a script reference `:"foo-2"`
|
|
395
|
-
* @param {string} text
|
|
396
|
-
* @returns {string}
|
|
397
|
-
*/
|
|
398
|
-
function quoteIdentifier(text) {
|
|
399
|
-
let deferred2_0;
|
|
400
|
-
let deferred2_1;
|
|
401
|
-
try {
|
|
402
|
-
const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
403
|
-
const len0 = WASM_VECTOR_LEN;
|
|
404
|
-
const ret = wasm.quoteIdentifier(ptr0, len0);
|
|
405
|
-
deferred2_0 = ret[0];
|
|
406
|
-
deferred2_1 = ret[1];
|
|
407
|
-
return getStringFromWasm0(ret[0], ret[1]);
|
|
408
|
-
} finally {
|
|
409
|
-
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
410
|
-
}
|
|
411
|
-
}
|
|
412
370
|
function getArrayJsValueFromWasm0(ptr, len) {
|
|
413
371
|
ptr = ptr >>> 0;
|
|
414
372
|
const mem = getDataViewMemory0();
|
|
@@ -485,7 +443,7 @@ var ConnectionHealth = Object.freeze({
|
|
|
485
443
|
});
|
|
486
444
|
/**
|
|
487
445
|
* How far the setup of a connection got
|
|
488
|
-
* @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 |
|
|
446
|
+
* @enum {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 22}
|
|
489
447
|
*/
|
|
490
448
|
var ConnectionStatus = Object.freeze({
|
|
491
449
|
NOT_STARTED: 0,
|
|
@@ -530,8 +488,6 @@ var ConnectionStatus = Object.freeze({
|
|
|
530
488
|
"19": "DATA_CLOUD_TOKEN_REQUESTED",
|
|
531
489
|
DATA_CLOUD_TOKEN_RECEIVED: 20,
|
|
532
490
|
"20": "DATA_CLOUD_TOKEN_RECEIVED",
|
|
533
|
-
CORE_ACCESS_TOKEN_REQUESTED: 21,
|
|
534
|
-
"21": "CORE_ACCESS_TOKEN_REQUESTED",
|
|
535
491
|
CORE_ACCESS_TOKEN_RECEIVED: 22,
|
|
536
492
|
"22": "CORE_ACCESS_TOKEN_RECEIVED"
|
|
537
493
|
});
|
|
@@ -931,22 +887,6 @@ var QueryProfile = class {
|
|
|
931
887
|
return wasm.queryprofile_structureVersion(this.__wbg_ptr) >>> 0;
|
|
932
888
|
}
|
|
933
889
|
/**
|
|
934
|
-
* Apply a Trino QueryInfo (JSON, pruned or not) received at a time in milliseconds since epoch: the pipelines
|
|
935
|
-
* and slot statistics of the stages. Returns the packed `QueryProfileEvents` of the effective state changes.
|
|
936
|
-
* @param {Uint8Array} info
|
|
937
|
-
* @param {number} time
|
|
938
|
-
* @returns {Uint8Array}
|
|
939
|
-
*/
|
|
940
|
-
applyTrinoQueryInfo(info, time) {
|
|
941
|
-
const ptr0 = passArray8ToWasm0(info, wasm.__wbindgen_malloc);
|
|
942
|
-
const len0 = WASM_VECTOR_LEN;
|
|
943
|
-
const ret = wasm.queryprofile_applyTrinoQueryInfo(this.__wbg_ptr, ptr0, len0, time);
|
|
944
|
-
if (ret[3]) throw takeFromExternrefTable0(ret[2]);
|
|
945
|
-
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
946
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
947
|
-
return v2;
|
|
948
|
-
}
|
|
949
|
-
/**
|
|
950
890
|
* Apply the `stats` of a Trino `/v1/statement` response (JSON) received at a time in milliseconds since
|
|
951
891
|
* epoch, returns the packed `QueryProfileEvents` of the effective state changes
|
|
952
892
|
* @param {Uint8Array} stats
|
|
@@ -1060,6 +1000,91 @@ var Runtime = class Runtime {
|
|
|
1060
1000
|
wasm.__wbg_runtime_free(ptr, 0);
|
|
1061
1001
|
}
|
|
1062
1002
|
/**
|
|
1003
|
+
* Attach files to a workbook: every Parquet file gets a name whose table parameter takes no name of a script or
|
|
1004
|
+
* another attachment (`sales.parquet` becomes `sales-2.parquet`, a file with the name of an attachment replaces
|
|
1005
|
+
* it), is written through the storage writer and the view of the workbook lists it once the storage does. Resolves
|
|
1006
|
+
* with the names the files got and the refused files, rejects with what the storage failed with.
|
|
1007
|
+
* @param {string} workbook_id
|
|
1008
|
+
* @param {AttachedFile[]} files
|
|
1009
|
+
* @returns {Promise<AttachFilesOutcome>}
|
|
1010
|
+
*/
|
|
1011
|
+
attachFiles(workbook_id, files) {
|
|
1012
|
+
const ptr0 = passStringToWasm0(workbook_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1013
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1014
|
+
const ret = wasm.runtime_attachFiles(this.__wbg_ptr, ptr0, len0, files);
|
|
1015
|
+
if (ret[2]) throw takeFromExternrefTable0(ret[1]);
|
|
1016
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1017
|
+
}
|
|
1018
|
+
/**
|
|
1019
|
+
* Rename an attachment of a workbook like a script: the name is a display name, `.parquet` is added unless it has
|
|
1020
|
+
* it, and the name takes no name of a script or another attachment, `sales` becomes `sales-2` then. The scripts
|
|
1021
|
+
* that read the attachment read the new name at once and its file is renamed through the storage writer. A refused
|
|
1022
|
+
* rename, e.g. of a cloud preview or one whose rewrite of the references fails, rejects before anything changed.
|
|
1023
|
+
* Resolves with the new file name once the file has it and the view lists it, null for a name that is unchanged or
|
|
1024
|
+
* no plain file name. Rejects with what the storage failed with, the writer tries the rename again.
|
|
1025
|
+
* @param {string} workbook_id
|
|
1026
|
+
* @param {string} file_name
|
|
1027
|
+
* @param {string} name
|
|
1028
|
+
* @returns {Promise<string | null>}
|
|
1029
|
+
*/
|
|
1030
|
+
renameAttachment(workbook_id, file_name, name) {
|
|
1031
|
+
const ptr0 = passStringToWasm0(workbook_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1032
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1033
|
+
const ptr1 = passStringToWasm0(file_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1034
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1035
|
+
const ptr2 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1036
|
+
const len2 = WASM_VECTOR_LEN;
|
|
1037
|
+
const ret = wasm.runtime_renameAttachment(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1038
|
+
if (ret[2]) throw takeFromExternrefTable0(ret[1]);
|
|
1039
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1040
|
+
}
|
|
1041
|
+
/**
|
|
1042
|
+
* List the attachments of a workbook again, e.g. after one was removed or renamed in the storage. Resolves once
|
|
1043
|
+
* the view of the workbook lists them, rejects with what the storage failed with.
|
|
1044
|
+
* @param {string} workbook_id
|
|
1045
|
+
* @returns {Promise<void>}
|
|
1046
|
+
*/
|
|
1047
|
+
refreshAttachments(workbook_id) {
|
|
1048
|
+
const ptr0 = passStringToWasm0(workbook_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1049
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1050
|
+
return wasm.runtime_refreshAttachments(this.__wbg_ptr, ptr0, len0);
|
|
1051
|
+
}
|
|
1052
|
+
/**
|
|
1053
|
+
* Lease a connection for a session of the host, a later lease takes the connection over. Returns the lease that
|
|
1054
|
+
* `closeSession` takes.
|
|
1055
|
+
* @param {string} connection_id
|
|
1056
|
+
* @returns {number}
|
|
1057
|
+
*/
|
|
1058
|
+
openSession(connection_id) {
|
|
1059
|
+
const ptr0 = passStringToWasm0(connection_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1060
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1061
|
+
return wasm.runtime_openSession(this.__wbg_ptr, ptr0, len0) >>> 0;
|
|
1062
|
+
}
|
|
1063
|
+
/**
|
|
1064
|
+
* Close a session of the host: the latest lease of the connection resets it, its channel closes the session. The
|
|
1065
|
+
* runtime keeps the connection, a later session sets it up again. An earlier lease changes nothing.
|
|
1066
|
+
* @param {string} connection_id
|
|
1067
|
+
* @param {number} lease
|
|
1068
|
+
*/
|
|
1069
|
+
closeSession(connection_id, lease) {
|
|
1070
|
+
const ptr0 = passStringToWasm0(connection_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1071
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1072
|
+
wasm.runtime_closeSession(this.__wbg_ptr, ptr0, len0, lease);
|
|
1073
|
+
}
|
|
1074
|
+
/**
|
|
1075
|
+
* Resolve once the catalog of a connection settled: no update runs and every relation that statements touched is
|
|
1076
|
+
* answered, e.g. after a statement of the shell. Resolves after the timeout as well (10 s by default), and at once
|
|
1077
|
+
* for an unknown connection: a catalog that doesn't follow never fails a statement.
|
|
1078
|
+
* @param {string} connection_id
|
|
1079
|
+
* @param {number | null} [timeout_ms]
|
|
1080
|
+
* @returns {Promise<void>}
|
|
1081
|
+
*/
|
|
1082
|
+
settleCatalog(connection_id, timeout_ms) {
|
|
1083
|
+
const ptr0 = passStringToWasm0(connection_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1084
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1085
|
+
return wasm.runtime_settleCatalog(this.__wbg_ptr, ptr0, len0, !isLikeNone(timeout_ms), isLikeNone(timeout_ms) ? 0 : timeout_ms);
|
|
1086
|
+
}
|
|
1087
|
+
/**
|
|
1063
1088
|
* The identity of the catalog of a connection, `catalogId` of its view, without reading the view. None for an
|
|
1064
1089
|
* unknown connection and while a task holds it.
|
|
1065
1090
|
* @param {string} connection_id
|
|
@@ -1138,9 +1163,25 @@ var Runtime = class Runtime {
|
|
|
1138
1163
|
resultKeys(workbook_id, targets) {
|
|
1139
1164
|
const ptr0 = passStringToWasm0(workbook_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1140
1165
|
const len0 = WASM_VECTOR_LEN;
|
|
1141
|
-
var ptr1 = isLikeNone(targets) ? 0 : passArray32ToWasm0(targets, wasm.__wbindgen_malloc);
|
|
1142
|
-
var len1 = WASM_VECTOR_LEN;
|
|
1143
|
-
const ret = wasm.runtime_resultKeys(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1166
|
+
var ptr1 = isLikeNone(targets) ? 0 : passArray32ToWasm0(targets, wasm.__wbindgen_malloc);
|
|
1167
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1168
|
+
const ret = wasm.runtime_resultKeys(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
1169
|
+
if (ret[2]) throw takeFromExternrefTable0(ret[1]);
|
|
1170
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1171
|
+
}
|
|
1172
|
+
/**
|
|
1173
|
+
* The scripts that a reported run reports, by their file names in the order of the workbook: a name names the
|
|
1174
|
+
* script of its base name, every script without names
|
|
1175
|
+
* @param {string[]} files
|
|
1176
|
+
* @param {string[]} names
|
|
1177
|
+
* @returns {RunScriptSelection}
|
|
1178
|
+
*/
|
|
1179
|
+
static runScripts(files, names) {
|
|
1180
|
+
const ptr0 = passArrayJsValueToWasm0(files, wasm.__wbindgen_malloc);
|
|
1181
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1182
|
+
const ptr1 = passArrayJsValueToWasm0(names, wasm.__wbindgen_malloc);
|
|
1183
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1184
|
+
const ret = wasm.runtime_runScripts(ptr0, len0, ptr1, len1);
|
|
1144
1185
|
if (ret[2]) throw takeFromExternrefTable0(ret[1]);
|
|
1145
1186
|
return takeFromExternrefTable0(ret[0]);
|
|
1146
1187
|
}
|
|
@@ -1312,6 +1353,26 @@ var Runtime = class Runtime {
|
|
|
1312
1353
|
return ret === 0 ? void 0 : WorkbookScriptSession.__wrap(ret);
|
|
1313
1354
|
}
|
|
1314
1355
|
/**
|
|
1356
|
+
* Follow a Hyper link (`hyper::link`): the target of an endpoint and a token, the question to ask before the app
|
|
1357
|
+
* uses it and the connection it binds to, the connection of the recent link of the tab first. Null unless the
|
|
1358
|
+
* endpoint and the token are a target: an endpoint on this machine may speak http, any other one https.
|
|
1359
|
+
* @param {string} endpoint
|
|
1360
|
+
* @param {string} token
|
|
1361
|
+
* @param {string | null} [recent_connection_id]
|
|
1362
|
+
* @returns {HyperLinkView | null}
|
|
1363
|
+
*/
|
|
1364
|
+
bindHyperLink(endpoint, token, recent_connection_id) {
|
|
1365
|
+
const ptr0 = passStringToWasm0(endpoint, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1366
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1367
|
+
const ptr1 = passStringToWasm0(token, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1368
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1369
|
+
var ptr2 = isLikeNone(recent_connection_id) ? 0 : passStringToWasm0(recent_connection_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1370
|
+
var len2 = WASM_VECTOR_LEN;
|
|
1371
|
+
const ret = wasm.runtime_bindHyperLink(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1372
|
+
if (ret[2]) throw takeFromExternrefTable0(ret[1]);
|
|
1373
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1374
|
+
}
|
|
1375
|
+
/**
|
|
1315
1376
|
* Export a workbook: a `.dashql` archive (a Blob of the handle table that the caller releases), a link, or the
|
|
1316
1377
|
* workbook tables, which go to `consume` and stay readable until it settled. The pending writes of the workbook
|
|
1317
1378
|
* are written first, the cached results are retained while the export reads them. Rejects with what the platform
|
|
@@ -1411,6 +1472,25 @@ var Runtime = class Runtime {
|
|
|
1411
1472
|
return wasm.runtime_exportedResults(this.__wbg_ptr, ptr0, len0);
|
|
1412
1473
|
}
|
|
1413
1474
|
/**
|
|
1475
|
+
* A free name for a new folder of the workbook tree next to its siblings: "New folder", "New folder 2", ...
|
|
1476
|
+
* @param {string[]} siblings
|
|
1477
|
+
* @returns {string}
|
|
1478
|
+
*/
|
|
1479
|
+
static freeFolderName(siblings) {
|
|
1480
|
+
let deferred2_0;
|
|
1481
|
+
let deferred2_1;
|
|
1482
|
+
try {
|
|
1483
|
+
const ptr0 = passArrayJsValueToWasm0(siblings, wasm.__wbindgen_malloc);
|
|
1484
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1485
|
+
const ret = wasm.runtime_freeFolderName(ptr0, len0);
|
|
1486
|
+
deferred2_0 = ret[0];
|
|
1487
|
+
deferred2_1 = ret[1];
|
|
1488
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1489
|
+
} finally {
|
|
1490
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
/**
|
|
1414
1494
|
* Are the writes of a workbook held, by a hold of the writer or of the workbook, e.g. after one of its files
|
|
1415
1495
|
* changed outside the app?
|
|
1416
1496
|
* @param {string} workbook_id
|
|
@@ -1475,6 +1555,36 @@ var Runtime = class Runtime {
|
|
|
1475
1555
|
return takeFromExternrefTable0(ret[0]);
|
|
1476
1556
|
}
|
|
1477
1557
|
/**
|
|
1558
|
+
* The end of the report of a run: the error of the run, the scripts that didn't run, the counts and how it ended
|
|
1559
|
+
* @param {RunReportInput} input
|
|
1560
|
+
* @returns {RunReportEnd}
|
|
1561
|
+
*/
|
|
1562
|
+
static finishRunReport(input) {
|
|
1563
|
+
const ret = wasm.runtime_finishRunReport(input);
|
|
1564
|
+
if (ret[2]) throw takeFromExternrefTable0(ret[1]);
|
|
1565
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1566
|
+
}
|
|
1567
|
+
/**
|
|
1568
|
+
* Why a name can't name a new folder of the workbook tree next to its siblings, null if it can. The names compare
|
|
1569
|
+
* without case.
|
|
1570
|
+
* @param {string} name
|
|
1571
|
+
* @param {string[]} siblings
|
|
1572
|
+
* @returns {string | undefined}
|
|
1573
|
+
*/
|
|
1574
|
+
static folderNameError(name, siblings) {
|
|
1575
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1576
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1577
|
+
const ptr1 = passArrayJsValueToWasm0(siblings, wasm.__wbindgen_malloc);
|
|
1578
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1579
|
+
const ret = wasm.runtime_folderNameError(ptr0, len0, ptr1, len1);
|
|
1580
|
+
let v3;
|
|
1581
|
+
if (ret[0] !== 0) {
|
|
1582
|
+
v3 = getStringFromWasm0(ret[0], ret[1]).slice();
|
|
1583
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
1584
|
+
}
|
|
1585
|
+
return v3;
|
|
1586
|
+
}
|
|
1587
|
+
/**
|
|
1478
1588
|
* Apply an event of the editor of a script, a packed `EditorEvent`, and return the packed `EditorUpdate` for the
|
|
1479
1589
|
* editor with its key: the workbook takes the update, writes the text and publishes it. The event names the text
|
|
1480
1590
|
* version that the editor shows, an editor that missed a change of the text gets the status `STALE_TEXT_VERSION`
|
|
@@ -1508,6 +1618,40 @@ var Runtime = class Runtime {
|
|
|
1508
1618
|
return wasm.runtime_flushCacheWrites(this.__wbg_ptr);
|
|
1509
1619
|
}
|
|
1510
1620
|
/**
|
|
1621
|
+
* Is a name the name of a workbook table that holds the data of an attachment or a result?
|
|
1622
|
+
* @param {string} name
|
|
1623
|
+
* @returns {boolean}
|
|
1624
|
+
*/
|
|
1625
|
+
static isDataTableName(name) {
|
|
1626
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1627
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1628
|
+
return wasm.runtime_isDataTableName(ptr0, len0) !== 0;
|
|
1629
|
+
}
|
|
1630
|
+
/**
|
|
1631
|
+
* The params of a new local cloud: a connection of the embedded Hyper whose session attaches only the database of
|
|
1632
|
+
* the local cloud, see docs/design/cloud.md
|
|
1633
|
+
* @returns {Record<string, unknown>}
|
|
1634
|
+
*/
|
|
1635
|
+
static localCloudParams() {
|
|
1636
|
+
const ret = wasm.runtime_localCloudParams();
|
|
1637
|
+
if (ret[2]) throw takeFromExternrefTable0(ret[1]);
|
|
1638
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1639
|
+
}
|
|
1640
|
+
/**
|
|
1641
|
+
* Build the workbook tree of the directories of `workbooktree/` as the platform lists them (`{ name, folderFile,
|
|
1642
|
+
* directories }`, null without the folder): the subfolders in the natural order of their names. A workbook that the
|
|
1643
|
+
* tree registers twice is listed where it comes first, or every time for the tree as it is `stored`. Fails on a
|
|
1644
|
+
* folder file that isn't one.
|
|
1645
|
+
* @param {Record<string, unknown> | null} directory
|
|
1646
|
+
* @param {boolean} stored
|
|
1647
|
+
* @returns {Record<string, unknown>}
|
|
1648
|
+
*/
|
|
1649
|
+
static readWorkbookTree(directory, stored) {
|
|
1650
|
+
const ret = wasm.runtime_readWorkbookTree(directory, stored);
|
|
1651
|
+
if (ret[2]) throw takeFromExternrefTable0(ret[1]);
|
|
1652
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1653
|
+
}
|
|
1654
|
+
/**
|
|
1511
1655
|
* Start or stop the catalog loader. A stopped loader starts no update, the running ones finish.
|
|
1512
1656
|
* @param {boolean} running
|
|
1513
1657
|
*/
|
|
@@ -1528,6 +1672,29 @@ var Runtime = class Runtime {
|
|
|
1528
1672
|
return takeFromExternrefTable0(ret[0]);
|
|
1529
1673
|
}
|
|
1530
1674
|
/**
|
|
1675
|
+
* A fresh name of a workbook table that holds the data of an attachment or a result, from the prefix of its kind
|
|
1676
|
+
* and a UUID
|
|
1677
|
+
* @param {string} prefix
|
|
1678
|
+
* @param {string} uuid
|
|
1679
|
+
* @returns {string}
|
|
1680
|
+
*/
|
|
1681
|
+
static newDataTableName(prefix, uuid) {
|
|
1682
|
+
let deferred3_0;
|
|
1683
|
+
let deferred3_1;
|
|
1684
|
+
try {
|
|
1685
|
+
const ptr0 = passStringToWasm0(prefix, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1686
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1687
|
+
const ptr1 = passStringToWasm0(uuid, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1688
|
+
const len1 = WASM_VECTOR_LEN;
|
|
1689
|
+
const ret = wasm.runtime_newDataTableName(ptr0, len0, ptr1, len1);
|
|
1690
|
+
deferred3_0 = ret[0];
|
|
1691
|
+
deferred3_1 = ret[1];
|
|
1692
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
1693
|
+
} finally {
|
|
1694
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
1695
|
+
}
|
|
1696
|
+
}
|
|
1697
|
+
/**
|
|
1531
1698
|
* The layout of the plans of the progress of the queries that start later, null for the default one
|
|
1532
1699
|
* @param {ProfileLayoutView | null} [layout]
|
|
1533
1700
|
*/
|
|
@@ -1536,6 +1703,19 @@ var Runtime = class Runtime {
|
|
|
1536
1703
|
if (ret[1]) throw takeFromExternrefTable0(ret[0]);
|
|
1537
1704
|
}
|
|
1538
1705
|
/**
|
|
1706
|
+
* Change the workbooks of the workbook tree as it is stored: insert or replace the entry of a workbook (`upsert`),
|
|
1707
|
+
* remove it (`remove`) or move it to a position in a folder (`move`). Returns the tree after the change and the
|
|
1708
|
+
* folder files to write in their order, the folders that gain workbooks first.
|
|
1709
|
+
* @param {Record<string, unknown>} stored
|
|
1710
|
+
* @param {Record<string, unknown>} change
|
|
1711
|
+
* @returns {{ tree: Record<string, unknown>; writes: { path: string[]; text: string }[] }}
|
|
1712
|
+
*/
|
|
1713
|
+
static changeWorkbookTree(stored, change) {
|
|
1714
|
+
const ret = wasm.runtime_changeWorkbookTree(stored, change);
|
|
1715
|
+
if (ret[2]) throw takeFromExternrefTable0(ret[1]);
|
|
1716
|
+
return takeFromExternrefTable0(ret[0]);
|
|
1717
|
+
}
|
|
1718
|
+
/**
|
|
1539
1719
|
* The text of the script with the functions of a connection, none once it is deleted
|
|
1540
1720
|
* @param {string} connection_id
|
|
1541
1721
|
* @returns {string | undefined}
|
|
@@ -1561,6 +1741,31 @@ var Runtime = class Runtime {
|
|
|
1561
1741
|
return wasm.runtime_isAnalysisOutdated(this.__wbg_ptr, script_key) !== 0;
|
|
1562
1742
|
}
|
|
1563
1743
|
/**
|
|
1744
|
+
* What a connection is in the events of a reported run, e.g. `trino http://localhost:8080`. Fails on params of an
|
|
1745
|
+
* unknown connector.
|
|
1746
|
+
* @param {Record<string, unknown>} params
|
|
1747
|
+
* @returns {string}
|
|
1748
|
+
*/
|
|
1749
|
+
static runConnectionLabel(params) {
|
|
1750
|
+
let deferred2_0;
|
|
1751
|
+
let deferred2_1;
|
|
1752
|
+
try {
|
|
1753
|
+
const ret = wasm.runtime_runConnectionLabel(params);
|
|
1754
|
+
var ptr1 = ret[0];
|
|
1755
|
+
var len1 = ret[1];
|
|
1756
|
+
if (ret[3]) {
|
|
1757
|
+
ptr1 = 0;
|
|
1758
|
+
len1 = 0;
|
|
1759
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
1760
|
+
}
|
|
1761
|
+
deferred2_0 = ptr1;
|
|
1762
|
+
deferred2_1 = len1;
|
|
1763
|
+
return getStringFromWasm0(ptr1, len1);
|
|
1764
|
+
} finally {
|
|
1765
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
1766
|
+
}
|
|
1767
|
+
}
|
|
1768
|
+
/**
|
|
1564
1769
|
* Follow the progress of a query with the layout of a follower, none without structured progress. The structure
|
|
1565
1770
|
* crosses only when its version differs from the one that the host holds.
|
|
1566
1771
|
* @param {number} query_id
|
|
@@ -1696,6 +1901,16 @@ var Runtime = class Runtime {
|
|
|
1696
1901
|
return wasm.runtime_deleteInvalidWorkbook(this.__wbg_ptr, ptr0, len0);
|
|
1697
1902
|
}
|
|
1698
1903
|
/**
|
|
1904
|
+
* Is a file name the name of an attachment, a Parquet file? Listings leave other files out.
|
|
1905
|
+
* @param {string} name
|
|
1906
|
+
* @returns {boolean}
|
|
1907
|
+
*/
|
|
1908
|
+
static isAttachmentFileName(name) {
|
|
1909
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1910
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1911
|
+
return wasm.runtime_isAttachmentFileName(ptr0, len0) !== 0;
|
|
1912
|
+
}
|
|
1913
|
+
/**
|
|
1699
1914
|
* Bring the folder of a workbook that the platform keeps in a folder of its own (`storage.workbookFolder`) to the
|
|
1700
1915
|
* current workbook format, e.g. the folder of a run of the command line tool before it reads the workbook id.
|
|
1701
1916
|
* Resolves with the outcome (`current`, `migrated`, `missing`, `unsupported`, `newer`), null for a workbook of the
|
|
@@ -1709,6 +1924,16 @@ var Runtime = class Runtime {
|
|
|
1709
1924
|
return wasm.runtime_migrateWorkbookFolder(this.__wbg_ptr, ptr0, len0);
|
|
1710
1925
|
}
|
|
1711
1926
|
/**
|
|
1927
|
+
* Check the name of an attachment: a plain file name of a Parquet file. Throws for any other name.
|
|
1928
|
+
* @param {string} name
|
|
1929
|
+
*/
|
|
1930
|
+
static validateDataFileName(name) {
|
|
1931
|
+
const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1932
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1933
|
+
const ret = wasm.runtime_validateDataFileName(ptr0, len0);
|
|
1934
|
+
if (ret[1]) throw takeFromExternrefTable0(ret[0]);
|
|
1935
|
+
}
|
|
1936
|
+
/**
|
|
1712
1937
|
* The recording of the progress of a query as JSON, none without structured progress
|
|
1713
1938
|
* @param {number} query_id
|
|
1714
1939
|
* @returns {string | undefined}
|
|
@@ -1938,91 +2163,6 @@ var Runtime = class Runtime {
|
|
|
1938
2163
|
if (ret[2]) throw takeFromExternrefTable0(ret[1]);
|
|
1939
2164
|
return takeFromExternrefTable0(ret[0]);
|
|
1940
2165
|
}
|
|
1941
|
-
/**
|
|
1942
|
-
* Lease a connection for a session of the host, a later lease takes the connection over. Returns the lease that
|
|
1943
|
-
* `closeSession` takes.
|
|
1944
|
-
* @param {string} connection_id
|
|
1945
|
-
* @returns {number}
|
|
1946
|
-
*/
|
|
1947
|
-
openSession(connection_id) {
|
|
1948
|
-
const ptr0 = passStringToWasm0(connection_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1949
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1950
|
-
return wasm.runtime_openSession(this.__wbg_ptr, ptr0, len0) >>> 0;
|
|
1951
|
-
}
|
|
1952
|
-
/**
|
|
1953
|
-
* Close a session of the host: the latest lease of the connection resets it, its channel closes the session. The
|
|
1954
|
-
* runtime keeps the connection, a later session sets it up again. An earlier lease changes nothing.
|
|
1955
|
-
* @param {string} connection_id
|
|
1956
|
-
* @param {number} lease
|
|
1957
|
-
*/
|
|
1958
|
-
closeSession(connection_id, lease) {
|
|
1959
|
-
const ptr0 = passStringToWasm0(connection_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1960
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1961
|
-
wasm.runtime_closeSession(this.__wbg_ptr, ptr0, len0, lease);
|
|
1962
|
-
}
|
|
1963
|
-
/**
|
|
1964
|
-
* Resolve once the catalog of a connection settled: no update runs and every relation that statements touched is
|
|
1965
|
-
* answered, e.g. after a statement of the shell. Resolves after the timeout as well (10 s by default), and at once
|
|
1966
|
-
* for an unknown connection: a catalog that doesn't follow never fails a statement.
|
|
1967
|
-
* @param {string} connection_id
|
|
1968
|
-
* @param {number | null} [timeout_ms]
|
|
1969
|
-
* @returns {Promise<void>}
|
|
1970
|
-
*/
|
|
1971
|
-
settleCatalog(connection_id, timeout_ms) {
|
|
1972
|
-
const ptr0 = passStringToWasm0(connection_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1973
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1974
|
-
return wasm.runtime_settleCatalog(this.__wbg_ptr, ptr0, len0, !isLikeNone(timeout_ms), isLikeNone(timeout_ms) ? 0 : timeout_ms);
|
|
1975
|
-
}
|
|
1976
|
-
/**
|
|
1977
|
-
* Attach files to a workbook: every Parquet file gets a name whose table parameter takes no name of a script or
|
|
1978
|
-
* another attachment (`sales.parquet` becomes `sales-2.parquet`, a file with the name of an attachment replaces
|
|
1979
|
-
* it), is written through the storage writer and the view of the workbook lists it once the storage does. Resolves
|
|
1980
|
-
* with the names the files got and the refused files, rejects with what the storage failed with.
|
|
1981
|
-
* @param {string} workbook_id
|
|
1982
|
-
* @param {AttachedFile[]} files
|
|
1983
|
-
* @returns {Promise<AttachFilesOutcome>}
|
|
1984
|
-
*/
|
|
1985
|
-
attachFiles(workbook_id, files) {
|
|
1986
|
-
const ptr0 = passStringToWasm0(workbook_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1987
|
-
const len0 = WASM_VECTOR_LEN;
|
|
1988
|
-
const ret = wasm.runtime_attachFiles(this.__wbg_ptr, ptr0, len0, files);
|
|
1989
|
-
if (ret[2]) throw takeFromExternrefTable0(ret[1]);
|
|
1990
|
-
return takeFromExternrefTable0(ret[0]);
|
|
1991
|
-
}
|
|
1992
|
-
/**
|
|
1993
|
-
* Rename an attachment of a workbook like a script: the name is a display name, `.parquet` is added unless it has
|
|
1994
|
-
* it, and the name takes no name of a script or another attachment, `sales` becomes `sales-2` then. The scripts
|
|
1995
|
-
* that read the attachment read the new name at once and its file is renamed through the storage writer. A refused
|
|
1996
|
-
* rename, e.g. of a cloud preview or one whose rewrite of the references fails, rejects before anything changed.
|
|
1997
|
-
* Resolves with the new file name once the file has it and the view lists it, null for a name that is unchanged or
|
|
1998
|
-
* no plain file name. Rejects with what the storage failed with, the writer tries the rename again.
|
|
1999
|
-
* @param {string} workbook_id
|
|
2000
|
-
* @param {string} file_name
|
|
2001
|
-
* @param {string} name
|
|
2002
|
-
* @returns {Promise<string | null>}
|
|
2003
|
-
*/
|
|
2004
|
-
renameAttachment(workbook_id, file_name, name) {
|
|
2005
|
-
const ptr0 = passStringToWasm0(workbook_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2006
|
-
const len0 = WASM_VECTOR_LEN;
|
|
2007
|
-
const ptr1 = passStringToWasm0(file_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2008
|
-
const len1 = WASM_VECTOR_LEN;
|
|
2009
|
-
const ptr2 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2010
|
-
const len2 = WASM_VECTOR_LEN;
|
|
2011
|
-
const ret = wasm.runtime_renameAttachment(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
|
|
2012
|
-
if (ret[2]) throw takeFromExternrefTable0(ret[1]);
|
|
2013
|
-
return takeFromExternrefTable0(ret[0]);
|
|
2014
|
-
}
|
|
2015
|
-
/**
|
|
2016
|
-
* List the attachments of a workbook again, e.g. after one was removed or renamed in the storage. Resolves once
|
|
2017
|
-
* the view of the workbook lists them, rejects with what the storage failed with.
|
|
2018
|
-
* @param {string} workbook_id
|
|
2019
|
-
* @returns {Promise<void>}
|
|
2020
|
-
*/
|
|
2021
|
-
refreshAttachments(workbook_id) {
|
|
2022
|
-
const ptr0 = passStringToWasm0(workbook_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2023
|
-
const len0 = WASM_VECTOR_LEN;
|
|
2024
|
-
return wasm.runtime_refreshAttachments(this.__wbg_ptr, ptr0, len0);
|
|
2025
|
-
}
|
|
2026
2166
|
};
|
|
2027
2167
|
if (Symbol.dispose) Runtime.prototype[Symbol.dispose] = Runtime.prototype.free;
|
|
2028
2168
|
var ScriptFinalization = typeof FinalizationRegistry === "undefined" ? {
|
|
@@ -2826,6 +2966,39 @@ var ScriptSession = class ScriptSession {
|
|
|
2826
2966
|
return v2;
|
|
2827
2967
|
}
|
|
2828
2968
|
/**
|
|
2969
|
+
* Select the columns of the result of the terminal query below it, the new statement formatted with the
|
|
2970
|
+
* config. Returns the new text, the error says why the script cannot get the projection.
|
|
2971
|
+
* @param {string[]} columns
|
|
2972
|
+
* @param {number} dialect
|
|
2973
|
+
* @param {number} mode
|
|
2974
|
+
* @param {number} max_width
|
|
2975
|
+
* @param {number} indentation_width
|
|
2976
|
+
* @param {number} keyword_case
|
|
2977
|
+
* @param {boolean} parse_if_outdated
|
|
2978
|
+
* @returns {string}
|
|
2979
|
+
*/
|
|
2980
|
+
rewriteResultProjection(columns, dialect, mode, max_width, indentation_width, keyword_case, parse_if_outdated) {
|
|
2981
|
+
let deferred3_0;
|
|
2982
|
+
let deferred3_1;
|
|
2983
|
+
try {
|
|
2984
|
+
const ptr0 = passArrayJsValueToWasm0(columns, wasm.__wbindgen_malloc);
|
|
2985
|
+
const len0 = WASM_VECTOR_LEN;
|
|
2986
|
+
const ret = wasm.scriptsession_rewriteResultProjection(this.__wbg_ptr, ptr0, len0, dialect, mode, max_width, indentation_width, keyword_case, parse_if_outdated);
|
|
2987
|
+
var ptr2 = ret[0];
|
|
2988
|
+
var len2 = ret[1];
|
|
2989
|
+
if (ret[3]) {
|
|
2990
|
+
ptr2 = 0;
|
|
2991
|
+
len2 = 0;
|
|
2992
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
2993
|
+
}
|
|
2994
|
+
deferred3_0 = ptr2;
|
|
2995
|
+
deferred3_1 = len2;
|
|
2996
|
+
return getStringFromWasm0(ptr2, len2);
|
|
2997
|
+
} finally {
|
|
2998
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
2999
|
+
}
|
|
3000
|
+
}
|
|
3001
|
+
/**
|
|
2829
3002
|
* @param {Catalog} catalog
|
|
2830
3003
|
* @param {number} offset_unit
|
|
2831
3004
|
*/
|
|
@@ -4076,6 +4249,38 @@ var WorkbookScriptSession = class WorkbookScriptSession {
|
|
|
4076
4249
|
return v2;
|
|
4077
4250
|
}
|
|
4078
4251
|
/**
|
|
4252
|
+
* Select the columns of the result of the terminal query below it. Returns the new text, the session stays.
|
|
4253
|
+
* @param {string[]} columns
|
|
4254
|
+
* @param {number} dialect
|
|
4255
|
+
* @param {number} mode
|
|
4256
|
+
* @param {number} max_width
|
|
4257
|
+
* @param {number} indentation_width
|
|
4258
|
+
* @param {number} keyword_case
|
|
4259
|
+
* @param {boolean} parse_if_outdated
|
|
4260
|
+
* @returns {string}
|
|
4261
|
+
*/
|
|
4262
|
+
rewriteResultProjection(columns, dialect, mode, max_width, indentation_width, keyword_case, parse_if_outdated) {
|
|
4263
|
+
let deferred3_0;
|
|
4264
|
+
let deferred3_1;
|
|
4265
|
+
try {
|
|
4266
|
+
const ptr0 = passArrayJsValueToWasm0(columns, wasm.__wbindgen_malloc);
|
|
4267
|
+
const len0 = WASM_VECTOR_LEN;
|
|
4268
|
+
const ret = wasm.workbookscriptsession_rewriteResultProjection(this.__wbg_ptr, ptr0, len0, dialect, mode, max_width, indentation_width, keyword_case, parse_if_outdated);
|
|
4269
|
+
var ptr2 = ret[0];
|
|
4270
|
+
var len2 = ret[1];
|
|
4271
|
+
if (ret[3]) {
|
|
4272
|
+
ptr2 = 0;
|
|
4273
|
+
len2 = 0;
|
|
4274
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
4275
|
+
}
|
|
4276
|
+
deferred3_0 = ptr2;
|
|
4277
|
+
deferred3_1 = len2;
|
|
4278
|
+
return getStringFromWasm0(ptr2, len2);
|
|
4279
|
+
} finally {
|
|
4280
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
4281
|
+
}
|
|
4282
|
+
}
|
|
4283
|
+
/**
|
|
4079
4284
|
* @returns {string}
|
|
4080
4285
|
*/
|
|
4081
4286
|
text() {
|
|
@@ -4457,21 +4662,21 @@ function __wbg_get_imports() {
|
|
|
4457
4662
|
imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
|
|
4458
4663
|
return BigInt.asUintN(64, arg0);
|
|
4459
4664
|
};
|
|
4460
|
-
imports.wbg.
|
|
4665
|
+
imports.wbg.__wbindgen_cast_54f8085a106ea659 = function(arg0, arg1) {
|
|
4461
4666
|
return makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h9635fd3ae9a780df, wasm_bindgen__convert__closures_____invoke__h6062519666d8a005);
|
|
4462
4667
|
};
|
|
4463
4668
|
imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
|
|
4464
4669
|
return arg0;
|
|
4465
4670
|
};
|
|
4466
|
-
imports.wbg.__wbindgen_cast_bce5e8dbfadf1667 = function(arg0, arg1) {
|
|
4467
|
-
return makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__he52a6c160ad8bcc6, wasm_bindgen__convert__closures_____invoke__hc9cbe033348e018d);
|
|
4468
|
-
};
|
|
4469
4671
|
imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
|
|
4470
4672
|
return getArrayU8FromWasm0(arg0, arg1);
|
|
4471
4673
|
};
|
|
4472
4674
|
imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
|
|
4473
4675
|
return arg0;
|
|
4474
4676
|
};
|
|
4677
|
+
imports.wbg.__wbindgen_cast_fc2279c0237f44a0 = function(arg0, arg1) {
|
|
4678
|
+
return makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__he52a6c160ad8bcc6, wasm_bindgen__convert__closures_____invoke__hc9cbe033348e018d);
|
|
4679
|
+
};
|
|
4475
4680
|
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
4476
4681
|
const table = wasm.__wbindgen_externrefs;
|
|
4477
4682
|
const offset = table.grow(4);
|
|
@@ -4516,4 +4721,4 @@ async function __wbg_init(module_or_path) {
|
|
|
4516
4721
|
}
|
|
4517
4722
|
/** The URL of the module next to this glue */
|
|
4518
4723
|
var wasmUrl = new URL("./dashql_core.wasm", import.meta.url);
|
|
4519
|
-
export { Catalog, CatalogUpdateTaskStatus, CatalogUpdateVariant, ConnectionHealth, ConnectionStatus, ConnectorType, QueryExecutionStatus, QueryProfile, QueryProgressFollower, QueryType, Runtime, Script, ScriptBatch, ScriptSession, SessionPlanRequest, Shell, ShellCompletionCandidate, ShellCompletionList, ShellOperation, ShellPromptResult, ShellTerminalResult, TableParameters, TaskStatus, WorkbookScriptSession,
|
|
4724
|
+
export { Catalog, CatalogUpdateTaskStatus, CatalogUpdateVariant, ConnectionHealth, ConnectionStatus, ConnectorType, QueryExecutionStatus, QueryProfile, QueryProgressFollower, QueryType, Runtime, Script, ScriptBatch, ScriptSession, SessionPlanRequest, Shell, ShellCompletionCandidate, ShellCompletionList, ShellOperation, ShellPromptResult, ShellTerminalResult, TableParameters, TaskStatus, WorkbookScriptSession, collectSessionInputs, dashql_core_exports, __wbg_init as default, initSync, inputLiteral, installPanicHook, processBatch, quoteColumnName, quoteIdentifier, replayQueryProgress, textChange, touchedRelations, wasmUrl };
|