@taladb/web 0.10.0 → 0.10.2
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/LICENSE +1 -1
- package/README.md +2 -2
- package/package.json +4 -4
- package/pkg/README.md +2 -2
- package/pkg/package.json +7 -2
- package/pkg/taladb_web.d.ts +57 -49
- package/pkg/taladb_web.js +37 -130
- package/pkg/taladb_web_bg.wasm +0 -0
- package/pkg/taladb_web_bg.wasm.d.ts +48 -49
- package/worker/taladb.worker.js +111 -36
package/LICENSE
CHANGED
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
same "printed page" as the copyright notice for easier
|
|
188
188
|
identification within third-party archives.
|
|
189
189
|
|
|
190
|
-
Copyright 2025-2026
|
|
190
|
+
Copyright 2025-2026 taladb
|
|
191
191
|
|
|
192
192
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
193
|
you may not use this file except in compliance with the License.
|
package/README.md
CHANGED
|
@@ -86,8 +86,8 @@ pnpm --filter @taladb/web build
|
|
|
86
86
|
|
|
87
87
|
## Full Documentation
|
|
88
88
|
|
|
89
|
-
**[https://
|
|
89
|
+
**[https://taladb.github.io/taladb/guide/web](https://taladb.github.io/taladb/guide/web)**
|
|
90
90
|
|
|
91
91
|
## License
|
|
92
92
|
|
|
93
|
-
Apache 2.0 © [
|
|
93
|
+
Apache 2.0 © [TalaDB](https://github.com/taladb)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taladb/web",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.2",
|
|
4
4
|
"description": "TalaDB WASM bindings — document queries and vector search in the browser",
|
|
5
5
|
"main": "pkg/taladb_web.js",
|
|
6
6
|
"types": "pkg/taladb_web.d.ts",
|
|
@@ -18,12 +18,12 @@
|
|
|
18
18
|
],
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
21
|
-
"url": "https://github.com/
|
|
21
|
+
"url": "https://github.com/taladb/taladb.git",
|
|
22
22
|
"directory": "packages/bindings/web"
|
|
23
23
|
},
|
|
24
|
-
"homepage": "https://
|
|
24
|
+
"homepage": "https://taladb.github.io/taladb/guide/web",
|
|
25
25
|
"bugs": {
|
|
26
|
-
"url": "https://github.com/
|
|
26
|
+
"url": "https://github.com/taladb/taladb/issues"
|
|
27
27
|
},
|
|
28
28
|
"engines": {
|
|
29
29
|
"node": ">=18"
|
package/pkg/README.md
CHANGED
|
@@ -86,8 +86,8 @@ pnpm --filter @taladb/web build
|
|
|
86
86
|
|
|
87
87
|
## Full Documentation
|
|
88
88
|
|
|
89
|
-
**[https://
|
|
89
|
+
**[https://taladb.github.io/taladb/guide/web](https://taladb.github.io/taladb/guide/web)**
|
|
90
90
|
|
|
91
91
|
## License
|
|
92
92
|
|
|
93
|
-
Apache 2.0 © [
|
|
93
|
+
Apache 2.0 © [TalaDB](https://github.com/taladb)
|
package/pkg/package.json
CHANGED
|
@@ -2,17 +2,22 @@
|
|
|
2
2
|
"name": "taladb-web",
|
|
3
3
|
"type": "module",
|
|
4
4
|
"collaborators": [
|
|
5
|
-
"
|
|
5
|
+
"taladb"
|
|
6
6
|
],
|
|
7
7
|
"description": "TalaDB browser WASM bindings (wasm-bindgen + OPFS) and Cloudflare Workers",
|
|
8
|
-
"version": "0.10.
|
|
8
|
+
"version": "0.10.2",
|
|
9
9
|
"license": "Apache-2.0",
|
|
10
|
+
"repository": {
|
|
11
|
+
"type": "git",
|
|
12
|
+
"url": "https://github.com/taladb/taladb"
|
|
13
|
+
},
|
|
10
14
|
"files": [
|
|
11
15
|
"taladb_web_bg.wasm",
|
|
12
16
|
"taladb_web.js",
|
|
13
17
|
"taladb_web.d.ts"
|
|
14
18
|
],
|
|
15
19
|
"main": "taladb_web.js",
|
|
20
|
+
"homepage": "https://github.com/taladb/taladb",
|
|
16
21
|
"types": "taladb_web.d.ts",
|
|
17
22
|
"sideEffects": [
|
|
18
23
|
"./snippets/*"
|
package/pkg/taladb_web.d.ts
CHANGED
|
@@ -457,6 +457,15 @@ export class WorkerDB {
|
|
|
457
457
|
* the `openDB({ migrations })` runner, which advances it per migration.
|
|
458
458
|
*/
|
|
459
459
|
userVersion(): number;
|
|
460
|
+
/**
|
|
461
|
+
* This collection's write generation — a counter bumped once per committed
|
|
462
|
+
* mutation.
|
|
463
|
+
*
|
|
464
|
+
* Backs `subscribe()`: a live query can compare one integer per tick
|
|
465
|
+
* instead of re-running the query and `JSON.stringify`-ing the whole
|
|
466
|
+
* result set to see whether anything moved.
|
|
467
|
+
*/
|
|
468
|
+
writeGeneration(collection: string): number;
|
|
460
469
|
}
|
|
461
470
|
|
|
462
471
|
/**
|
|
@@ -512,7 +521,49 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
512
521
|
|
|
513
522
|
export interface InitOutput {
|
|
514
523
|
readonly memory: WebAssembly.Memory;
|
|
524
|
+
readonly __wbg_collectionwasm_free: (a: number, b: number) => void;
|
|
525
|
+
readonly __wbg_taladbwasm_free: (a: number, b: number) => void;
|
|
515
526
|
readonly __wbg_workerdb_free: (a: number, b: number) => void;
|
|
527
|
+
readonly collectionwasm_aggregate: (a: number, b: any) => [number, number, number];
|
|
528
|
+
readonly collectionwasm_count: (a: number, b: any) => [number, number, number];
|
|
529
|
+
readonly collectionwasm_createCompoundIndex: (a: number, b: number, c: number) => [number, number];
|
|
530
|
+
readonly collectionwasm_createFtsIndex: (a: number, b: number, c: number) => [number, number];
|
|
531
|
+
readonly collectionwasm_createIndex: (a: number, b: number, c: number) => [number, number];
|
|
532
|
+
readonly collectionwasm_createVectorIndex: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number];
|
|
533
|
+
readonly collectionwasm_deleteMany: (a: number, b: any) => [number, number, number];
|
|
534
|
+
readonly collectionwasm_deleteManyWithIds: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
535
|
+
readonly collectionwasm_deleteOne: (a: number, b: any) => [number, number, number];
|
|
536
|
+
readonly collectionwasm_dropCompoundIndex: (a: number, b: number, c: number) => [number, number];
|
|
537
|
+
readonly collectionwasm_dropFtsIndex: (a: number, b: number, c: number) => [number, number];
|
|
538
|
+
readonly collectionwasm_dropIndex: (a: number, b: number, c: number) => [number, number];
|
|
539
|
+
readonly collectionwasm_dropVectorIndex: (a: number, b: number, c: number) => [number, number];
|
|
540
|
+
readonly collectionwasm_find: (a: number, b: any) => [number, number, number];
|
|
541
|
+
readonly collectionwasm_findNearest: (a: number, b: number, c: number, d: number, e: number, f: number, g: any) => [number, number, number];
|
|
542
|
+
readonly collectionwasm_findOne: (a: number, b: any) => [number, number, number];
|
|
543
|
+
readonly collectionwasm_hybridSearch: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: any, l: any) => [number, number, number];
|
|
544
|
+
readonly collectionwasm_insert: (a: number, b: any) => [number, number, number, number];
|
|
545
|
+
readonly collectionwasm_insertMany: (a: number, b: any) => [number, number, number];
|
|
546
|
+
readonly collectionwasm_replaceManyWithIds: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
547
|
+
readonly collectionwasm_searchText: (a: number, b: number, c: number, d: number, e: number, f: number, g: any, h: any) => [number, number, number];
|
|
548
|
+
readonly collectionwasm_updateMany: (a: number, b: any, c: any) => [number, number, number];
|
|
549
|
+
readonly collectionwasm_updateOne: (a: number, b: any, c: any) => [number, number, number];
|
|
550
|
+
readonly collectionwasm_upgradeVectorIndex: (a: number, b: number, c: number) => [number, number];
|
|
551
|
+
readonly idb_load_snapshot: (a: number, b: number) => any;
|
|
552
|
+
readonly idb_save_snapshot: (a: number, b: number, c: number, d: number) => any;
|
|
553
|
+
readonly is_opfs_available: () => any;
|
|
554
|
+
readonly opfs_delete_snapshot: (a: number, b: number) => any;
|
|
555
|
+
readonly opfs_flush_snapshot: (a: number, b: number, c: number, d: number) => any;
|
|
556
|
+
readonly opfs_load_snapshot: (a: number, b: number) => any;
|
|
557
|
+
readonly opfs_open_backend: (a: number, b: number) => any;
|
|
558
|
+
readonly taladbwasm_collection: (a: number, b: number, c: number) => [number, number, number];
|
|
559
|
+
readonly taladbwasm_exportChanges: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
560
|
+
readonly taladbwasm_exportSnapshot: (a: number) => [number, number, number, number];
|
|
561
|
+
readonly taladbwasm_importChanges: (a: number, b: number, c: number) => [number, number, number];
|
|
562
|
+
readonly taladbwasm_listCollectionNames: (a: number) => [number, number, number, number];
|
|
563
|
+
readonly taladbwasm_openInMemory: () => [number, number, number];
|
|
564
|
+
readonly taladbwasm_openWithSnapshot: (a: number, b: number) => [number, number, number];
|
|
565
|
+
readonly taladbwasm_setUserVersion: (a: number, b: number) => [number, number];
|
|
566
|
+
readonly taladbwasm_userVersion: (a: number) => [number, number, number];
|
|
516
567
|
readonly workerdb_aggregate: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
517
568
|
readonly workerdb_compact: (a: number) => [number, number];
|
|
518
569
|
readonly workerdb_compactTombstones: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
@@ -557,56 +608,13 @@ export interface InitOutput {
|
|
|
557
608
|
readonly workerdb_updateOne: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
|
|
558
609
|
readonly workerdb_upgradeVectorIndex: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
559
610
|
readonly workerdb_userVersion: (a: number) => [number, number, number];
|
|
560
|
-
readonly
|
|
561
|
-
readonly __wbg_taladbwasm_free: (a: number, b: number) => void;
|
|
562
|
-
readonly collectionwasm_aggregate: (a: number, b: any) => [number, number, number];
|
|
563
|
-
readonly collectionwasm_count: (a: number, b: any) => [number, number, number];
|
|
564
|
-
readonly collectionwasm_createCompoundIndex: (a: number, b: number, c: number) => [number, number];
|
|
565
|
-
readonly collectionwasm_createFtsIndex: (a: number, b: number, c: number) => [number, number];
|
|
566
|
-
readonly collectionwasm_createIndex: (a: number, b: number, c: number) => [number, number];
|
|
567
|
-
readonly collectionwasm_createVectorIndex: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number];
|
|
568
|
-
readonly collectionwasm_deleteMany: (a: number, b: any) => [number, number, number];
|
|
569
|
-
readonly collectionwasm_deleteManyWithIds: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
570
|
-
readonly collectionwasm_deleteOne: (a: number, b: any) => [number, number, number];
|
|
571
|
-
readonly collectionwasm_dropCompoundIndex: (a: number, b: number, c: number) => [number, number];
|
|
572
|
-
readonly collectionwasm_dropFtsIndex: (a: number, b: number, c: number) => [number, number];
|
|
573
|
-
readonly collectionwasm_dropIndex: (a: number, b: number, c: number) => [number, number];
|
|
574
|
-
readonly collectionwasm_dropVectorIndex: (a: number, b: number, c: number) => [number, number];
|
|
575
|
-
readonly collectionwasm_find: (a: number, b: any) => [number, number, number];
|
|
576
|
-
readonly collectionwasm_findNearest: (a: number, b: number, c: number, d: number, e: number, f: number, g: any) => [number, number, number];
|
|
577
|
-
readonly collectionwasm_findOne: (a: number, b: any) => [number, number, number];
|
|
578
|
-
readonly collectionwasm_hybridSearch: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: any, l: any) => [number, number, number];
|
|
579
|
-
readonly collectionwasm_insert: (a: number, b: any) => [number, number, number, number];
|
|
580
|
-
readonly collectionwasm_insertMany: (a: number, b: any) => [number, number, number];
|
|
581
|
-
readonly collectionwasm_replaceManyWithIds: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
582
|
-
readonly collectionwasm_searchText: (a: number, b: number, c: number, d: number, e: number, f: number, g: any, h: any) => [number, number, number];
|
|
583
|
-
readonly collectionwasm_updateMany: (a: number, b: any, c: any) => [number, number, number];
|
|
584
|
-
readonly collectionwasm_updateOne: (a: number, b: any, c: any) => [number, number, number];
|
|
585
|
-
readonly collectionwasm_upgradeVectorIndex: (a: number, b: number, c: number) => [number, number];
|
|
586
|
-
readonly taladbwasm_collection: (a: number, b: number, c: number) => [number, number, number];
|
|
587
|
-
readonly taladbwasm_exportChanges: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
588
|
-
readonly taladbwasm_exportSnapshot: (a: number) => [number, number, number, number];
|
|
589
|
-
readonly taladbwasm_importChanges: (a: number, b: number, c: number) => [number, number, number];
|
|
590
|
-
readonly taladbwasm_listCollectionNames: (a: number) => [number, number, number, number];
|
|
591
|
-
readonly taladbwasm_openInMemory: () => [number, number, number];
|
|
592
|
-
readonly taladbwasm_openWithSnapshot: (a: number, b: number) => [number, number, number];
|
|
593
|
-
readonly taladbwasm_setUserVersion: (a: number, b: number) => [number, number];
|
|
594
|
-
readonly taladbwasm_userVersion: (a: number) => [number, number, number];
|
|
611
|
+
readonly workerdb_writeGeneration: (a: number, b: number, c: number) => [number, number, number];
|
|
595
612
|
readonly init: () => void;
|
|
596
|
-
readonly
|
|
597
|
-
readonly
|
|
598
|
-
readonly
|
|
599
|
-
readonly
|
|
600
|
-
readonly
|
|
601
|
-
readonly idb_save_snapshot: (a: number, b: number, c: number, d: number) => any;
|
|
602
|
-
readonly opfs_open_backend: (a: number, b: number) => any;
|
|
603
|
-
readonly wasm_bindgen_4501a39796791c69___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut__wasm_bindgen_4501a39796791c69___JsValue____Output_______: (a: number, b: number) => void;
|
|
604
|
-
readonly wasm_bindgen_4501a39796791c69___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut_____Output_______: (a: number, b: number) => void;
|
|
605
|
-
readonly wasm_bindgen_4501a39796791c69___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut__wasm_bindgen_4501a39796791c69___JsValue____Output___core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_4501a39796791c69___JsError___: (a: number, b: number) => void;
|
|
606
|
-
readonly wasm_bindgen_4501a39796791c69___convert__closures_____invoke___wasm_bindgen_4501a39796791c69___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_4501a39796791c69___JsError___true_: (a: number, b: number, c: any) => [number, number];
|
|
607
|
-
readonly wasm_bindgen_4501a39796791c69___convert__closures_____invoke___js_sys_d1fdfe5cb3da44fc___Function_fn_wasm_bindgen_4501a39796791c69___JsValue_____wasm_bindgen_4501a39796791c69___sys__Undefined___js_sys_d1fdfe5cb3da44fc___Function_fn_wasm_bindgen_4501a39796791c69___JsValue_____wasm_bindgen_4501a39796791c69___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
|
|
608
|
-
readonly wasm_bindgen_4501a39796791c69___convert__closures_____invoke___wasm_bindgen_4501a39796791c69___JsValue______true_: (a: number, b: number, c: any) => void;
|
|
609
|
-
readonly wasm_bindgen_4501a39796791c69___convert__closures_____invoke_______true_: (a: number, b: number) => void;
|
|
613
|
+
readonly wasm_bindgen_188fd7264b65779d___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut__wasm_bindgen_188fd7264b65779d___JsValue____Output___core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_188fd7264b65779d___JsError___: (a: number, b: number) => void;
|
|
614
|
+
readonly wasm_bindgen_188fd7264b65779d___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut__wasm_bindgen_188fd7264b65779d___JsValue____Output_______: (a: number, b: number) => void;
|
|
615
|
+
readonly wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___wasm_bindgen_188fd7264b65779d___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_188fd7264b65779d___JsError___true_: (a: number, b: number, c: any) => [number, number];
|
|
616
|
+
readonly wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___js_sys_6ed69cd23706a2fe___Function_fn_wasm_bindgen_188fd7264b65779d___JsValue_____wasm_bindgen_188fd7264b65779d___sys__Undefined___js_sys_6ed69cd23706a2fe___Function_fn_wasm_bindgen_188fd7264b65779d___JsValue_____wasm_bindgen_188fd7264b65779d___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
|
|
617
|
+
readonly wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___wasm_bindgen_188fd7264b65779d___JsValue______true_: (a: number, b: number, c: any) => void;
|
|
610
618
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
611
619
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
612
620
|
readonly __wbindgen_exn_store: (a: number) => void;
|
package/pkg/taladb_web.js
CHANGED
|
@@ -1531,6 +1531,25 @@ export class WorkerDB {
|
|
|
1531
1531
|
}
|
|
1532
1532
|
return ret[0] >>> 0;
|
|
1533
1533
|
}
|
|
1534
|
+
/**
|
|
1535
|
+
* This collection's write generation — a counter bumped once per committed
|
|
1536
|
+
* mutation.
|
|
1537
|
+
*
|
|
1538
|
+
* Backs `subscribe()`: a live query can compare one integer per tick
|
|
1539
|
+
* instead of re-running the query and `JSON.stringify`-ing the whole
|
|
1540
|
+
* result set to see whether anything moved.
|
|
1541
|
+
* @param {string} collection
|
|
1542
|
+
* @returns {number}
|
|
1543
|
+
*/
|
|
1544
|
+
writeGeneration(collection) {
|
|
1545
|
+
const ptr0 = passStringToWasm0(collection, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
1546
|
+
const len0 = WASM_VECTOR_LEN;
|
|
1547
|
+
const ret = wasm.workerdb_writeGeneration(this.__wbg_ptr, ptr0, len0);
|
|
1548
|
+
if (ret[2]) {
|
|
1549
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
1550
|
+
}
|
|
1551
|
+
return ret[0];
|
|
1552
|
+
}
|
|
1534
1553
|
}
|
|
1535
1554
|
if (Symbol.dispose) WorkerDB.prototype[Symbol.dispose] = WorkerDB.prototype.free;
|
|
1536
1555
|
|
|
@@ -1726,15 +1745,6 @@ function __wbg_get_imports() {
|
|
|
1726
1745
|
__wbg__wbg_cb_unref_6b5b6b8576d35cb1: function(arg0) {
|
|
1727
1746
|
arg0._wbg_cb_unref();
|
|
1728
1747
|
},
|
|
1729
|
-
__wbg_abort_5ef96933660780b7: function(arg0) {
|
|
1730
|
-
arg0.abort();
|
|
1731
|
-
},
|
|
1732
|
-
__wbg_abort_6479c2d794ebf2ee: function(arg0, arg1) {
|
|
1733
|
-
arg0.abort(arg1);
|
|
1734
|
-
},
|
|
1735
|
-
__wbg_append_608dfb635ee8998f: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
1736
|
-
arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4));
|
|
1737
|
-
}, arguments); },
|
|
1738
1748
|
__wbg_apply_ac9afb97ca32f169: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1739
1749
|
const ret = arg0.apply(arg1, arg2);
|
|
1740
1750
|
return ret;
|
|
@@ -1759,10 +1769,6 @@ function __wbg_get_imports() {
|
|
|
1759
1769
|
const ret = arg0.call(arg1);
|
|
1760
1770
|
return ret;
|
|
1761
1771
|
}, arguments); },
|
|
1762
|
-
__wbg_clearTimeout_6b8d9a38b9263d65: function(arg0) {
|
|
1763
|
-
const ret = clearTimeout(arg0);
|
|
1764
|
-
return ret;
|
|
1765
|
-
},
|
|
1766
1772
|
__wbg_close_8b24f0978d9a4917: function(arg0) {
|
|
1767
1773
|
const ret = arg0.close();
|
|
1768
1774
|
return ret;
|
|
@@ -1794,14 +1800,6 @@ function __wbg_get_imports() {
|
|
|
1794
1800
|
wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
|
|
1795
1801
|
}
|
|
1796
1802
|
},
|
|
1797
|
-
__wbg_fetch_5550a88cf343aaa9: function(arg0, arg1) {
|
|
1798
|
-
const ret = arg0.fetch(arg1);
|
|
1799
|
-
return ret;
|
|
1800
|
-
},
|
|
1801
|
-
__wbg_fetch_9dad4fe911207b37: function(arg0) {
|
|
1802
|
-
const ret = fetch(arg0);
|
|
1803
|
-
return ret;
|
|
1804
|
-
},
|
|
1805
1803
|
__wbg_flush_1eca046e0ff7c399: function() { return handleError(function (arg0) {
|
|
1806
1804
|
arg0.flush();
|
|
1807
1805
|
}, arguments); },
|
|
@@ -1847,14 +1845,6 @@ function __wbg_get_imports() {
|
|
|
1847
1845
|
const ret = arg0[arg1 >>> 0];
|
|
1848
1846
|
return ret;
|
|
1849
1847
|
},
|
|
1850
|
-
__wbg_has_926ef2ff40b308cf: function() { return handleError(function (arg0, arg1) {
|
|
1851
|
-
const ret = Reflect.has(arg0, arg1);
|
|
1852
|
-
return ret;
|
|
1853
|
-
}, arguments); },
|
|
1854
|
-
__wbg_headers_eb2234545f9ff993: function(arg0) {
|
|
1855
|
-
const ret = arg0.headers;
|
|
1856
|
-
return ret;
|
|
1857
|
-
},
|
|
1858
1848
|
__wbg_instanceof_ArrayBuffer_101e2bf31071a9f6: function(arg0) {
|
|
1859
1849
|
let result;
|
|
1860
1850
|
try {
|
|
@@ -1935,16 +1925,6 @@ function __wbg_get_imports() {
|
|
|
1935
1925
|
const ret = result;
|
|
1936
1926
|
return ret;
|
|
1937
1927
|
},
|
|
1938
|
-
__wbg_instanceof_Response_9b4d9fd451e051b1: function(arg0) {
|
|
1939
|
-
let result;
|
|
1940
|
-
try {
|
|
1941
|
-
result = arg0 instanceof Response;
|
|
1942
|
-
} catch (_) {
|
|
1943
|
-
result = false;
|
|
1944
|
-
}
|
|
1945
|
-
const ret = result;
|
|
1946
|
-
return ret;
|
|
1947
|
-
},
|
|
1948
1928
|
__wbg_instanceof_Uint8Array_740438561a5b956d: function(arg0) {
|
|
1949
1929
|
let result;
|
|
1950
1930
|
try {
|
|
@@ -1993,10 +1973,6 @@ function __wbg_get_imports() {
|
|
|
1993
1973
|
const ret = arg0.navigator;
|
|
1994
1974
|
return ret;
|
|
1995
1975
|
},
|
|
1996
|
-
__wbg_new_0837727332ac86ba: function() { return handleError(function () {
|
|
1997
|
-
const ret = new Headers();
|
|
1998
|
-
return ret;
|
|
1999
|
-
}, arguments); },
|
|
2000
1976
|
__wbg_new_227d7c05414eb861: function() {
|
|
2001
1977
|
const ret = new Error();
|
|
2002
1978
|
return ret;
|
|
@@ -2017,10 +1993,6 @@ function __wbg_get_imports() {
|
|
|
2017
1993
|
const ret = new Object();
|
|
2018
1994
|
return ret;
|
|
2019
1995
|
},
|
|
2020
|
-
__wbg_new_c518c60af666645b: function() { return handleError(function () {
|
|
2021
|
-
const ret = new AbortController();
|
|
2022
|
-
return ret;
|
|
2023
|
-
}, arguments); },
|
|
2024
1996
|
__wbg_new_d098e265629cd10f: function(arg0, arg1) {
|
|
2025
1997
|
try {
|
|
2026
1998
|
var state0 = {a: arg0, b: arg1};
|
|
@@ -2028,7 +2000,7 @@ function __wbg_get_imports() {
|
|
|
2028
2000
|
const a = state0.a;
|
|
2029
2001
|
state0.a = 0;
|
|
2030
2002
|
try {
|
|
2031
|
-
return
|
|
2003
|
+
return wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___js_sys_6ed69cd23706a2fe___Function_fn_wasm_bindgen_188fd7264b65779d___JsValue_____wasm_bindgen_188fd7264b65779d___sys__Undefined___js_sys_6ed69cd23706a2fe___Function_fn_wasm_bindgen_188fd7264b65779d___JsValue_____wasm_bindgen_188fd7264b65779d___sys__Undefined_______true_(a, state0.b, arg0, arg1);
|
|
2032
2004
|
} finally {
|
|
2033
2005
|
state0.a = a;
|
|
2034
2006
|
}
|
|
@@ -2050,7 +2022,7 @@ function __wbg_get_imports() {
|
|
|
2050
2022
|
const a = state0.a;
|
|
2051
2023
|
state0.a = 0;
|
|
2052
2024
|
try {
|
|
2053
|
-
return
|
|
2025
|
+
return wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___js_sys_6ed69cd23706a2fe___Function_fn_wasm_bindgen_188fd7264b65779d___JsValue_____wasm_bindgen_188fd7264b65779d___sys__Undefined___js_sys_6ed69cd23706a2fe___Function_fn_wasm_bindgen_188fd7264b65779d___JsValue_____wasm_bindgen_188fd7264b65779d___sys__Undefined_______true_(a, state0.b, arg0, arg1);
|
|
2054
2026
|
} finally {
|
|
2055
2027
|
state0.a = a;
|
|
2056
2028
|
}
|
|
@@ -2065,10 +2037,6 @@ function __wbg_get_imports() {
|
|
|
2065
2037
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
2066
2038
|
return ret;
|
|
2067
2039
|
},
|
|
2068
|
-
__wbg_new_with_str_and_init_b4b54d1a819bc724: function() { return handleError(function (arg0, arg1, arg2) {
|
|
2069
|
-
const ret = new Request(getStringFromWasm0(arg0, arg1), arg2);
|
|
2070
|
-
return ret;
|
|
2071
|
-
}, arguments); },
|
|
2072
2040
|
__wbg_next_11b99ee6237339e3: function() { return handleError(function (arg0) {
|
|
2073
2041
|
const ret = arg0.next();
|
|
2074
2042
|
return ret;
|
|
@@ -2122,10 +2090,6 @@ function __wbg_get_imports() {
|
|
|
2122
2090
|
const ret = Promise.resolve(arg0);
|
|
2123
2091
|
return ret;
|
|
2124
2092
|
},
|
|
2125
|
-
__wbg_setTimeout_f757f00851f76c42: function(arg0, arg1) {
|
|
2126
|
-
const ret = setTimeout(arg0, arg1);
|
|
2127
|
-
return ret;
|
|
2128
|
-
},
|
|
2129
2093
|
__wbg_set_282384002438957f: function(arg0, arg1, arg2) {
|
|
2130
2094
|
arg0[arg1 >>> 0] = arg2;
|
|
2131
2095
|
},
|
|
@@ -2140,34 +2104,9 @@ function __wbg_get_imports() {
|
|
|
2140
2104
|
const ret = arg0.set(arg1, arg2);
|
|
2141
2105
|
return ret;
|
|
2142
2106
|
},
|
|
2143
|
-
__wbg_set_body_a3d856b097dfda04: function(arg0, arg1) {
|
|
2144
|
-
arg0.body = arg1;
|
|
2145
|
-
},
|
|
2146
|
-
__wbg_set_cache_ec7e430c6056ebda: function(arg0, arg1) {
|
|
2147
|
-
arg0.cache = __wbindgen_enum_RequestCache[arg1];
|
|
2148
|
-
},
|
|
2149
2107
|
__wbg_set_create_ef897736206a6f05: function(arg0, arg1) {
|
|
2150
2108
|
arg0.create = arg1 !== 0;
|
|
2151
2109
|
},
|
|
2152
|
-
__wbg_set_credentials_ed63183445882c65: function(arg0, arg1) {
|
|
2153
|
-
arg0.credentials = __wbindgen_enum_RequestCredentials[arg1];
|
|
2154
|
-
},
|
|
2155
|
-
__wbg_set_headers_3c8fecc693b75327: function(arg0, arg1) {
|
|
2156
|
-
arg0.headers = arg1;
|
|
2157
|
-
},
|
|
2158
|
-
__wbg_set_method_8c015e8bcafd7be1: function(arg0, arg1, arg2) {
|
|
2159
|
-
arg0.method = getStringFromWasm0(arg1, arg2);
|
|
2160
|
-
},
|
|
2161
|
-
__wbg_set_mode_5a87f2c809cf37c2: function(arg0, arg1) {
|
|
2162
|
-
arg0.mode = __wbindgen_enum_RequestMode[arg1];
|
|
2163
|
-
},
|
|
2164
|
-
__wbg_set_signal_0cebecb698f25d21: function(arg0, arg1) {
|
|
2165
|
-
arg0.signal = arg1;
|
|
2166
|
-
},
|
|
2167
|
-
__wbg_signal_166e1da31adcac18: function(arg0) {
|
|
2168
|
-
const ret = arg0.signal;
|
|
2169
|
-
return ret;
|
|
2170
|
-
},
|
|
2171
2110
|
__wbg_stack_3b0d974bbf31e44f: function(arg0, arg1) {
|
|
2172
2111
|
const ret = arg1.stack;
|
|
2173
2112
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -2191,18 +2130,10 @@ function __wbg_get_imports() {
|
|
|
2191
2130
|
const ret = typeof window === 'undefined' ? null : window;
|
|
2192
2131
|
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
2193
2132
|
},
|
|
2194
|
-
__wbg_status_318629ab93a22955: function(arg0) {
|
|
2195
|
-
const ret = arg0.status;
|
|
2196
|
-
return ret;
|
|
2197
|
-
},
|
|
2198
2133
|
__wbg_storage_63fa6fa9455d2153: function(arg0) {
|
|
2199
2134
|
const ret = arg0.storage;
|
|
2200
2135
|
return ret;
|
|
2201
2136
|
},
|
|
2202
|
-
__wbg_stringify_5ae93966a84901ac: function() { return handleError(function (arg0) {
|
|
2203
|
-
const ret = JSON.stringify(arg0);
|
|
2204
|
-
return ret;
|
|
2205
|
-
}, arguments); },
|
|
2206
2137
|
__wbg_subarray_a068d24e39478a8a: function(arg0, arg1, arg2) {
|
|
2207
2138
|
const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0);
|
|
2208
2139
|
return ret;
|
|
@@ -2218,13 +2149,6 @@ function __wbg_get_imports() {
|
|
|
2218
2149
|
__wbg_truncate_af8ac1613ab66393: function() { return handleError(function (arg0, arg1) {
|
|
2219
2150
|
arg0.truncate(arg1);
|
|
2220
2151
|
}, arguments); },
|
|
2221
|
-
__wbg_url_7fefc1820fba4e0c: function(arg0, arg1) {
|
|
2222
|
-
const ret = arg1.url;
|
|
2223
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
2224
|
-
const len1 = WASM_VECTOR_LEN;
|
|
2225
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
2226
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
2227
|
-
},
|
|
2228
2152
|
__wbg_value_21fc78aab0322612: function(arg0) {
|
|
2229
2153
|
const ret = arg0.value;
|
|
2230
2154
|
return ret;
|
|
@@ -2234,46 +2158,41 @@ function __wbg_get_imports() {
|
|
|
2234
2158
|
return ret;
|
|
2235
2159
|
},
|
|
2236
2160
|
__wbindgen_cast_0000000000000001: function(arg0, arg1) {
|
|
2237
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2238
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2161
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 560, function: Function { arguments: [Externref], shim_idx: 561, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2162
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_188fd7264b65779d___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut__wasm_bindgen_188fd7264b65779d___JsValue____Output___core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_188fd7264b65779d___JsError___, wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___wasm_bindgen_188fd7264b65779d___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_188fd7264b65779d___JsError___true_);
|
|
2239
2163
|
return ret;
|
|
2240
2164
|
},
|
|
2241
2165
|
__wbindgen_cast_0000000000000002: function(arg0, arg1) {
|
|
2242
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
2243
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
2166
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 7, function: Function { arguments: [Externref], shim_idx: 8, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
2167
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_188fd7264b65779d___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut__wasm_bindgen_188fd7264b65779d___JsValue____Output_______, wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___wasm_bindgen_188fd7264b65779d___JsValue______true_);
|
|
2244
2168
|
return ret;
|
|
2245
2169
|
},
|
|
2246
|
-
__wbindgen_cast_0000000000000003: function(arg0
|
|
2247
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx: 702, function: Function { arguments: [Externref], shim_idx: 703, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
2248
|
-
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen_4501a39796791c69___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut__wasm_bindgen_4501a39796791c69___JsValue____Output___core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_4501a39796791c69___JsError___, wasm_bindgen_4501a39796791c69___convert__closures_____invoke___wasm_bindgen_4501a39796791c69___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_4501a39796791c69___JsError___true_);
|
|
2249
|
-
return ret;
|
|
2250
|
-
},
|
|
2251
|
-
__wbindgen_cast_0000000000000004: function(arg0) {
|
|
2170
|
+
__wbindgen_cast_0000000000000003: function(arg0) {
|
|
2252
2171
|
// Cast intrinsic for `F64 -> Externref`.
|
|
2253
2172
|
const ret = arg0;
|
|
2254
2173
|
return ret;
|
|
2255
2174
|
},
|
|
2256
|
-
|
|
2175
|
+
__wbindgen_cast_0000000000000004: function(arg0) {
|
|
2257
2176
|
// Cast intrinsic for `I64 -> Externref`.
|
|
2258
2177
|
const ret = arg0;
|
|
2259
2178
|
return ret;
|
|
2260
2179
|
},
|
|
2261
|
-
|
|
2180
|
+
__wbindgen_cast_0000000000000005: function(arg0, arg1) {
|
|
2262
2181
|
// Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`.
|
|
2263
2182
|
const ret = getArrayU8FromWasm0(arg0, arg1);
|
|
2264
2183
|
return ret;
|
|
2265
2184
|
},
|
|
2266
|
-
|
|
2185
|
+
__wbindgen_cast_0000000000000006: function(arg0, arg1) {
|
|
2267
2186
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
2268
2187
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
2269
2188
|
return ret;
|
|
2270
2189
|
},
|
|
2271
|
-
|
|
2190
|
+
__wbindgen_cast_0000000000000007: function(arg0) {
|
|
2272
2191
|
// Cast intrinsic for `U64 -> Externref`.
|
|
2273
2192
|
const ret = BigInt.asUintN(64, arg0);
|
|
2274
2193
|
return ret;
|
|
2275
2194
|
},
|
|
2276
|
-
|
|
2195
|
+
__wbindgen_cast_0000000000000008: function(arg0, arg1) {
|
|
2277
2196
|
var v0 = getArrayU8FromWasm0(arg0, arg1).slice();
|
|
2278
2197
|
wasm.__wbindgen_free(arg0, arg1 * 1, 1);
|
|
2279
2198
|
// Cast intrinsic for `Vector(U8) -> Externref`.
|
|
@@ -2296,33 +2215,21 @@ function __wbg_get_imports() {
|
|
|
2296
2215
|
};
|
|
2297
2216
|
}
|
|
2298
2217
|
|
|
2299
|
-
function
|
|
2300
|
-
wasm.
|
|
2301
|
-
}
|
|
2302
|
-
|
|
2303
|
-
function wasm_bindgen_4501a39796791c69___convert__closures_____invoke___wasm_bindgen_4501a39796791c69___JsValue______true_(arg0, arg1, arg2) {
|
|
2304
|
-
wasm.wasm_bindgen_4501a39796791c69___convert__closures_____invoke___wasm_bindgen_4501a39796791c69___JsValue______true_(arg0, arg1, arg2);
|
|
2218
|
+
function wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___wasm_bindgen_188fd7264b65779d___JsValue______true_(arg0, arg1, arg2) {
|
|
2219
|
+
wasm.wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___wasm_bindgen_188fd7264b65779d___JsValue______true_(arg0, arg1, arg2);
|
|
2305
2220
|
}
|
|
2306
2221
|
|
|
2307
|
-
function
|
|
2308
|
-
const ret = wasm.
|
|
2222
|
+
function wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___wasm_bindgen_188fd7264b65779d___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_188fd7264b65779d___JsError___true_(arg0, arg1, arg2) {
|
|
2223
|
+
const ret = wasm.wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___wasm_bindgen_188fd7264b65779d___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_188fd7264b65779d___JsError___true_(arg0, arg1, arg2);
|
|
2309
2224
|
if (ret[1]) {
|
|
2310
2225
|
throw takeFromExternrefTable0(ret[0]);
|
|
2311
2226
|
}
|
|
2312
2227
|
}
|
|
2313
2228
|
|
|
2314
|
-
function
|
|
2315
|
-
wasm.
|
|
2229
|
+
function wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___js_sys_6ed69cd23706a2fe___Function_fn_wasm_bindgen_188fd7264b65779d___JsValue_____wasm_bindgen_188fd7264b65779d___sys__Undefined___js_sys_6ed69cd23706a2fe___Function_fn_wasm_bindgen_188fd7264b65779d___JsValue_____wasm_bindgen_188fd7264b65779d___sys__Undefined_______true_(arg0, arg1, arg2, arg3) {
|
|
2230
|
+
wasm.wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___js_sys_6ed69cd23706a2fe___Function_fn_wasm_bindgen_188fd7264b65779d___JsValue_____wasm_bindgen_188fd7264b65779d___sys__Undefined___js_sys_6ed69cd23706a2fe___Function_fn_wasm_bindgen_188fd7264b65779d___JsValue_____wasm_bindgen_188fd7264b65779d___sys__Undefined_______true_(arg0, arg1, arg2, arg3);
|
|
2316
2231
|
}
|
|
2317
2232
|
|
|
2318
|
-
|
|
2319
|
-
const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"];
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"];
|
|
2323
|
-
|
|
2324
|
-
|
|
2325
|
-
const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"];
|
|
2326
2233
|
const CollectionWasmFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
2327
2234
|
? { register: () => {}, unregister: () => {} }
|
|
2328
2235
|
: new FinalizationRegistry(ptr => wasm.__wbg_collectionwasm_free(ptr >>> 0, 1));
|
package/pkg/taladb_web_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,7 +1,49 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __wbg_collectionwasm_free: (a: number, b: number) => void;
|
|
5
|
+
export const __wbg_taladbwasm_free: (a: number, b: number) => void;
|
|
4
6
|
export const __wbg_workerdb_free: (a: number, b: number) => void;
|
|
7
|
+
export const collectionwasm_aggregate: (a: number, b: any) => [number, number, number];
|
|
8
|
+
export const collectionwasm_count: (a: number, b: any) => [number, number, number];
|
|
9
|
+
export const collectionwasm_createCompoundIndex: (a: number, b: number, c: number) => [number, number];
|
|
10
|
+
export const collectionwasm_createFtsIndex: (a: number, b: number, c: number) => [number, number];
|
|
11
|
+
export const collectionwasm_createIndex: (a: number, b: number, c: number) => [number, number];
|
|
12
|
+
export const collectionwasm_createVectorIndex: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number];
|
|
13
|
+
export const collectionwasm_deleteMany: (a: number, b: any) => [number, number, number];
|
|
14
|
+
export const collectionwasm_deleteManyWithIds: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
15
|
+
export const collectionwasm_deleteOne: (a: number, b: any) => [number, number, number];
|
|
16
|
+
export const collectionwasm_dropCompoundIndex: (a: number, b: number, c: number) => [number, number];
|
|
17
|
+
export const collectionwasm_dropFtsIndex: (a: number, b: number, c: number) => [number, number];
|
|
18
|
+
export const collectionwasm_dropIndex: (a: number, b: number, c: number) => [number, number];
|
|
19
|
+
export const collectionwasm_dropVectorIndex: (a: number, b: number, c: number) => [number, number];
|
|
20
|
+
export const collectionwasm_find: (a: number, b: any) => [number, number, number];
|
|
21
|
+
export const collectionwasm_findNearest: (a: number, b: number, c: number, d: number, e: number, f: number, g: any) => [number, number, number];
|
|
22
|
+
export const collectionwasm_findOne: (a: number, b: any) => [number, number, number];
|
|
23
|
+
export const collectionwasm_hybridSearch: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: any, l: any) => [number, number, number];
|
|
24
|
+
export const collectionwasm_insert: (a: number, b: any) => [number, number, number, number];
|
|
25
|
+
export const collectionwasm_insertMany: (a: number, b: any) => [number, number, number];
|
|
26
|
+
export const collectionwasm_replaceManyWithIds: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
27
|
+
export const collectionwasm_searchText: (a: number, b: number, c: number, d: number, e: number, f: number, g: any, h: any) => [number, number, number];
|
|
28
|
+
export const collectionwasm_updateMany: (a: number, b: any, c: any) => [number, number, number];
|
|
29
|
+
export const collectionwasm_updateOne: (a: number, b: any, c: any) => [number, number, number];
|
|
30
|
+
export const collectionwasm_upgradeVectorIndex: (a: number, b: number, c: number) => [number, number];
|
|
31
|
+
export const idb_load_snapshot: (a: number, b: number) => any;
|
|
32
|
+
export const idb_save_snapshot: (a: number, b: number, c: number, d: number) => any;
|
|
33
|
+
export const is_opfs_available: () => any;
|
|
34
|
+
export const opfs_delete_snapshot: (a: number, b: number) => any;
|
|
35
|
+
export const opfs_flush_snapshot: (a: number, b: number, c: number, d: number) => any;
|
|
36
|
+
export const opfs_load_snapshot: (a: number, b: number) => any;
|
|
37
|
+
export const opfs_open_backend: (a: number, b: number) => any;
|
|
38
|
+
export const taladbwasm_collection: (a: number, b: number, c: number) => [number, number, number];
|
|
39
|
+
export const taladbwasm_exportChanges: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
40
|
+
export const taladbwasm_exportSnapshot: (a: number) => [number, number, number, number];
|
|
41
|
+
export const taladbwasm_importChanges: (a: number, b: number, c: number) => [number, number, number];
|
|
42
|
+
export const taladbwasm_listCollectionNames: (a: number) => [number, number, number, number];
|
|
43
|
+
export const taladbwasm_openInMemory: () => [number, number, number];
|
|
44
|
+
export const taladbwasm_openWithSnapshot: (a: number, b: number) => [number, number, number];
|
|
45
|
+
export const taladbwasm_setUserVersion: (a: number, b: number) => [number, number];
|
|
46
|
+
export const taladbwasm_userVersion: (a: number) => [number, number, number];
|
|
5
47
|
export const workerdb_aggregate: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
|
|
6
48
|
export const workerdb_compact: (a: number) => [number, number];
|
|
7
49
|
export const workerdb_compactTombstones: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
@@ -46,56 +88,13 @@ export const workerdb_updateMany: (a: number, b: number, c: number, d: number, e
|
|
|
46
88
|
export const workerdb_updateOne: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
|
|
47
89
|
export const workerdb_upgradeVectorIndex: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
48
90
|
export const workerdb_userVersion: (a: number) => [number, number, number];
|
|
49
|
-
export const
|
|
50
|
-
export const __wbg_taladbwasm_free: (a: number, b: number) => void;
|
|
51
|
-
export const collectionwasm_aggregate: (a: number, b: any) => [number, number, number];
|
|
52
|
-
export const collectionwasm_count: (a: number, b: any) => [number, number, number];
|
|
53
|
-
export const collectionwasm_createCompoundIndex: (a: number, b: number, c: number) => [number, number];
|
|
54
|
-
export const collectionwasm_createFtsIndex: (a: number, b: number, c: number) => [number, number];
|
|
55
|
-
export const collectionwasm_createIndex: (a: number, b: number, c: number) => [number, number];
|
|
56
|
-
export const collectionwasm_createVectorIndex: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number];
|
|
57
|
-
export const collectionwasm_deleteMany: (a: number, b: any) => [number, number, number];
|
|
58
|
-
export const collectionwasm_deleteManyWithIds: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
59
|
-
export const collectionwasm_deleteOne: (a: number, b: any) => [number, number, number];
|
|
60
|
-
export const collectionwasm_dropCompoundIndex: (a: number, b: number, c: number) => [number, number];
|
|
61
|
-
export const collectionwasm_dropFtsIndex: (a: number, b: number, c: number) => [number, number];
|
|
62
|
-
export const collectionwasm_dropIndex: (a: number, b: number, c: number) => [number, number];
|
|
63
|
-
export const collectionwasm_dropVectorIndex: (a: number, b: number, c: number) => [number, number];
|
|
64
|
-
export const collectionwasm_find: (a: number, b: any) => [number, number, number];
|
|
65
|
-
export const collectionwasm_findNearest: (a: number, b: number, c: number, d: number, e: number, f: number, g: any) => [number, number, number];
|
|
66
|
-
export const collectionwasm_findOne: (a: number, b: any) => [number, number, number];
|
|
67
|
-
export const collectionwasm_hybridSearch: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: any, l: any) => [number, number, number];
|
|
68
|
-
export const collectionwasm_insert: (a: number, b: any) => [number, number, number, number];
|
|
69
|
-
export const collectionwasm_insertMany: (a: number, b: any) => [number, number, number];
|
|
70
|
-
export const collectionwasm_replaceManyWithIds: (a: number, b: any, c: number, d: number) => [number, number, number];
|
|
71
|
-
export const collectionwasm_searchText: (a: number, b: number, c: number, d: number, e: number, f: number, g: any, h: any) => [number, number, number];
|
|
72
|
-
export const collectionwasm_updateMany: (a: number, b: any, c: any) => [number, number, number];
|
|
73
|
-
export const collectionwasm_updateOne: (a: number, b: any, c: any) => [number, number, number];
|
|
74
|
-
export const collectionwasm_upgradeVectorIndex: (a: number, b: number, c: number) => [number, number];
|
|
75
|
-
export const taladbwasm_collection: (a: number, b: number, c: number) => [number, number, number];
|
|
76
|
-
export const taladbwasm_exportChanges: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
77
|
-
export const taladbwasm_exportSnapshot: (a: number) => [number, number, number, number];
|
|
78
|
-
export const taladbwasm_importChanges: (a: number, b: number, c: number) => [number, number, number];
|
|
79
|
-
export const taladbwasm_listCollectionNames: (a: number) => [number, number, number, number];
|
|
80
|
-
export const taladbwasm_openInMemory: () => [number, number, number];
|
|
81
|
-
export const taladbwasm_openWithSnapshot: (a: number, b: number) => [number, number, number];
|
|
82
|
-
export const taladbwasm_setUserVersion: (a: number, b: number) => [number, number];
|
|
83
|
-
export const taladbwasm_userVersion: (a: number) => [number, number, number];
|
|
91
|
+
export const workerdb_writeGeneration: (a: number, b: number, c: number) => [number, number, number];
|
|
84
92
|
export const init: () => void;
|
|
85
|
-
export const
|
|
86
|
-
export const
|
|
87
|
-
export const
|
|
88
|
-
export const
|
|
89
|
-
export const
|
|
90
|
-
export const idb_save_snapshot: (a: number, b: number, c: number, d: number) => any;
|
|
91
|
-
export const opfs_open_backend: (a: number, b: number) => any;
|
|
92
|
-
export const wasm_bindgen_4501a39796791c69___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut__wasm_bindgen_4501a39796791c69___JsValue____Output_______: (a: number, b: number) => void;
|
|
93
|
-
export const wasm_bindgen_4501a39796791c69___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut_____Output_______: (a: number, b: number) => void;
|
|
94
|
-
export const wasm_bindgen_4501a39796791c69___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut__wasm_bindgen_4501a39796791c69___JsValue____Output___core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_4501a39796791c69___JsError___: (a: number, b: number) => void;
|
|
95
|
-
export const wasm_bindgen_4501a39796791c69___convert__closures_____invoke___wasm_bindgen_4501a39796791c69___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_4501a39796791c69___JsError___true_: (a: number, b: number, c: any) => [number, number];
|
|
96
|
-
export const wasm_bindgen_4501a39796791c69___convert__closures_____invoke___js_sys_d1fdfe5cb3da44fc___Function_fn_wasm_bindgen_4501a39796791c69___JsValue_____wasm_bindgen_4501a39796791c69___sys__Undefined___js_sys_d1fdfe5cb3da44fc___Function_fn_wasm_bindgen_4501a39796791c69___JsValue_____wasm_bindgen_4501a39796791c69___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
|
|
97
|
-
export const wasm_bindgen_4501a39796791c69___convert__closures_____invoke___wasm_bindgen_4501a39796791c69___JsValue______true_: (a: number, b: number, c: any) => void;
|
|
98
|
-
export const wasm_bindgen_4501a39796791c69___convert__closures_____invoke_______true_: (a: number, b: number) => void;
|
|
93
|
+
export const wasm_bindgen_188fd7264b65779d___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut__wasm_bindgen_188fd7264b65779d___JsValue____Output___core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_188fd7264b65779d___JsError___: (a: number, b: number) => void;
|
|
94
|
+
export const wasm_bindgen_188fd7264b65779d___closure__destroy___dyn_core_9b3796e30d99ddb7___ops__function__FnMut__wasm_bindgen_188fd7264b65779d___JsValue____Output_______: (a: number, b: number) => void;
|
|
95
|
+
export const wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___wasm_bindgen_188fd7264b65779d___JsValue__core_9b3796e30d99ddb7___result__Result_____wasm_bindgen_188fd7264b65779d___JsError___true_: (a: number, b: number, c: any) => [number, number];
|
|
96
|
+
export const wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___js_sys_6ed69cd23706a2fe___Function_fn_wasm_bindgen_188fd7264b65779d___JsValue_____wasm_bindgen_188fd7264b65779d___sys__Undefined___js_sys_6ed69cd23706a2fe___Function_fn_wasm_bindgen_188fd7264b65779d___JsValue_____wasm_bindgen_188fd7264b65779d___sys__Undefined_______true_: (a: number, b: number, c: any, d: any) => void;
|
|
97
|
+
export const wasm_bindgen_188fd7264b65779d___convert__closures_____invoke___wasm_bindgen_188fd7264b65779d___JsValue______true_: (a: number, b: number, c: any) => void;
|
|
99
98
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
100
99
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
101
100
|
export const __wbindgen_exn_store: (a: number) => void;
|
package/worker/taladb.worker.js
CHANGED
|
@@ -117,6 +117,26 @@ let pendingSnapshotResolve = null;
|
|
|
117
117
|
*/
|
|
118
118
|
const initPromises = new Map();
|
|
119
119
|
|
|
120
|
+
/**
|
|
121
|
+
* WASM fetch + compile, started at module scope rather than inside `doInit`.
|
|
122
|
+
*
|
|
123
|
+
* The worker is spawned and its module evaluated well before the main thread's
|
|
124
|
+
* `init` message arrives. Waiting for that message to *begin* downloading ~1 MB
|
|
125
|
+
* of WASM left the whole spawn-and-post round trip idle; kicking it off here
|
|
126
|
+
* overlaps the two. `doInit` simply awaits this.
|
|
127
|
+
*
|
|
128
|
+
* A rejection here is not unhandled: `doInit` awaits it and surfaces the error
|
|
129
|
+
* to the caller as a failed `init`. The no-op catch keeps the runtime from
|
|
130
|
+
* reporting it as unhandled in the window between module eval and that await.
|
|
131
|
+
* @type {Promise<typeof import('../pkg/taladb_web')>}
|
|
132
|
+
*/
|
|
133
|
+
const wasmReady = (async () => {
|
|
134
|
+
const wasm = await import(/* @vite-ignore */ '../pkg/taladb_web.js');
|
|
135
|
+
await wasm.default();
|
|
136
|
+
return wasm;
|
|
137
|
+
})();
|
|
138
|
+
wasmReady.catch(() => {});
|
|
139
|
+
|
|
120
140
|
/** The dbName that was successfully initialised (or is being initialised). */
|
|
121
141
|
let activeDbName = null;
|
|
122
142
|
|
|
@@ -479,6 +499,10 @@ async function dispatch(op, args) {
|
|
|
479
499
|
case 'count':
|
|
480
500
|
return db.count(args.collection, args.filterJson ?? 'null');
|
|
481
501
|
|
|
502
|
+
// Cheap change-detection for subscribe(): one integer, no query.
|
|
503
|
+
case 'writeGeneration':
|
|
504
|
+
return db.writeGeneration(args.collection);
|
|
505
|
+
|
|
482
506
|
case 'aggregate':
|
|
483
507
|
return db.aggregate(args.collection, args.pipelineJson ?? '[]');
|
|
484
508
|
|
|
@@ -688,14 +712,29 @@ async function loadOrCreateSalt(root, saltFileName) {
|
|
|
688
712
|
// ---------------------------------------------------------------------------
|
|
689
713
|
|
|
690
714
|
async function doInit(dbName, configJson, passphrase = null) {
|
|
691
|
-
|
|
692
|
-
|
|
715
|
+
encrypted = typeof passphrase === 'string' && passphrase.length > 0;
|
|
716
|
+
|
|
717
|
+
const opfsAvailable = canUseOpfs();
|
|
718
|
+
|
|
719
|
+
// Compiling ~1 MB of WASM and setting up OPFS are independent, and OPFS setup
|
|
720
|
+
// is four awaited round trips (getDirectory → getFileHandle → lock →
|
|
721
|
+
// createSyncAccessHandle). Starting both now lets the storage latency hide
|
|
722
|
+
// behind the compile instead of following it.
|
|
723
|
+
//
|
|
724
|
+
// `wasmReady` was already kicked off at module scope — see its declaration.
|
|
725
|
+
const opfsSetup = opfsAvailable
|
|
726
|
+
? (async () => {
|
|
727
|
+
const root = await navigator.storage.getDirectory();
|
|
728
|
+
const fileName = `taladb_${dbName.replaceAll(/[/\\:]/g, '_')}.redb`;
|
|
729
|
+
return { root, fileName, fileHandle: await root.getFileHandle(fileName, { create: true }) };
|
|
730
|
+
})().catch(() => null)
|
|
731
|
+
: Promise.resolve(null);
|
|
732
|
+
|
|
733
|
+
const wasm = await wasmReady;
|
|
693
734
|
|
|
694
735
|
// Hoist to module scope so snapshot reloads in dispatch() can use it.
|
|
695
736
|
WorkerDB = wasm.WorkerDB;
|
|
696
737
|
|
|
697
|
-
encrypted = typeof passphrase === 'string' && passphrase.length > 0;
|
|
698
|
-
|
|
699
738
|
// Open the BroadcastChannel now that we know the db name.
|
|
700
739
|
if (typeof BroadcastChannel !== 'undefined') {
|
|
701
740
|
broadcastChannel = new BroadcastChannel(`taladb:${dbName}`);
|
|
@@ -762,16 +801,13 @@ async function doInit(dbName, configJson, passphrase = null) {
|
|
|
762
801
|
);
|
|
763
802
|
}
|
|
764
803
|
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
}
|
|
773
|
-
warn('OPFS unavailable — falling back to IndexedDB-backed in-memory');
|
|
774
|
-
const snapshot = await idbLoadSnapshot(dbName);
|
|
804
|
+
/**
|
|
805
|
+
* Open an in-memory database seeded from the last IndexedDB snapshot, and
|
|
806
|
+
* keep flushing snapshots back. The degradation path whenever OPFS is
|
|
807
|
+
* unusable. Never valid for encrypted databases — the snapshot is plaintext.
|
|
808
|
+
*/
|
|
809
|
+
async function openIdbFallback(name) {
|
|
810
|
+
const snapshot = await idbLoadSnapshot(name);
|
|
775
811
|
db = openWithSnapshot(snapshot);
|
|
776
812
|
idbFallback = true;
|
|
777
813
|
snapshotWriter = true;
|
|
@@ -780,12 +816,24 @@ async function doInit(dbName, configJson, passphrase = null) {
|
|
|
780
816
|
} else {
|
|
781
817
|
log('New in-memory database — writes will be persisted to IndexedDB');
|
|
782
818
|
}
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
// `opfsSetup` resolves to null when OPFS is unusable — either the capability
|
|
822
|
+
// check said so up front, or getDirectory/getFileHandle actually failed.
|
|
823
|
+
const opfs = await opfsSetup;
|
|
824
|
+
if (!opfs) {
|
|
825
|
+
if (encrypted) {
|
|
826
|
+
throw new Error(
|
|
827
|
+
'TalaDB encryption requires OPFS, which is unavailable in this browser context. ' +
|
|
828
|
+
'Refusing to open — the in-memory/IndexedDB fallback cannot encrypt at rest.'
|
|
829
|
+
);
|
|
830
|
+
}
|
|
831
|
+
warn('OPFS unavailable — falling back to IndexedDB-backed in-memory');
|
|
832
|
+
await openIdbFallback(dbName);
|
|
783
833
|
return;
|
|
784
834
|
}
|
|
785
835
|
|
|
786
|
-
const root =
|
|
787
|
-
const fileName = `taladb_${dbName.replaceAll(/[/\\:]/g, '_')}.redb`;
|
|
788
|
-
const fileHandle = await root.getFileHandle(fileName, { create: true });
|
|
836
|
+
const { root, fileName, fileHandle } = opfs;
|
|
789
837
|
|
|
790
838
|
// Encrypted mode: the 16-byte key-derivation salt lives in an OPFS sidecar
|
|
791
839
|
// file next to the DB. It is loaded/created only AFTER this tab has won the
|
|
@@ -796,7 +844,20 @@ async function doInit(dbName, configJson, passphrase = null) {
|
|
|
796
844
|
// Web Locks not available — open directly (single-tab safe only).
|
|
797
845
|
warn('Web Locks unavailable — multi-tab write safety disabled');
|
|
798
846
|
if (encrypted) salt = await loadOrCreateSalt(root, `${fileName}.salt`);
|
|
799
|
-
|
|
847
|
+
let syncHandle;
|
|
848
|
+
try {
|
|
849
|
+
syncHandle = await fileHandle.createSyncAccessHandle();
|
|
850
|
+
} catch (e) {
|
|
851
|
+
// `createSyncAccessHandle` can exist on the prototype and still throw —
|
|
852
|
+
// Firefox without storage access, a cross-origin iframe, a revoked
|
|
853
|
+
// permission. The removed probe file used to surface that as "OPFS
|
|
854
|
+
// unavailable"; catching it here keeps the same graceful degradation
|
|
855
|
+
// rather than failing the open outright.
|
|
856
|
+
if (encrypted) throw e; // the IDB fallback cannot encrypt at rest
|
|
857
|
+
warn('OPFS sync access unavailable — falling back to IndexedDB:', e);
|
|
858
|
+
await openIdbFallback(dbName);
|
|
859
|
+
return;
|
|
860
|
+
}
|
|
800
861
|
try {
|
|
801
862
|
db = openWithOpfs(syncHandle);
|
|
802
863
|
} catch (e) {
|
|
@@ -863,7 +924,18 @@ async function doInit(dbName, configJson, passphrase = null) {
|
|
|
863
924
|
let syncHandle = null;
|
|
864
925
|
try {
|
|
865
926
|
if (encrypted) salt = await loadOrCreateSalt(root, `${fileName}.salt`);
|
|
866
|
-
|
|
927
|
+
try {
|
|
928
|
+
syncHandle = await fileHandle.createSyncAccessHandle();
|
|
929
|
+
} catch (e) {
|
|
930
|
+
// See the no-locks branch: the method can exist and still throw, and
|
|
931
|
+
// that used to be caught by the probe file. Degrade to IndexedDB
|
|
932
|
+
// instead of failing the open.
|
|
933
|
+
if (encrypted) throw e; // the IDB fallback cannot encrypt at rest
|
|
934
|
+
warn('OPFS sync access unavailable — falling back to IndexedDB:', e);
|
|
935
|
+
await openIdbFallback(dbName);
|
|
936
|
+
resolve();
|
|
937
|
+
return; // releases the Web Lock — this tab is not the OPFS holder
|
|
938
|
+
}
|
|
867
939
|
db = openWithOpfs(syncHandle);
|
|
868
940
|
snapshotWriter = !encrypted; // encrypted DBs never write a plaintext IDB snapshot
|
|
869
941
|
log(`Opened "${fileName}" via OPFS (Web Locks)`);
|
|
@@ -893,21 +965,24 @@ async function doInit(dbName, configJson, passphrase = null) {
|
|
|
893
965
|
// OPFS capability probe
|
|
894
966
|
// ---------------------------------------------------------------------------
|
|
895
967
|
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
968
|
+
/**
|
|
969
|
+
* Whether this context can do synchronous OPFS I/O.
|
|
970
|
+
*
|
|
971
|
+
* This used to create a uniquely-named probe file, open a sync access handle on
|
|
972
|
+
* it, close it, and delete it — four sequential OPFS round trips on every cold
|
|
973
|
+
* start, immediately before the real open performed the identical sequence on
|
|
974
|
+
* the actual database file and would have failed the same way. The capability
|
|
975
|
+
* check below is synchronous and free; anything the probe would have caught
|
|
976
|
+
* (permissions, cross-origin isolation, a non-Worker scope) surfaces from the
|
|
977
|
+
* real open, which `doInit` already handles by falling back to IndexedDB.
|
|
978
|
+
*
|
|
979
|
+
* @returns {boolean}
|
|
980
|
+
*/
|
|
981
|
+
function canUseOpfs() {
|
|
982
|
+
return (
|
|
983
|
+
typeof navigator !== 'undefined' &&
|
|
984
|
+
typeof navigator.storage?.getDirectory === 'function' &&
|
|
985
|
+
typeof FileSystemFileHandle !== 'undefined' &&
|
|
986
|
+
typeof FileSystemFileHandle.prototype?.createSyncAccessHandle === 'function'
|
|
987
|
+
);
|
|
913
988
|
}
|