@akohn/dashql 0.0.19-dev.268.g2efe9377d → 0.0.19-dev.305.gb0f831a47

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.
@@ -199,35 +199,6 @@ function makeMutClosure(arg0, arg1, dtor, f) {
199
199
  CLOSURE_DTORS.register(real, state, state);
200
200
  return real;
201
201
  }
202
- function takeFromExternrefTable0(idx) {
203
- const value = wasm.__wbindgen_externrefs.get(idx);
204
- wasm.__externref_table_dealloc(idx);
205
- return value;
206
- }
207
- /**
208
- * Replay a recording of the progress of a query (JSON, see `ProfileRecording`) up to a point in time in milliseconds
209
- * since its first payload, with a layout of the plan or the default one. None if nothing happened until then.
210
- * @param {string} recording
211
- * @param {number} until_ms
212
- * @param {ProfileLayoutView | null} [layout]
213
- * @returns {QueryProfileProgressView | undefined}
214
- */
215
- function replayQueryProgress(recording, until_ms, layout) {
216
- const ptr0 = passStringToWasm0(recording, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
217
- const len0 = WASM_VECTOR_LEN;
218
- const ret = wasm.replayQueryProgress(ptr0, len0, until_ms, isLikeNone(layout) ? 0 : addToExternrefTable0(layout));
219
- if (ret[2]) throw takeFromExternrefTable0(ret[1]);
220
- return takeFromExternrefTable0(ret[0]);
221
- }
222
- function _assertClass(instance, klass) {
223
- if (!(instance instanceof klass)) throw new Error(`expected instance of ${klass.name}`);
224
- }
225
- function passArray8ToWasm0(arg, malloc) {
226
- const ptr = malloc(arg.length * 1, 1) >>> 0;
227
- getUint8ArrayMemory0().set(arg, ptr / 1);
228
- WASM_VECTOR_LEN = arg.length;
229
- return ptr;
230
- }
231
202
  function passArrayJsValueToWasm0(array, malloc) {
232
203
  const ptr = malloc(array.length * 4, 4) >>> 0;
233
204
  for (let i = 0; i < array.length; i++) {
@@ -237,21 +208,57 @@ function passArrayJsValueToWasm0(array, malloc) {
237
208
  WASM_VECTOR_LEN = array.length;
238
209
  return ptr;
239
210
  }
211
+ function takeFromExternrefTable0(idx) {
212
+ const value = wasm.__wbindgen_externrefs.get(idx);
213
+ wasm.__externref_table_dealloc(idx);
214
+ return value;
215
+ }
240
216
  var cachedUint32ArrayMemory0 = null;
241
217
  function getUint32ArrayMemory0() {
242
218
  if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
243
219
  return cachedUint32ArrayMemory0;
244
220
  }
245
- function getArrayU32FromWasm0(ptr, len) {
246
- ptr = ptr >>> 0;
247
- return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
248
- }
249
221
  function passArray32ToWasm0(arg, malloc) {
250
222
  const ptr = malloc(arg.length * 4, 4) >>> 0;
251
223
  getUint32ArrayMemory0().set(arg, ptr / 4);
252
224
  WASM_VECTOR_LEN = arg.length;
253
225
  return ptr;
254
226
  }
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
+ /**
241
+ * Report panics to `globalThis.__dashqlCorePanic` before the module traps.
242
+ *
243
+ * A panic aborts: the call traps without dropping its guards, so the objects it borrowed stay borrowed and the
244
+ * module must not be used anymore. JS sees only the trap, the hook tells it why.
245
+ */
246
+ function installPanicHook() {
247
+ wasm.installPanicHook();
248
+ }
249
+ /**
250
+ * Collect the inputs of the scripts of a session (`session_inputs::collect_session_inputs`), returns the packed
251
+ * `SessionInputs`. Ignores the targets, the materialized scripts and the mount prefix.
252
+ * @param {SessionPlanRequest} request
253
+ * @returns {Uint8Array}
254
+ */
255
+ function collectSessionInputs(request) {
256
+ _assertClass(request, SessionPlanRequest);
257
+ const ret = wasm.collectSessionInputs(request.__wbg_ptr);
258
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
259
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
260
+ return v1;
261
+ }
255
262
  /**
256
263
  * The literal of the value of an input control, in the Hyper dialect: `sql_type` is the SQL text of the type of the
257
264
  * input, `SqlType.sql`, absent without a type
@@ -283,31 +290,71 @@ function inputLiteral(value, sql_type) {
283
290
  }
284
291
  }
285
292
  /**
286
- * Process a batch request into a `BatchResult`
287
- * @param {Uint8Array} request
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
288
312
  * @returns {Uint8Array}
289
313
  */
290
- function processBatch(request) {
291
- const ptr0 = passArray8ToWasm0(request, wasm.__wbindgen_malloc);
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
+ * The relations that the statements of a text create or drop, returns packed `TouchedRelations`
335
+ * @param {string} text
336
+ * @returns {Uint8Array}
337
+ */
338
+ function touchedRelations(text) {
339
+ const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
292
340
  const len0 = WASM_VECTOR_LEN;
293
- const ret = wasm.processBatch(ptr0, len0);
294
- if (ret[3]) throw takeFromExternrefTable0(ret[2]);
341
+ const ret = wasm.touchedRelations(ptr0, len0);
295
342
  var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
296
343
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
297
344
  return v2;
298
345
  }
299
346
  /**
300
- * Quote an identifier if it would not read back unquoted, e.g. the name of a script reference `:"foo-2"`
347
+ * Quote a column name for a column reference in SQL text, also quotes keywords that are not unreserved, e.g. `"user"`
301
348
  * @param {string} text
302
349
  * @returns {string}
303
350
  */
304
- function quoteIdentifier(text) {
351
+ function quoteColumnName(text) {
305
352
  let deferred2_0;
306
353
  let deferred2_1;
307
354
  try {
308
355
  const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
309
356
  const len0 = WASM_VECTOR_LEN;
310
- const ret = wasm.quoteIdentifier(ptr0, len0);
357
+ const ret = wasm.quoteColumnName(ptr0, len0);
311
358
  deferred2_0 = ret[0];
312
359
  deferred2_1 = ret[1];
313
360
  return getStringFromWasm0(ret[0], ret[1]);
@@ -316,32 +363,20 @@ function quoteIdentifier(text) {
316
363
  }
317
364
  }
318
365
  /**
319
- * The relations that the statements of a text create or drop, returns packed `TouchedRelations`
320
- * @param {string} text
366
+ * Process a batch request into a `BatchResult`
367
+ * @param {Uint8Array} request
321
368
  * @returns {Uint8Array}
322
369
  */
323
- function touchedRelations(text) {
324
- const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
370
+ function processBatch(request) {
371
+ const ptr0 = passArray8ToWasm0(request, wasm.__wbindgen_malloc);
325
372
  const len0 = WASM_VECTOR_LEN;
326
- const ret = wasm.touchedRelations(ptr0, len0);
373
+ const ret = wasm.processBatch(ptr0, len0);
374
+ if (ret[3]) throw takeFromExternrefTable0(ret[2]);
327
375
  var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
328
376
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
329
377
  return v2;
330
378
  }
331
379
  /**
332
- * Derive the dataflow of the scripts of a session (`dataflow::derive_session_dataflow`), returns the packed
333
- * `SessionDataflow`. The text spans are in the offset unit of the session of each script.
334
- * @param {SessionPlanRequest} request
335
- * @returns {Uint8Array}
336
- */
337
- function deriveSessionDataflow(request) {
338
- _assertClass(request, SessionPlanRequest);
339
- const ret = wasm.deriveSessionDataflow(request.__wbg_ptr);
340
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
341
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
342
- return v1;
343
- }
344
- /**
345
380
  * Check the script references of the scripts of a session, returns the packed `ScriptReferenceCheck`. The text spans
346
381
  * are in the offset unit of the session of each script. Ignores the targets, the materialized scripts and the mount
347
382
  * prefix.
@@ -356,51 +391,17 @@ function checkScriptReferences(request) {
356
391
  return v1;
357
392
  }
358
393
  /**
359
- * Report panics to `globalThis.__dashqlCorePanic` before the module traps.
360
- *
361
- * A panic aborts: the call traps without dropping its guards, so the objects it borrowed stay borrowed and the
362
- * module must not be used anymore. JS sees only the trap, the hook tells it why.
363
- */
364
- function installPanicHook() {
365
- wasm.installPanicHook();
366
- }
367
- /**
368
- * Collect the inputs of the scripts of a session (`session_inputs::collect_session_inputs`), returns the packed
369
- * `SessionInputs`. Ignores the targets, the materialized scripts and the mount prefix.
370
- * @param {SessionPlanRequest} request
371
- * @returns {Uint8Array}
372
- */
373
- function collectSessionInputs(request) {
374
- _assertClass(request, SessionPlanRequest);
375
- const ret = wasm.collectSessionInputs(request.__wbg_ptr);
376
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
377
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
378
- return v1;
379
- }
380
- /**
381
- * Plan the current analysis of the scripts of a session across connections, returns the packed `ExecutionGraph`
382
- * @param {SessionPlanRequest} request
383
- * @returns {Uint8Array}
384
- */
385
- function planSession(request) {
386
- _assertClass(request, SessionPlanRequest);
387
- const ret = wasm.planSession(request.__wbg_ptr);
388
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
389
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
390
- return v1;
391
- }
392
- /**
393
- * Quote a column name for a column reference in SQL text, also quotes keywords that are not unreserved, e.g. `"user"`
394
+ * Quote an identifier if it would not read back unquoted, e.g. the name of a script reference `:"foo-2"`
394
395
  * @param {string} text
395
396
  * @returns {string}
396
397
  */
397
- function quoteColumnName(text) {
398
+ function quoteIdentifier(text) {
398
399
  let deferred2_0;
399
400
  let deferred2_1;
400
401
  try {
401
402
  const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
402
403
  const len0 = WASM_VECTOR_LEN;
403
- const ret = wasm.quoteColumnName(ptr0, len0);
404
+ const ret = wasm.quoteIdentifier(ptr0, len0);
404
405
  deferred2_0 = ret[0];
405
406
  deferred2_1 = ret[1];
406
407
  return getStringFromWasm0(ret[0], ret[1]);
@@ -408,22 +409,6 @@ function quoteColumnName(text) {
408
409
  wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
409
410
  }
410
411
  }
411
- /**
412
- * The change from one text to another (`workbook::text_change`): the range between their common prefix and suffix, on
413
- * character boundaries, its offsets in UTF-16 code units like those of the editors
414
- * @param {string} from
415
- * @param {string} to
416
- * @returns {WorkbookTextChange}
417
- */
418
- function textChange(from, to) {
419
- const ptr0 = passStringToWasm0(from, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
420
- const len0 = WASM_VECTOR_LEN;
421
- const ptr1 = passStringToWasm0(to, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
422
- const len1 = WASM_VECTOR_LEN;
423
- const ret = wasm.textChange(ptr0, len0, ptr1, len1);
424
- if (ret[2]) throw takeFromExternrefTable0(ret[1]);
425
- return takeFromExternrefTable0(ret[0]);
426
- }
427
412
  function getArrayJsValueFromWasm0(ptr, len) {
428
413
  ptr = ptr >>> 0;
429
414
  const mem = getDataViewMemory0();
@@ -432,11 +417,26 @@ function getArrayJsValueFromWasm0(ptr, len) {
432
417
  wasm.__externref_drop_slice(ptr, len);
433
418
  return result;
434
419
  }
420
+ /**
421
+ * Replay a recording of the progress of a query (JSON, see `ProfileRecording`) up to a point in time in milliseconds
422
+ * since its first payload, with a layout of the plan or the default one. None if nothing happened until then.
423
+ * @param {string} recording
424
+ * @param {number} until_ms
425
+ * @param {ProfileLayoutView | null} [layout]
426
+ * @returns {QueryProfileProgressView | undefined}
427
+ */
428
+ function replayQueryProgress(recording, until_ms, layout) {
429
+ const ptr0 = passStringToWasm0(recording, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
430
+ const len0 = WASM_VECTOR_LEN;
431
+ const ret = wasm.replayQueryProgress(ptr0, len0, until_ms, isLikeNone(layout) ? 0 : addToExternrefTable0(layout));
432
+ if (ret[2]) throw takeFromExternrefTable0(ret[1]);
433
+ return takeFromExternrefTable0(ret[0]);
434
+ }
435
435
  function wasm_bindgen__convert__closures_____invoke__hc9cbe033348e018d(arg0, arg1, arg2) {
436
436
  wasm.wasm_bindgen__convert__closures_____invoke__hc9cbe033348e018d(arg0, arg1, arg2);
437
437
  }
438
- function wasm_bindgen__convert__closures_____invoke__ha7a2b373f2a9ce09(arg0, arg1, arg2) {
439
- return wasm.wasm_bindgen__convert__closures_____invoke__ha7a2b373f2a9ce09(arg0, arg1, arg2);
438
+ function wasm_bindgen__convert__closures_____invoke__h6062519666d8a005(arg0, arg1, arg2) {
439
+ return wasm.wasm_bindgen__convert__closures_____invoke__h6062519666d8a005(arg0, arg1, arg2);
440
440
  }
441
441
  function wasm_bindgen__convert__closures_____invoke__h3cb6850919769fd7(arg0, arg1, arg2, arg3) {
442
442
  wasm.wasm_bindgen__convert__closures_____invoke__h3cb6850919769fd7(arg0, arg1, arg2, arg3);
@@ -1060,56 +1060,6 @@ var Runtime = class Runtime {
1060
1060
  wasm.__wbg_runtime_free(ptr, 0);
1061
1061
  }
1062
1062
  /**
1063
- * Attach files to a workbook: every Parquet file gets a name whose table parameter takes no name of a script or
1064
- * another attachment (`sales.parquet` becomes `sales-2.parquet`, a file with the name of an attachment replaces
1065
- * it), is written through the storage writer and the view of the workbook lists it once the storage does. Resolves
1066
- * with the names the files got and the refused files, rejects with what the storage failed with.
1067
- * @param {string} workbook_id
1068
- * @param {AttachedFile[]} files
1069
- * @returns {Promise<AttachFilesOutcome>}
1070
- */
1071
- attachFiles(workbook_id, files) {
1072
- const ptr0 = passStringToWasm0(workbook_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1073
- const len0 = WASM_VECTOR_LEN;
1074
- const ret = wasm.runtime_attachFiles(this.__wbg_ptr, ptr0, len0, files);
1075
- if (ret[2]) throw takeFromExternrefTable0(ret[1]);
1076
- return takeFromExternrefTable0(ret[0]);
1077
- }
1078
- /**
1079
- * Rename an attachment of a workbook like a script: the name is a display name, `.parquet` is added unless it has
1080
- * it, and the name takes no name of a script or another attachment, `sales` becomes `sales-2` then. The scripts
1081
- * that read the attachment read the new name at once and its file is renamed through the storage writer. A refused
1082
- * rename, e.g. of a cloud preview or one whose rewrite of the references fails, rejects before anything changed.
1083
- * Resolves with the new file name once the file has it and the view lists it, null for a name that is unchanged or
1084
- * no plain file name. Rejects with what the storage failed with, the writer tries the rename again.
1085
- * @param {string} workbook_id
1086
- * @param {string} file_name
1087
- * @param {string} name
1088
- * @returns {Promise<string | null>}
1089
- */
1090
- renameAttachment(workbook_id, file_name, name) {
1091
- const ptr0 = passStringToWasm0(workbook_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1092
- const len0 = WASM_VECTOR_LEN;
1093
- const ptr1 = passStringToWasm0(file_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1094
- const len1 = WASM_VECTOR_LEN;
1095
- const ptr2 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1096
- const len2 = WASM_VECTOR_LEN;
1097
- const ret = wasm.runtime_renameAttachment(this.__wbg_ptr, ptr0, len0, ptr1, len1, ptr2, len2);
1098
- if (ret[2]) throw takeFromExternrefTable0(ret[1]);
1099
- return takeFromExternrefTable0(ret[0]);
1100
- }
1101
- /**
1102
- * List the attachments of a workbook again, e.g. after one was removed or renamed in the storage. Resolves once
1103
- * the view of the workbook lists them, rejects with what the storage failed with.
1104
- * @param {string} workbook_id
1105
- * @returns {Promise<void>}
1106
- */
1107
- refreshAttachments(workbook_id) {
1108
- const ptr0 = passStringToWasm0(workbook_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1109
- const len0 = WASM_VECTOR_LEN;
1110
- return wasm.runtime_refreshAttachments(this.__wbg_ptr, ptr0, len0);
1111
- }
1112
- /**
1113
1063
  * The identity of the catalog of a connection, `catalogId` of its view, without reading the view. None for an
1114
1064
  * unknown connection and while a task holds it.
1115
1065
  * @param {string} connection_id
@@ -1284,6 +1234,19 @@ var Runtime = class Runtime {
1284
1234
  return takeFromExternrefTable0(ret[0]);
1285
1235
  }
1286
1236
  /**
1237
+ * Cancel what runs for a script: the run of its workbook while one plans, runs or stops, the latest query of the
1238
+ * script otherwise. Resolves once a cancelled query ended, at once for a run (its view follows) and for a script
1239
+ * that runs nothing.
1240
+ * @param {string} workbook_id
1241
+ * @param {number} script_key
1242
+ * @returns {Promise<void>}
1243
+ */
1244
+ cancelScript(workbook_id, script_key) {
1245
+ const ptr0 = passStringToWasm0(workbook_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1246
+ const len0 = WASM_VECTOR_LEN;
1247
+ return wasm.runtime_cancelScript(this.__wbg_ptr, ptr0, len0, script_key);
1248
+ }
1249
+ /**
1287
1250
  * Import a workbook that was read, with the answers to its questions: the connections are mapped, the cached
1288
1251
  * results go to the query result cache, the workbook is written and restored. The listener hears the steps.
1289
1252
  * @param {number} import_id
@@ -1929,8 +1892,9 @@ var Runtime = class Runtime {
1929
1892
  return takeFromExternrefTable0(ret[0]);
1930
1893
  }
1931
1894
  /**
1932
- * Apply an action to a slice. Never throws: a malformed target or action and a refused action are failed outcomes,
1933
- * logged as warnings.
1895
+ * Apply an action to a slice, read with the union of the actions of its target (`ActionOf`). Never throws: a
1896
+ * malformed target or action, an action of another target and a refused action are failed outcomes, logged as
1897
+ * warnings.
1934
1898
  * @param {Target} target
1935
1899
  * @param {RuntimeAction} action
1936
1900
  * @returns {DispatchOutcome}
@@ -2009,6 +1973,56 @@ var Runtime = class Runtime {
2009
1973
  const len0 = WASM_VECTOR_LEN;
2010
1974
  return wasm.runtime_settleCatalog(this.__wbg_ptr, ptr0, len0, !isLikeNone(timeout_ms), isLikeNone(timeout_ms) ? 0 : timeout_ms);
2011
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
+ }
2012
2026
  };
2013
2027
  if (Symbol.dispose) Runtime.prototype[Symbol.dispose] = Runtime.prototype.free;
2014
2028
  var ScriptFinalization = typeof FinalizationRegistry === "undefined" ? {
@@ -2812,6 +2826,39 @@ var ScriptSession = class ScriptSession {
2812
2826
  return v2;
2813
2827
  }
2814
2828
  /**
2829
+ * Select the columns of the result of the terminal query below it, the new statement formatted with the
2830
+ * config. Returns the new text, the error says why the script cannot get the projection.
2831
+ * @param {string[]} columns
2832
+ * @param {number} dialect
2833
+ * @param {number} mode
2834
+ * @param {number} max_width
2835
+ * @param {number} indentation_width
2836
+ * @param {number} keyword_case
2837
+ * @param {boolean} parse_if_outdated
2838
+ * @returns {string}
2839
+ */
2840
+ rewriteResultProjection(columns, dialect, mode, max_width, indentation_width, keyword_case, parse_if_outdated) {
2841
+ let deferred3_0;
2842
+ let deferred3_1;
2843
+ try {
2844
+ const ptr0 = passArrayJsValueToWasm0(columns, wasm.__wbindgen_malloc);
2845
+ const len0 = WASM_VECTOR_LEN;
2846
+ const ret = wasm.scriptsession_rewriteResultProjection(this.__wbg_ptr, ptr0, len0, dialect, mode, max_width, indentation_width, keyword_case, parse_if_outdated);
2847
+ var ptr2 = ret[0];
2848
+ var len2 = ret[1];
2849
+ if (ret[3]) {
2850
+ ptr2 = 0;
2851
+ len2 = 0;
2852
+ throw takeFromExternrefTable0(ret[2]);
2853
+ }
2854
+ deferred3_0 = ptr2;
2855
+ deferred3_1 = len2;
2856
+ return getStringFromWasm0(ptr2, len2);
2857
+ } finally {
2858
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
2859
+ }
2860
+ }
2861
+ /**
2815
2862
  * @param {Catalog} catalog
2816
2863
  * @param {number} offset_unit
2817
2864
  */
@@ -4062,6 +4109,38 @@ var WorkbookScriptSession = class WorkbookScriptSession {
4062
4109
  return v2;
4063
4110
  }
4064
4111
  /**
4112
+ * Select the columns of the result of the terminal query below it. Returns the new text, the session stays.
4113
+ * @param {string[]} columns
4114
+ * @param {number} dialect
4115
+ * @param {number} mode
4116
+ * @param {number} max_width
4117
+ * @param {number} indentation_width
4118
+ * @param {number} keyword_case
4119
+ * @param {boolean} parse_if_outdated
4120
+ * @returns {string}
4121
+ */
4122
+ rewriteResultProjection(columns, dialect, mode, max_width, indentation_width, keyword_case, parse_if_outdated) {
4123
+ let deferred3_0;
4124
+ let deferred3_1;
4125
+ try {
4126
+ const ptr0 = passArrayJsValueToWasm0(columns, wasm.__wbindgen_malloc);
4127
+ const len0 = WASM_VECTOR_LEN;
4128
+ const ret = wasm.workbookscriptsession_rewriteResultProjection(this.__wbg_ptr, ptr0, len0, dialect, mode, max_width, indentation_width, keyword_case, parse_if_outdated);
4129
+ var ptr2 = ret[0];
4130
+ var len2 = ret[1];
4131
+ if (ret[3]) {
4132
+ ptr2 = 0;
4133
+ len2 = 0;
4134
+ throw takeFromExternrefTable0(ret[2]);
4135
+ }
4136
+ deferred3_0 = ptr2;
4137
+ deferred3_1 = len2;
4138
+ return getStringFromWasm0(ptr2, len2);
4139
+ } finally {
4140
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
4141
+ }
4142
+ }
4143
+ /**
4065
4144
  * @returns {string}
4066
4145
  */
4067
4146
  text() {
@@ -4140,7 +4219,7 @@ function __wbg_get_imports() {
4140
4219
  getDataViewMemory0().setInt32(arg0 + 4, len1, true);
4141
4220
  getDataViewMemory0().setInt32(arg0 + 0, ptr1, true);
4142
4221
  };
4143
- imports.wbg.__wbg___dashqlCorePanic_9fd9283c31c10930 = function() {
4222
+ imports.wbg.__wbg___dashqlCorePanic_837ba4f6d7aba2bf = function() {
4144
4223
  return handleError(function(arg0, arg1) {
4145
4224
  globalThis.__dashqlCorePanic(getStringFromWasm0(arg0, arg1));
4146
4225
  }, arguments);
@@ -4437,24 +4516,24 @@ function __wbg_get_imports() {
4437
4516
  imports.wbg.__wbg_value_692627309814bb8c = function(arg0) {
4438
4517
  return arg0.value;
4439
4518
  };
4440
- imports.wbg.__wbindgen_cast_061d746ad856efa2 = function(arg0, arg1) {
4441
- return makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h74bdb7d22b702b82, wasm_bindgen__convert__closures_____invoke__ha7a2b373f2a9ce09);
4442
- };
4443
4519
  imports.wbg.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
4444
4520
  return getStringFromWasm0(arg0, arg1);
4445
4521
  };
4446
4522
  imports.wbg.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
4447
4523
  return BigInt.asUintN(64, arg0);
4448
4524
  };
4449
- imports.wbg.__wbindgen_cast_995c4d5901b93656 = function(arg0, arg1) {
4450
- return makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__he52a6c160ad8bcc6, wasm_bindgen__convert__closures_____invoke__hc9cbe033348e018d);
4451
- };
4452
4525
  imports.wbg.__wbindgen_cast_9ae0607507abb057 = function(arg0) {
4453
4526
  return arg0;
4454
4527
  };
4528
+ imports.wbg.__wbindgen_cast_bce5e8dbfadf1667 = function(arg0, arg1) {
4529
+ return makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__he52a6c160ad8bcc6, wasm_bindgen__convert__closures_____invoke__hc9cbe033348e018d);
4530
+ };
4455
4531
  imports.wbg.__wbindgen_cast_cb9088102bce6b30 = function(arg0, arg1) {
4456
4532
  return getArrayU8FromWasm0(arg0, arg1);
4457
4533
  };
4534
+ imports.wbg.__wbindgen_cast_cf21df3633c132a5 = function(arg0, arg1) {
4535
+ return makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h9635fd3ae9a780df, wasm_bindgen__convert__closures_____invoke__h6062519666d8a005);
4536
+ };
4458
4537
  imports.wbg.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
4459
4538
  return arg0;
4460
4539
  };
Binary file
@@ -1,5 +1,12 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+ /**
4
+ * Route the edges of the dataflow canvas around its boxes (`routing::route_edges`). The boxes are x, y,
5
+ * width and height, the edges x and y of the source on the right border of its box and x and y of the target on the
6
+ * left border of its box. Returns per edge the number of points of its route, 0 without a route, followed by x and
7
+ * y of the points of a polyline of horizontal and vertical segments.
8
+ */
9
+ export function routeDataflowEdges(boxes: Float64Array, edges: Float64Array): Float64Array;
3
10
  /**
4
11
  * Log panics to the console before the module traps. A panic aborts, the module must not be used anymore.
5
12
  */
@@ -8,13 +15,6 @@ export function installPanicHook(): void;
8
15
  * The sizes of the dataflow canvas
9
16
  */
10
17
  export function dataflowConfig(): DataflowConfig;
11
- /**
12
- * Route the edges of the dataflow canvas around its boxes (`routing::route_edges`). The boxes are x, y,
13
- * width and height, the edges x and y of the source on the right border of its box and x and y of the target on the
14
- * left border of its box. Returns per edge the number of points of its route, 0 without a route, followed by x and
15
- * y of the points of a polyline of horizontal and vertical segments.
16
- */
17
- export function routeDataflowEdges(boxes: Float64Array, edges: Float64Array): Float64Array;
18
18
  /**
19
19
  * The sizes of the dataflow canvas (`layout::DataflowLayoutConfig`), the one place where they are set
20
20
  */
@@ -48,20 +48,6 @@ function getArrayF64FromWasm0(ptr, len) {
48
48
  ptr = ptr >>> 0;
49
49
  return getFloat64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
50
50
  }
51
- /**
52
- * Log panics to the console before the module traps. A panic aborts, the module must not be used anymore.
53
- */
54
- function installPanicHook() {
55
- wasm.installPanicHook();
56
- }
57
- /**
58
- * The sizes of the dataflow canvas
59
- * @returns {DataflowConfig}
60
- */
61
- function dataflowConfig() {
62
- const ret = wasm.dataflowConfig();
63
- return DataflowConfig.__wrap(ret);
64
- }
65
51
  var WASM_VECTOR_LEN = 0;
66
52
  function passArrayF64ToWasm0(arg, malloc) {
67
53
  const ptr = malloc(arg.length * 8, 8) >>> 0;
@@ -88,6 +74,20 @@ function routeDataflowEdges(boxes, edges) {
88
74
  wasm.__wbindgen_free(ret[0], ret[1] * 8, 8);
89
75
  return v3;
90
76
  }
77
+ /**
78
+ * Log panics to the console before the module traps. A panic aborts, the module must not be used anymore.
79
+ */
80
+ function installPanicHook() {
81
+ wasm.installPanicHook();
82
+ }
83
+ /**
84
+ * The sizes of the dataflow canvas
85
+ * @returns {DataflowConfig}
86
+ */
87
+ function dataflowConfig() {
88
+ const ret = wasm.dataflowConfig();
89
+ return DataflowConfig.__wrap(ret);
90
+ }
91
91
  var DataflowConfigFinalization = typeof FinalizationRegistry === "undefined" ? {
92
92
  register: () => {},
93
93
  unregister: () => {}
@@ -425,7 +425,7 @@ function __wbg_get_imports() {
425
425
  imports.wbg.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
426
426
  throw new Error(getStringFromWasm0(arg0, arg1));
427
427
  };
428
- imports.wbg.__wbg_error_46fe3a6b640182ef = function(arg0, arg1) {
428
+ imports.wbg.__wbg_error_287b1aff95790b64 = function(arg0, arg1) {
429
429
  console.error(getStringFromWasm0(arg0, arg1));
430
430
  };
431
431
  imports.wbg.__wbindgen_init_externref_table = function() {
Binary file
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@akohn/dashql",
3
- "version": "0.0.19-dev.268.g2efe9377d",
3
+ "version": "0.0.19-dev.305.gb0f831a47",
4
4
  "description": "DashQL in TypeScript: the WebAssembly bindings of its SQL core, its runtime and the platforms of the runtime",
5
5
  "type": "module",
6
6
  "license": "MPL-2.0",