@duckdb/duckdb-wasm-shell 1.28.0 → 1.28.1-dev105.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/shell.js CHANGED
@@ -33,7 +33,7 @@
33
33
  // package.json
34
34
  var package_default = {
35
35
  name: "@duckdb/duckdb-wasm-shell",
36
- version: "1.28.0",
36
+ version: "1.28.1-dev105.0",
37
37
  description: "",
38
38
  author: "Andre Kohn <kohn.a@outlook.com>",
39
39
  license: "MIT",
@@ -57,22 +57,22 @@
57
57
  "csv"
58
58
  ],
59
59
  dependencies: {
60
- "@duckdb/duckdb-wasm": "^1.28.0",
61
- xterm: "^5.1.0",
62
- "xterm-addon-fit": "^0.7.0",
60
+ "@duckdb/duckdb-wasm": "^1.28.1-dev105.0",
61
+ xterm: "^5.3.0",
62
+ "xterm-addon-fit": "^0.8.0",
63
63
  "xterm-addon-web-links": "^0.9.0",
64
64
  "xterm-addon-webgl": "^0.16.0"
65
65
  },
66
66
  devDependencies: {
67
- esbuild: "^0.19.5",
68
- eslint: "^8.50.0",
67
+ esbuild: "^0.20.0",
68
+ eslint: "^8.56.0",
69
69
  "eslint-plugin-jasmine": "^4.1.3",
70
70
  "eslint-plugin-react": "^7.33.2",
71
71
  jasmine: "^5.1.0",
72
72
  "jasmine-core": "^5.1.1",
73
73
  "jasmine-spec-reporter": "^7.0.0",
74
74
  "make-dir": "^4.0.0",
75
- prettier: "^3.0.2",
75
+ prettier: "^3.2.4",
76
76
  rimraf: "^5.0.5",
77
77
  "wasm-pack": "^0.12.1"
78
78
  },
@@ -303,11 +303,18 @@
303
303
  return real;
304
304
  }
305
305
  function __wbg_adapter_22(arg0, arg1, arg2) {
306
- const ret = wasm.wasm_bindgen__convert__closures__invoke1_mut__h823dff921dec94a7(arg0, arg1, addHeapObject(arg2));
306
+ const ret = wasm.wasm_bindgen__convert__closures__invoke1_mut__h7e625be7026adc7c(arg0, arg1, addHeapObject(arg2));
307
307
  return ret !== 0;
308
308
  }
309
309
  function __wbg_adapter_25(arg0, arg1, arg2) {
310
- wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__hebc947492fd4d2e2(arg0, arg1, addHeapObject(arg2));
310
+ wasm.wasm_bindgen__convert__closures__invoke1_mut__hc13282646fd8976d(arg0, arg1, addHeapObject(arg2));
311
+ }
312
+ function handleError(f, args) {
313
+ try {
314
+ return f.apply(this, args);
315
+ } catch (e) {
316
+ wasm.__wbindgen_exn_store(addHeapObject(e));
317
+ }
311
318
  }
312
319
  var cachedUint32Memory0 = null;
313
320
  function getUint32Memory0() {
@@ -368,19 +375,16 @@
368
375
  heap[stack_pointer++] = void 0;
369
376
  }
370
377
  }
378
+ function passInitQueries(queries) {
379
+ const ret = wasm.passInitQueries(addHeapObject(queries));
380
+ return takeObject(ret);
381
+ }
371
382
  function configureDatabase(db) {
372
383
  const ret = wasm.configureDatabase(addHeapObject(db));
373
384
  return takeObject(ret);
374
385
  }
375
- function handleError(f, args) {
376
- try {
377
- return f.apply(this, args);
378
- } catch (e) {
379
- wasm.__wbindgen_exn_store(addHeapObject(e));
380
- }
381
- }
382
- function __wbg_adapter_213(arg0, arg1, arg2, arg3) {
383
- wasm.wasm_bindgen__convert__closures__invoke2_mut__hb4a89eef713a072f(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
386
+ function __wbg_adapter_214(arg0, arg1, arg2, arg3) {
387
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h085319ab0941bbff(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
384
388
  }
385
389
  var ShellInputContext = Object.freeze({ FileInput: 0, "0": "FileInput" });
386
390
  var WcWidth = Object.freeze({ Width0: 0, "0": "Width0", Width1: 1, "1": "Width1", Width2: 2, "2": "Width2" });
@@ -510,9 +514,9 @@
510
514
  return addHeapObject(ret);
511
515
  }, arguments);
512
516
  };
513
- imports.wbg.__wbg_copyFileToBuffer_8303548b5434aa38 = function() {
517
+ imports.wbg.__wbg_dropFile_377dfecd7aafe02e = function() {
514
518
  return handleError(function(arg0, arg1, arg2) {
515
- const ret = getObject(arg0).copyFileToBuffer(getStringFromWasm0(arg1, arg2));
519
+ const ret = getObject(arg0).dropFile(getStringFromWasm0(arg1, arg2));
516
520
  return addHeapObject(ret);
517
521
  }, arguments);
518
522
  };
@@ -522,9 +526,9 @@
522
526
  return addHeapObject(ret);
523
527
  }, arguments);
524
528
  };
525
- imports.wbg.__wbg_dropFile_377dfecd7aafe02e = function() {
529
+ imports.wbg.__wbg_copyFileToBuffer_8303548b5434aa38 = function() {
526
530
  return handleError(function(arg0, arg1, arg2) {
527
- const ret = getObject(arg0).dropFile(getStringFromWasm0(arg1, arg2));
531
+ const ret = getObject(arg0).copyFileToBuffer(getStringFromWasm0(arg1, arg2));
528
532
  return addHeapObject(ret);
529
533
  }, arguments);
530
534
  };
@@ -640,41 +644,41 @@
640
644
  imports.wbg.__wbg_fit_cdd1076e3e5970b7 = function(arg0) {
641
645
  getObject(arg0).fit();
642
646
  };
643
- imports.wbg.__wbg_log_8bb2c010ce15af48 = function(arg0, arg1) {
644
- console.log(getStringFromWasm0(arg0, arg1));
645
- };
646
- imports.wbg.__wbg_error_a84695ce32854879 = function(arg0, arg1) {
647
- console.error(getStringFromWasm0(arg0, arg1));
648
- };
649
- imports.wbg.__wbg_warn_d85b304f0e70f5ac = function(arg0, arg1) {
650
- console.warn(getStringFromWasm0(arg0, arg1));
651
- };
652
- imports.wbg.__wbg_backgroundColor_17a9784f0207d5b0 = function(arg0, arg1) {
653
- const ret = getObject(arg1).backgroundColor;
647
+ imports.wbg.__wbindgen_json_serialize = function(arg0, arg1) {
648
+ const obj = getObject(arg1);
649
+ const ret = JSON.stringify(obj === void 0 ? null : obj);
654
650
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
655
651
  const len1 = WASM_VECTOR_LEN;
656
652
  getInt32Memory0()[arg0 / 4 + 1] = len1;
657
653
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
658
654
  };
659
- imports.wbg.__wbg_fontFamily_204223b3338f8381 = function(arg0, arg1) {
660
- const ret = getObject(arg1).fontFamily;
655
+ imports.wbg.__wbg_new_79cc836771d68198 = function() {
656
+ const ret = new import_xterm_addon_fit.FitAddon();
657
+ return addHeapObject(ret);
658
+ };
659
+ imports.wbg.__wbg_static_accessor_PACKAGE_VERSION_549ba11794cf5003 = function(arg0) {
660
+ const ret = import_duckdb_wasm.PACKAGE_VERSION;
661
661
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
662
662
  const len1 = WASM_VECTOR_LEN;
663
663
  getInt32Memory0()[arg0 / 4 + 1] = len1;
664
664
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
665
665
  };
666
- imports.wbg.__wbg_new_79cc836771d68198 = function() {
667
- const ret = new import_xterm_addon_fit.FitAddon();
668
- return addHeapObject(ret);
669
- };
670
- imports.wbg.__wbindgen_json_serialize = function(arg0, arg1) {
671
- const obj = getObject(arg1);
672
- const ret = JSON.stringify(obj === void 0 ? null : obj);
666
+ imports.wbg.__wbg_static_accessor_PACKAGE_NAME_0af717684e189e55 = function(arg0) {
667
+ const ret = import_duckdb_wasm.PACKAGE_NAME;
673
668
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
674
669
  const len1 = WASM_VECTOR_LEN;
675
670
  getInt32Memory0()[arg0 / 4 + 1] = len1;
676
671
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
677
672
  };
673
+ imports.wbg.__wbindgen_cb_drop = function(arg0) {
674
+ const obj = takeObject(arg0).original;
675
+ if (obj.cnt-- == 1) {
676
+ obj.a = 0;
677
+ return true;
678
+ }
679
+ const ret = false;
680
+ return ret;
681
+ };
678
682
  imports.wbg.__wbg_setrows_6b947e6079c486dc = function(arg0, arg1) {
679
683
  getObject(arg0).rows = arg1 >>> 0;
680
684
  };
@@ -684,6 +688,13 @@
684
688
  imports.wbg.__wbg_setcursorWidth_55abde268dea1312 = function(arg0, arg1) {
685
689
  getObject(arg0).cursorWidth = arg1 >>> 0;
686
690
  };
691
+ imports.wbg.__wbg_fontFamily_204223b3338f8381 = function(arg0, arg1) {
692
+ const ret = getObject(arg1).fontFamily;
693
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
694
+ const len1 = WASM_VECTOR_LEN;
695
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
696
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
697
+ };
687
698
  imports.wbg.__wbg_setfontFamily_a0645fa4f7aaaf21 = function(arg0, arg1, arg2) {
688
699
  getObject(arg0).fontFamily = getStringFromWasm0(arg1, arg2);
689
700
  };
@@ -705,6 +716,13 @@
705
716
  imports.wbg.__wbg_setforeground_87dc40b78955df05 = function(arg0, arg1, arg2) {
706
717
  getObject(arg0).foreground = getStringFromWasm0(arg1, arg2);
707
718
  };
719
+ imports.wbg.__wbg_backgroundColor_17a9784f0207d5b0 = function(arg0, arg1) {
720
+ const ret = getObject(arg1).backgroundColor;
721
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
722
+ const len1 = WASM_VECTOR_LEN;
723
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
724
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
725
+ };
708
726
  imports.wbg.__wbg_setbackground_550386b829ec5c24 = function(arg0, arg1, arg2) {
709
727
  getObject(arg0).background = getStringFromWasm0(arg1, arg2);
710
728
  };
@@ -745,6 +763,21 @@
745
763
  const ret = result;
746
764
  return ret;
747
765
  };
766
+ imports.wbg.__wbg_disconnect_d9855433758f0afc = function() {
767
+ return handleError(function(arg0, arg1) {
768
+ const ret = getObject(arg0).disconnect(arg1 >>> 0);
769
+ return addHeapObject(ret);
770
+ }, arguments);
771
+ };
772
+ imports.wbg.__wbg_log_8bb2c010ce15af48 = function(arg0, arg1) {
773
+ console.log(getStringFromWasm0(arg0, arg1));
774
+ };
775
+ imports.wbg.__wbg_error_a84695ce32854879 = function(arg0, arg1) {
776
+ console.error(getStringFromWasm0(arg0, arg1));
777
+ };
778
+ imports.wbg.__wbg_warn_d85b304f0e70f5ac = function(arg0, arg1) {
779
+ console.warn(getStringFromWasm0(arg0, arg1));
780
+ };
748
781
  imports.wbg.__wbg_blockStats_14f17a14c4573f3d = function(arg0) {
749
782
  const ret = getObject(arg0).blockStats;
750
783
  return addHeapObject(ret);
@@ -777,35 +810,6 @@
777
810
  const ret = getObject(arg0).blockSize;
778
811
  return addHeapObject(ret);
779
812
  };
780
- imports.wbg.__wbg_static_accessor_PACKAGE_VERSION_549ba11794cf5003 = function(arg0) {
781
- const ret = import_duckdb_wasm.PACKAGE_VERSION;
782
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
783
- const len1 = WASM_VECTOR_LEN;
784
- getInt32Memory0()[arg0 / 4 + 1] = len1;
785
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
786
- };
787
- imports.wbg.__wbg_static_accessor_PACKAGE_NAME_0af717684e189e55 = function(arg0) {
788
- const ret = import_duckdb_wasm.PACKAGE_NAME;
789
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
790
- const len1 = WASM_VECTOR_LEN;
791
- getInt32Memory0()[arg0 / 4 + 1] = len1;
792
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
793
- };
794
- imports.wbg.__wbg_disconnect_d9855433758f0afc = function() {
795
- return handleError(function(arg0, arg1) {
796
- const ret = getObject(arg0).disconnect(arg1 >>> 0);
797
- return addHeapObject(ret);
798
- }, arguments);
799
- };
800
- imports.wbg.__wbindgen_cb_drop = function(arg0) {
801
- const obj = takeObject(arg0).original;
802
- if (obj.cnt-- == 1) {
803
- obj.a = 0;
804
- return true;
805
- }
806
- const ret = false;
807
- return ret;
808
- };
809
813
  imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
810
814
  const ret = new Error();
811
815
  return addHeapObject(ret);
@@ -842,6 +846,17 @@
842
846
  const ret = getObject(arg0).performance;
843
847
  return isLikeNone(ret) ? 0 : addHeapObject(ret);
844
848
  };
849
+ imports.wbg.__wbg_type_4197dff653b7d208 = function(arg0, arg1) {
850
+ const ret = getObject(arg1).type;
851
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
852
+ const len1 = WASM_VECTOR_LEN;
853
+ getInt32Memory0()[arg0 / 4 + 1] = len1;
854
+ getInt32Memory0()[arg0 / 4 + 0] = ptr1;
855
+ };
856
+ imports.wbg.__wbg_now_0cfdc90c97d0c24b = function(arg0) {
857
+ const ret = getObject(arg0).now();
858
+ return ret;
859
+ };
845
860
  imports.wbg.__wbg_ctrlKey_582686fb2263dd3c = function(arg0) {
846
861
  const ret = getObject(arg0).ctrlKey;
847
862
  return ret;
@@ -857,17 +872,6 @@
857
872
  getInt32Memory0()[arg0 / 4 + 1] = len1;
858
873
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
859
874
  };
860
- imports.wbg.__wbg_type_4197dff653b7d208 = function(arg0, arg1) {
861
- const ret = getObject(arg1).type;
862
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
863
- const len1 = WASM_VECTOR_LEN;
864
- getInt32Memory0()[arg0 / 4 + 1] = len1;
865
- getInt32Memory0()[arg0 / 4 + 0] = ptr1;
866
- };
867
- imports.wbg.__wbg_now_0cfdc90c97d0c24b = function(arg0) {
868
- const ret = getObject(arg0).now();
869
- return ret;
870
- };
871
875
  imports.wbg.__wbg_get_44be0491f933a435 = function(arg0, arg1) {
872
876
  const ret = getObject(arg0)[arg1 >>> 0];
873
877
  return addHeapObject(ret);
@@ -951,7 +955,7 @@
951
955
  const a = state0.a;
952
956
  state0.a = 0;
953
957
  try {
954
- return __wbg_adapter_213(a, state0.b, arg02, arg12);
958
+ return __wbg_adapter_214(a, state0.b, arg02, arg12);
955
959
  } finally {
956
960
  state0.a = a;
957
961
  }
@@ -1003,12 +1007,12 @@
1003
1007
  const ret = wasm.memory;
1004
1008
  return addHeapObject(ret);
1005
1009
  };
1006
- imports.wbg.__wbindgen_closure_wrapper633 = function(arg0, arg1, arg2) {
1007
- const ret = makeMutClosure(arg0, arg1, 131, __wbg_adapter_22);
1010
+ imports.wbg.__wbindgen_closure_wrapper369 = function(arg0, arg1, arg2) {
1011
+ const ret = makeMutClosure(arg0, arg1, 119, __wbg_adapter_22);
1008
1012
  return addHeapObject(ret);
1009
1013
  };
1010
- imports.wbg.__wbindgen_closure_wrapper956 = function(arg0, arg1, arg2) {
1011
- const ret = makeMutClosure(arg0, arg1, 150, __wbg_adapter_25);
1014
+ imports.wbg.__wbindgen_closure_wrapper967 = function(arg0, arg1, arg2) {
1015
+ const ret = makeMutClosure(arg0, arg1, 202, __wbg_adapter_25);
1012
1016
  return addHeapObject(ret);
1013
1017
  };
1014
1018
  return imports;
@@ -1230,6 +1234,7 @@
1230
1234
  const rect = container.getBoundingClientRect();
1231
1235
  resize(rect.width, rect.height);
1232
1236
  };
1237
+ this.hash = "";
1233
1238
  }
1234
1239
  async pickFiles() {
1235
1240
  if (this.database == null) {
@@ -1252,6 +1257,16 @@
1252
1257
  return await navigator.clipboard.writeText(value);
1253
1258
  }
1254
1259
  async pushInputToHistory(value) {
1260
+ const encode = encodeURIComponent(extraswaps(value));
1261
+ if (this.hash === "")
1262
+ this.hash = "queries=v0";
1263
+ this.hash += ",";
1264
+ this.hash += encode;
1265
+ if (window.location.hash.startsWith("#savequeries"))
1266
+ window.location.hash = "savequeries&" + this.hash;
1267
+ const a = document.getElementById("hashencoded");
1268
+ if (a && a instanceof HTMLAnchorElement)
1269
+ a.href = "/#" + this.hash;
1255
1270
  this.history.push(value);
1256
1271
  }
1257
1272
  };
@@ -1261,6 +1276,22 @@
1261
1276
  const size = Number((value / Math.pow(multiple, exp)).toFixed(2));
1262
1277
  return "".concat(size, " ").concat(exp ? "".concat(k, "MGTPEZY")[exp - 1] + suffix : "byte".concat(size !== 1 ? "s" : ""));
1263
1278
  }
1279
+ function extraswaps(input) {
1280
+ let res = "";
1281
+ for (let i = 0; i < input.length; i++) {
1282
+ if (input[i] == " ")
1283
+ res += "-";
1284
+ else if (input[i] == "-")
1285
+ res += " ";
1286
+ else if (input[i] == ";")
1287
+ res += "~";
1288
+ else if (input[i] == "~")
1289
+ res += ";";
1290
+ else
1291
+ res += input[i];
1292
+ }
1293
+ return res;
1294
+ }
1264
1295
  async function embed2(props) {
1265
1296
  var _a, _b;
1266
1297
  await shell_default(props.shellModule);
@@ -1299,6 +1330,15 @@
1299
1330
  await step("Attaching Shell", async () => {
1300
1331
  configureDatabase(runtime.database);
1301
1332
  });
1333
+ const hash = window.location.hash;
1334
+ const splits = hash.split(",");
1335
+ const sqls = [];
1336
+ for (let i = 1; i < splits.length; i++) {
1337
+ sqls.push(extraswaps(decodeURIComponent(splits[i])));
1338
+ }
1339
+ await step("Rewinding history!", async () => {
1340
+ passInitQueries(sqls);
1341
+ });
1302
1342
  }
1303
1343
 
1304
1344
  // src/platform.ts