@moyodb/sdk 1.1.0 → 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +142 -0
- package/dist/assets/browser-worker-DBt51gsS.js +4 -0
- package/dist/assets/browser-worker-DBt51gsS.js.map +1 -0
- package/dist/assets/shared-worker-NdniRuEL.js +2 -0
- package/dist/assets/shared-worker-NdniRuEL.js.map +1 -0
- package/dist/chunks/{indexing-BzmFhWXs.js → indexing-CKtbpaZn.js} +93 -12
- package/dist/chunks/indexing-CKtbpaZn.js.map +1 -0
- package/dist/compression.d.ts +16 -2
- package/dist/compression.d.ts.map +1 -1
- package/dist/engine/README.md +30 -3
- package/dist/engine/moyodb_engine.d.ts +34 -10
- package/dist/engine/moyodb_engine.js +238 -51
- package/dist/engine/moyodb_engine_bg.wasm +0 -0
- package/dist/engine/moyodb_engine_bg.wasm.d.ts +17 -10
- package/dist/engine/package.json +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/internal.d.ts +6 -0
- package/dist/internal.d.ts.map +1 -1
- package/dist/moyodb-sdk.js +1122 -883
- package/dist/moyodb-sdk.js.map +1 -1
- package/dist/node-engine.js +703 -78
- package/dist/node-engine.js.map +1 -1
- package/dist/node-storage.d.mts +4 -0
- package/dist/node-storage.mjs +38 -3
- package/dist/node-worker-client.d.ts +1 -0
- package/dist/node-worker-client.d.ts.map +1 -1
- package/dist/node-worker.mjs +2 -1
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +280 -37
- package/dist/node.js.map +1 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/shared-worker-client.d.ts +4 -0
- package/dist/shared-worker-client.d.ts.map +1 -1
- package/dist/shared-worker.d.ts.map +1 -1
- package/dist/snappy.d.ts +3 -0
- package/dist/snappy.d.ts.map +1 -0
- package/dist/sql-parser.d.ts.map +1 -1
- package/dist/types.d.ts +33 -3
- package/dist/types.d.ts.map +1 -1
- package/dist/worker-api.d.ts +17 -1
- package/dist/worker-api.d.ts.map +1 -1
- package/dist/worker-client.d.ts +7 -2
- package/dist/worker-client.d.ts.map +1 -1
- package/dist/worker-protocol.d.ts +11 -1
- package/dist/worker-protocol.d.ts.map +1 -1
- package/dist/worker-server.d.ts.map +1 -1
- package/dist/worker.d.ts +31 -2
- package/dist/worker.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/assets/browser-worker-DP6Mjz7c.js +0 -4
- package/dist/assets/browser-worker-DP6Mjz7c.js.map +0 -1
- package/dist/assets/shared-worker-DKzhauVf.js +0 -2
- package/dist/assets/shared-worker-DKzhauVf.js.map +0 -1
- package/dist/chunks/indexing-BzmFhWXs.js.map +0 -1
- package/dist/engine/snippets/moyodb-engine-cff0a0e2441a7a8f/js/opfs_shim.js +0 -513
- /package/dist/engine/snippets/{moyodb-engine-8ebe6af0cc2e81b7 → moyodb-engine-54a406e33b0fb849}/js/opfs_shim.js +0 -0
|
@@ -25,6 +25,7 @@ export class WasmEngine {
|
|
|
25
25
|
* handle even on error so a retry cannot reuse a partially closed engine.
|
|
26
26
|
*/
|
|
27
27
|
close(): void;
|
|
28
|
+
close_scan_cursor(cursor_id: number): void;
|
|
28
29
|
commit_tx(tx_id: bigint): bigint;
|
|
29
30
|
/**
|
|
30
31
|
* Streams this database into a new, empty target generation.
|
|
@@ -53,6 +54,14 @@ export class WasmEngine {
|
|
|
53
54
|
* All integers are little-endian.
|
|
54
55
|
*/
|
|
55
56
|
get_many_packed(tx_id: bigint, store: string, keys: Uint8Array): Uint8Array;
|
|
57
|
+
/**
|
|
58
|
+
* Returns max(encoded, decoded) lengths. u32::MAX marks missing or expired values.
|
|
59
|
+
*/
|
|
60
|
+
get_many_value_sizes(tx_id: bigint, store: string, keys: Uint8Array): Uint32Array;
|
|
61
|
+
/**
|
|
62
|
+
* Returns count followed by 32-byte rows: flags, expiry, epoch, ordinal, max length.
|
|
63
|
+
*/
|
|
64
|
+
get_many_value_states(tx_id: bigint, store: string, keys: Uint8Array): Uint8Array;
|
|
56
65
|
get_schema_version(): bigint;
|
|
57
66
|
has(tx_id: bigint, store: string, key: Uint8Array): boolean;
|
|
58
67
|
/**
|
|
@@ -67,8 +76,15 @@ export class WasmEngine {
|
|
|
67
76
|
constructor();
|
|
68
77
|
openGeneration(name: string, generation_name: string, options: any): Promise<void>;
|
|
69
78
|
open(name: string, options: any): Promise<void>;
|
|
79
|
+
open_scan_cursor(tx_id: bigint, store: string, range: any, keys_only: boolean): number;
|
|
70
80
|
put(tx_id: bigint, store: string, key: Uint8Array, value: Uint8Array, options: any): boolean;
|
|
81
|
+
put_index_entry_checked(tx_id: bigint, primary_store: string, index_store: string, primary_key: Uint8Array, index_key: Uint8Array, expected_epoch: bigint, expected_ordinal: bigint): void;
|
|
71
82
|
put_many(tx_id: bigint, store: string, entries: any, options: any): any;
|
|
83
|
+
/**
|
|
84
|
+
* Returns one baseline byte per completed row. A failed row can have
|
|
85
|
+
* staged writes and is excluded from the error's partial outcomes.
|
|
86
|
+
*/
|
|
87
|
+
put_many_indexed_packed(tx_id: bigint, store: string, entries: Uint8Array, index_ops: any, options: any): Uint8Array;
|
|
72
88
|
/**
|
|
73
89
|
* Returns one byte per entry: 1 if the key existed before the put.
|
|
74
90
|
*/
|
|
@@ -77,6 +93,7 @@ export class WasmEngine {
|
|
|
77
93
|
reset(): bigint;
|
|
78
94
|
rollback_tx(tx_id: bigint): void;
|
|
79
95
|
scan(tx_id: bigint, store: string, range: any): any;
|
|
96
|
+
scan_cursor_next(cursor_id: number, max_rows: number, max_bytes: number): any;
|
|
80
97
|
set_change_feed_policy(tx_id: bigint, policy: any): void;
|
|
81
98
|
set_failpoint(failpoint: any): void;
|
|
82
99
|
set_schema_version(tx_id: bigint, version: bigint): void;
|
|
@@ -116,12 +133,12 @@ export interface InitOutput {
|
|
|
116
133
|
readonly memory: WebAssembly.Memory;
|
|
117
134
|
readonly __wbg_wasmengine_free: (a: number, b: number) => void;
|
|
118
135
|
readonly buildProfile: (a: number) => void;
|
|
119
|
-
readonly cleanupInactiveEntries: (a: number
|
|
120
|
-
readonly dbDirectorySize: (a: number
|
|
121
|
-
readonly deleteDB: (a: number
|
|
122
|
-
readonly prepareRebuildTarget: (a: number
|
|
123
|
-
readonly readActiveGeneration: (a: number
|
|
124
|
-
readonly swapActiveGeneration: (a: number, b: number, c: number, d: number, e: number
|
|
136
|
+
readonly cleanupInactiveEntries: (a: number) => number;
|
|
137
|
+
readonly dbDirectorySize: (a: number) => number;
|
|
138
|
+
readonly deleteDB: (a: number) => number;
|
|
139
|
+
readonly prepareRebuildTarget: (a: number) => number;
|
|
140
|
+
readonly readActiveGeneration: (a: number) => number;
|
|
141
|
+
readonly swapActiveGeneration: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
125
142
|
readonly wasmengine_abandon: (a: number, b: number) => void;
|
|
126
143
|
readonly wasmengine_apply_batch: (a: number, b: number, c: bigint, d: number, e: number, f: number) => void;
|
|
127
144
|
readonly wasmengine_apply_batch_packed: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number) => void;
|
|
@@ -131,6 +148,7 @@ export interface InitOutput {
|
|
|
131
148
|
readonly wasmengine_checkpoint: (a: number, b: number) => void;
|
|
132
149
|
readonly wasmengine_clear_store: (a: number, b: number, c: bigint, d: number, e: number) => void;
|
|
133
150
|
readonly wasmengine_close: (a: number, b: number) => void;
|
|
151
|
+
readonly wasmengine_close_scan_cursor: (a: number, b: number, c: number) => void;
|
|
134
152
|
readonly wasmengine_commit_tx: (a: number, b: number, c: bigint) => void;
|
|
135
153
|
readonly wasmengine_compact_into: (a: number, b: number, c: number) => void;
|
|
136
154
|
readonly wasmengine_compact_into_skipping_stores: (a: number, b: number, c: number, d: number) => void;
|
|
@@ -143,6 +161,8 @@ export interface InitOutput {
|
|
|
143
161
|
readonly wasmengine_get: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number) => void;
|
|
144
162
|
readonly wasmengine_get_many: (a: number, b: number, c: bigint, d: number, e: number, f: number) => void;
|
|
145
163
|
readonly wasmengine_get_many_packed: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number) => void;
|
|
164
|
+
readonly wasmengine_get_many_value_sizes: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number) => void;
|
|
165
|
+
readonly wasmengine_get_many_value_states: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number) => void;
|
|
146
166
|
readonly wasmengine_get_schema_version: (a: number, b: number) => void;
|
|
147
167
|
readonly wasmengine_has: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number) => void;
|
|
148
168
|
readonly wasmengine_has_many: (a: number, b: number, c: bigint, d: number, e: number, f: number) => void;
|
|
@@ -152,21 +172,25 @@ export interface InitOutput {
|
|
|
152
172
|
readonly wasmengine_list_stores: (a: number, b: number) => void;
|
|
153
173
|
readonly wasmengine_needs_recovery: (a: number, b: number) => void;
|
|
154
174
|
readonly wasmengine_new: () => number;
|
|
155
|
-
readonly wasmengine_open: (a: number, b: number, c: number
|
|
156
|
-
readonly wasmengine_openGeneration: (a: number, b: number, c: number, d: number, e: number
|
|
175
|
+
readonly wasmengine_open: (a: number, b: number, c: number) => number;
|
|
176
|
+
readonly wasmengine_openGeneration: (a: number, b: number, c: number, d: number, e: number) => number;
|
|
177
|
+
readonly wasmengine_open_scan_cursor: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number) => void;
|
|
157
178
|
readonly wasmengine_put: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => void;
|
|
179
|
+
readonly wasmengine_put_index_entry_checked: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number, h: number, i: number, j: number, k: number, l: bigint, m: bigint) => void;
|
|
158
180
|
readonly wasmengine_put_many: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number) => void;
|
|
181
|
+
readonly wasmengine_put_many_indexed_packed: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number, h: number, i: number) => void;
|
|
159
182
|
readonly wasmengine_put_many_packed: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number, h: number) => void;
|
|
160
183
|
readonly wasmengine_recover: (a: number, b: number) => void;
|
|
161
184
|
readonly wasmengine_reset: (a: number, b: number) => void;
|
|
162
185
|
readonly wasmengine_rollback_tx: (a: number, b: number, c: bigint) => void;
|
|
163
186
|
readonly wasmengine_scan: (a: number, b: number, c: bigint, d: number, e: number, f: number) => void;
|
|
187
|
+
readonly wasmengine_scan_cursor_next: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
164
188
|
readonly wasmengine_set_change_feed_policy: (a: number, b: number, c: bigint, d: number) => void;
|
|
165
189
|
readonly wasmengine_set_failpoint: (a: number, b: number, c: number) => void;
|
|
166
190
|
readonly wasmengine_set_schema_version: (a: number, b: number, c: bigint, d: bigint) => void;
|
|
167
191
|
readonly wasmengine_stats: (a: number, b: number) => void;
|
|
168
|
-
readonly
|
|
169
|
-
readonly
|
|
192
|
+
readonly __wasm_bindgen_func_elem_901: (a: number, b: number, c: number, d: number) => void;
|
|
193
|
+
readonly __wasm_bindgen_func_elem_916: (a: number, b: number, c: number, d: number) => void;
|
|
170
194
|
readonly __wbindgen_export: (a: number, b: number) => number;
|
|
171
195
|
readonly __wbindgen_export2: (a: number, b: number, c: number, d: number) => number;
|
|
172
196
|
readonly __wbindgen_export3: (a: number) => void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* @ts-self-types="./moyodb_engine.d.ts" */
|
|
2
|
-
import { opfsAppendOffset, opfsCleanupInactiveEntries, opfsCloseSession, opfsDbDirectorySize, opfsFlush, opfsLen, opfsOpenActiveDb, opfsOpenGenerationDb, opfsPrepareRebuildTarget, opfsReadActiveGeneration, opfsReadAtInto, opfsRemoveDb, opfsSwapActiveGeneration, opfsTruncate, opfsWriteAt } from './snippets/moyodb-engine-
|
|
2
|
+
import { opfsAppendOffset, opfsCleanupInactiveEntries, opfsCloseSession, opfsDbDirectorySize, opfsFlush, opfsLen, opfsOpenActiveDb, opfsOpenGenerationDb, opfsPrepareRebuildTarget, opfsReadActiveGeneration, opfsReadAtInto, opfsRemoveDb, opfsSwapActiveGeneration, opfsTruncate, opfsWriteAt } from './snippets/moyodb-engine-54a406e33b0fb849/js/opfs_shim.js';
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
export class WasmEngine {
|
|
@@ -191,6 +191,22 @@ export class WasmEngine {
|
|
|
191
191
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
192
192
|
}
|
|
193
193
|
}
|
|
194
|
+
/**
|
|
195
|
+
* @param {number} cursor_id
|
|
196
|
+
*/
|
|
197
|
+
close_scan_cursor(cursor_id) {
|
|
198
|
+
try {
|
|
199
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
200
|
+
wasm.wasmengine_close_scan_cursor(retptr, this.__wbg_ptr, cursor_id);
|
|
201
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
202
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
203
|
+
if (r1) {
|
|
204
|
+
throw takeObject(r0);
|
|
205
|
+
}
|
|
206
|
+
} finally {
|
|
207
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
194
210
|
/**
|
|
195
211
|
* @param {bigint} tx_id
|
|
196
212
|
* @returns {bigint}
|
|
@@ -471,6 +487,64 @@ export class WasmEngine {
|
|
|
471
487
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
472
488
|
}
|
|
473
489
|
}
|
|
490
|
+
/**
|
|
491
|
+
* Returns max(encoded, decoded) lengths. u32::MAX marks missing or expired values.
|
|
492
|
+
* @param {bigint} tx_id
|
|
493
|
+
* @param {string} store
|
|
494
|
+
* @param {Uint8Array} keys
|
|
495
|
+
* @returns {Uint32Array}
|
|
496
|
+
*/
|
|
497
|
+
get_many_value_sizes(tx_id, store, keys) {
|
|
498
|
+
try {
|
|
499
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
500
|
+
const ptr0 = passStringToWasm0(store, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
501
|
+
const len0 = WASM_VECTOR_LEN;
|
|
502
|
+
const ptr1 = passArray8ToWasm0(keys, wasm.__wbindgen_export);
|
|
503
|
+
const len1 = WASM_VECTOR_LEN;
|
|
504
|
+
wasm.wasmengine_get_many_value_sizes(retptr, this.__wbg_ptr, tx_id, ptr0, len0, ptr1, len1);
|
|
505
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
506
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
507
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
508
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
509
|
+
if (r3) {
|
|
510
|
+
throw takeObject(r2);
|
|
511
|
+
}
|
|
512
|
+
var v3 = getArrayU32FromWasm0(r0, r1).slice();
|
|
513
|
+
wasm.__wbindgen_export4(r0, r1 * 4, 4);
|
|
514
|
+
return v3;
|
|
515
|
+
} finally {
|
|
516
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
/**
|
|
520
|
+
* Returns count followed by 32-byte rows: flags, expiry, epoch, ordinal, max length.
|
|
521
|
+
* @param {bigint} tx_id
|
|
522
|
+
* @param {string} store
|
|
523
|
+
* @param {Uint8Array} keys
|
|
524
|
+
* @returns {Uint8Array}
|
|
525
|
+
*/
|
|
526
|
+
get_many_value_states(tx_id, store, keys) {
|
|
527
|
+
try {
|
|
528
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
529
|
+
const ptr0 = passStringToWasm0(store, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
530
|
+
const len0 = WASM_VECTOR_LEN;
|
|
531
|
+
const ptr1 = passArray8ToWasm0(keys, wasm.__wbindgen_export);
|
|
532
|
+
const len1 = WASM_VECTOR_LEN;
|
|
533
|
+
wasm.wasmengine_get_many_value_states(retptr, this.__wbg_ptr, tx_id, ptr0, len0, ptr1, len1);
|
|
534
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
535
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
536
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
537
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
538
|
+
if (r3) {
|
|
539
|
+
throw takeObject(r2);
|
|
540
|
+
}
|
|
541
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
542
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
543
|
+
return v3;
|
|
544
|
+
} finally {
|
|
545
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
546
|
+
}
|
|
547
|
+
}
|
|
474
548
|
/**
|
|
475
549
|
* @returns {bigint}
|
|
476
550
|
*/
|
|
@@ -644,11 +718,9 @@ export class WasmEngine {
|
|
|
644
718
|
* @returns {Promise<void>}
|
|
645
719
|
*/
|
|
646
720
|
openGeneration(name, generation_name, options) {
|
|
647
|
-
const ptr0 = passStringToWasm0(
|
|
721
|
+
const ptr0 = passStringToWasm0(generation_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
648
722
|
const len0 = WASM_VECTOR_LEN;
|
|
649
|
-
const
|
|
650
|
-
const len1 = WASM_VECTOR_LEN;
|
|
651
|
-
const ret = wasm.wasmengine_openGeneration(this.__wbg_ptr, ptr0, len0, ptr1, len1, addHeapObject(options));
|
|
723
|
+
const ret = wasm.wasmengine_openGeneration(this.__wbg_ptr, addHeapObject(name), ptr0, len0, addHeapObject(options));
|
|
652
724
|
return takeObject(ret);
|
|
653
725
|
}
|
|
654
726
|
/**
|
|
@@ -657,11 +729,33 @@ export class WasmEngine {
|
|
|
657
729
|
* @returns {Promise<void>}
|
|
658
730
|
*/
|
|
659
731
|
open(name, options) {
|
|
660
|
-
const
|
|
661
|
-
const len0 = WASM_VECTOR_LEN;
|
|
662
|
-
const ret = wasm.wasmengine_open(this.__wbg_ptr, ptr0, len0, addHeapObject(options));
|
|
732
|
+
const ret = wasm.wasmengine_open(this.__wbg_ptr, addHeapObject(name), addHeapObject(options));
|
|
663
733
|
return takeObject(ret);
|
|
664
734
|
}
|
|
735
|
+
/**
|
|
736
|
+
* @param {bigint} tx_id
|
|
737
|
+
* @param {string} store
|
|
738
|
+
* @param {any} range
|
|
739
|
+
* @param {boolean} keys_only
|
|
740
|
+
* @returns {number}
|
|
741
|
+
*/
|
|
742
|
+
open_scan_cursor(tx_id, store, range, keys_only) {
|
|
743
|
+
try {
|
|
744
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
745
|
+
const ptr0 = passStringToWasm0(store, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
746
|
+
const len0 = WASM_VECTOR_LEN;
|
|
747
|
+
wasm.wasmengine_open_scan_cursor(retptr, this.__wbg_ptr, tx_id, ptr0, len0, addHeapObject(range), keys_only);
|
|
748
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
749
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
750
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
751
|
+
if (r2) {
|
|
752
|
+
throw takeObject(r1);
|
|
753
|
+
}
|
|
754
|
+
return r0 >>> 0;
|
|
755
|
+
} finally {
|
|
756
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
757
|
+
}
|
|
758
|
+
}
|
|
665
759
|
/**
|
|
666
760
|
* @param {bigint} tx_id
|
|
667
761
|
* @param {string} store
|
|
@@ -691,6 +785,36 @@ export class WasmEngine {
|
|
|
691
785
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
692
786
|
}
|
|
693
787
|
}
|
|
788
|
+
/**
|
|
789
|
+
* @param {bigint} tx_id
|
|
790
|
+
* @param {string} primary_store
|
|
791
|
+
* @param {string} index_store
|
|
792
|
+
* @param {Uint8Array} primary_key
|
|
793
|
+
* @param {Uint8Array} index_key
|
|
794
|
+
* @param {bigint} expected_epoch
|
|
795
|
+
* @param {bigint} expected_ordinal
|
|
796
|
+
*/
|
|
797
|
+
put_index_entry_checked(tx_id, primary_store, index_store, primary_key, index_key, expected_epoch, expected_ordinal) {
|
|
798
|
+
try {
|
|
799
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
800
|
+
const ptr0 = passStringToWasm0(primary_store, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
801
|
+
const len0 = WASM_VECTOR_LEN;
|
|
802
|
+
const ptr1 = passStringToWasm0(index_store, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
803
|
+
const len1 = WASM_VECTOR_LEN;
|
|
804
|
+
const ptr2 = passArray8ToWasm0(primary_key, wasm.__wbindgen_export);
|
|
805
|
+
const len2 = WASM_VECTOR_LEN;
|
|
806
|
+
const ptr3 = passArray8ToWasm0(index_key, wasm.__wbindgen_export);
|
|
807
|
+
const len3 = WASM_VECTOR_LEN;
|
|
808
|
+
wasm.wasmengine_put_index_entry_checked(retptr, this.__wbg_ptr, tx_id, ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3, expected_epoch, expected_ordinal);
|
|
809
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
810
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
811
|
+
if (r1) {
|
|
812
|
+
throw takeObject(r0);
|
|
813
|
+
}
|
|
814
|
+
} finally {
|
|
815
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
816
|
+
}
|
|
817
|
+
}
|
|
694
818
|
/**
|
|
695
819
|
* @param {bigint} tx_id
|
|
696
820
|
* @param {string} store
|
|
@@ -715,6 +839,38 @@ export class WasmEngine {
|
|
|
715
839
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
716
840
|
}
|
|
717
841
|
}
|
|
842
|
+
/**
|
|
843
|
+
* Returns one baseline byte per completed row. A failed row can have
|
|
844
|
+
* staged writes and is excluded from the error's partial outcomes.
|
|
845
|
+
* @param {bigint} tx_id
|
|
846
|
+
* @param {string} store
|
|
847
|
+
* @param {Uint8Array} entries
|
|
848
|
+
* @param {any} index_ops
|
|
849
|
+
* @param {any} options
|
|
850
|
+
* @returns {Uint8Array}
|
|
851
|
+
*/
|
|
852
|
+
put_many_indexed_packed(tx_id, store, entries, index_ops, options) {
|
|
853
|
+
try {
|
|
854
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
855
|
+
const ptr0 = passStringToWasm0(store, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
856
|
+
const len0 = WASM_VECTOR_LEN;
|
|
857
|
+
const ptr1 = passArray8ToWasm0(entries, wasm.__wbindgen_export);
|
|
858
|
+
const len1 = WASM_VECTOR_LEN;
|
|
859
|
+
wasm.wasmengine_put_many_indexed_packed(retptr, this.__wbg_ptr, tx_id, ptr0, len0, ptr1, len1, addHeapObject(index_ops), addHeapObject(options));
|
|
860
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
861
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
862
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
863
|
+
var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);
|
|
864
|
+
if (r3) {
|
|
865
|
+
throw takeObject(r2);
|
|
866
|
+
}
|
|
867
|
+
var v3 = getArrayU8FromWasm0(r0, r1).slice();
|
|
868
|
+
wasm.__wbindgen_export4(r0, r1 * 1, 1);
|
|
869
|
+
return v3;
|
|
870
|
+
} finally {
|
|
871
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
872
|
+
}
|
|
873
|
+
}
|
|
718
874
|
/**
|
|
719
875
|
* Returns one byte per entry: 1 if the key existed before the put.
|
|
720
876
|
* @param {bigint} tx_id
|
|
@@ -820,6 +976,27 @@ export class WasmEngine {
|
|
|
820
976
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
821
977
|
}
|
|
822
978
|
}
|
|
979
|
+
/**
|
|
980
|
+
* @param {number} cursor_id
|
|
981
|
+
* @param {number} max_rows
|
|
982
|
+
* @param {number} max_bytes
|
|
983
|
+
* @returns {any}
|
|
984
|
+
*/
|
|
985
|
+
scan_cursor_next(cursor_id, max_rows, max_bytes) {
|
|
986
|
+
try {
|
|
987
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
988
|
+
wasm.wasmengine_scan_cursor_next(retptr, this.__wbg_ptr, cursor_id, max_rows, max_bytes);
|
|
989
|
+
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
990
|
+
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
991
|
+
var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
|
|
992
|
+
if (r2) {
|
|
993
|
+
throw takeObject(r1);
|
|
994
|
+
}
|
|
995
|
+
return takeObject(r0);
|
|
996
|
+
} finally {
|
|
997
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
998
|
+
}
|
|
999
|
+
}
|
|
823
1000
|
/**
|
|
824
1001
|
* @param {bigint} tx_id
|
|
825
1002
|
* @param {any} policy
|
|
@@ -917,9 +1094,7 @@ export function buildProfile() {
|
|
|
917
1094
|
* @returns {Promise<void>}
|
|
918
1095
|
*/
|
|
919
1096
|
export function cleanupInactiveEntries(name) {
|
|
920
|
-
const
|
|
921
|
-
const len0 = WASM_VECTOR_LEN;
|
|
922
|
-
const ret = wasm.cleanupInactiveEntries(ptr0, len0);
|
|
1097
|
+
const ret = wasm.cleanupInactiveEntries(addHeapObject(name));
|
|
923
1098
|
return takeObject(ret);
|
|
924
1099
|
}
|
|
925
1100
|
|
|
@@ -928,9 +1103,7 @@ export function cleanupInactiveEntries(name) {
|
|
|
928
1103
|
* @returns {Promise<number>}
|
|
929
1104
|
*/
|
|
930
1105
|
export function dbDirectorySize(name) {
|
|
931
|
-
const
|
|
932
|
-
const len0 = WASM_VECTOR_LEN;
|
|
933
|
-
const ret = wasm.dbDirectorySize(ptr0, len0);
|
|
1106
|
+
const ret = wasm.dbDirectorySize(addHeapObject(name));
|
|
934
1107
|
return takeObject(ret);
|
|
935
1108
|
}
|
|
936
1109
|
|
|
@@ -939,9 +1112,7 @@ export function dbDirectorySize(name) {
|
|
|
939
1112
|
* @returns {Promise<void>}
|
|
940
1113
|
*/
|
|
941
1114
|
export function deleteDB(name) {
|
|
942
|
-
const
|
|
943
|
-
const len0 = WASM_VECTOR_LEN;
|
|
944
|
-
const ret = wasm.deleteDB(ptr0, len0);
|
|
1115
|
+
const ret = wasm.deleteDB(addHeapObject(name));
|
|
945
1116
|
return takeObject(ret);
|
|
946
1117
|
}
|
|
947
1118
|
|
|
@@ -950,9 +1121,7 @@ export function deleteDB(name) {
|
|
|
950
1121
|
* @returns {Promise<any>}
|
|
951
1122
|
*/
|
|
952
1123
|
export function prepareRebuildTarget(name) {
|
|
953
|
-
const
|
|
954
|
-
const len0 = WASM_VECTOR_LEN;
|
|
955
|
-
const ret = wasm.prepareRebuildTarget(ptr0, len0);
|
|
1124
|
+
const ret = wasm.prepareRebuildTarget(addHeapObject(name));
|
|
956
1125
|
return takeObject(ret);
|
|
957
1126
|
}
|
|
958
1127
|
|
|
@@ -964,9 +1133,7 @@ export function prepareRebuildTarget(name) {
|
|
|
964
1133
|
* @returns {Promise<any>}
|
|
965
1134
|
*/
|
|
966
1135
|
export function readActiveGeneration(name) {
|
|
967
|
-
const
|
|
968
|
-
const len0 = WASM_VECTOR_LEN;
|
|
969
|
-
const ret = wasm.readActiveGeneration(ptr0, len0);
|
|
1136
|
+
const ret = wasm.readActiveGeneration(addHeapObject(name));
|
|
970
1137
|
return takeObject(ret);
|
|
971
1138
|
}
|
|
972
1139
|
|
|
@@ -980,13 +1147,11 @@ export function readActiveGeneration(name) {
|
|
|
980
1147
|
* @returns {Promise<void>}
|
|
981
1148
|
*/
|
|
982
1149
|
export function swapActiveGeneration(name, generation_name, expected_current) {
|
|
983
|
-
const ptr0 = passStringToWasm0(
|
|
1150
|
+
const ptr0 = passStringToWasm0(generation_name, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
984
1151
|
const len0 = WASM_VECTOR_LEN;
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
var len2 = WASM_VECTOR_LEN;
|
|
989
|
-
const ret = wasm.swapActiveGeneration(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
1152
|
+
var ptr1 = isLikeNone(expected_current) ? 0 : passStringToWasm0(expected_current, wasm.__wbindgen_export, wasm.__wbindgen_export2);
|
|
1153
|
+
var len1 = WASM_VECTOR_LEN;
|
|
1154
|
+
const ret = wasm.swapActiveGeneration(addHeapObject(name), ptr0, len0, ptr1, len1);
|
|
990
1155
|
return takeObject(ret);
|
|
991
1156
|
}
|
|
992
1157
|
function __wbg_get_imports() {
|
|
@@ -1086,6 +1251,10 @@ function __wbg_get_imports() {
|
|
|
1086
1251
|
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
1087
1252
|
return addHeapObject(ret);
|
|
1088
1253
|
}, arguments); },
|
|
1254
|
+
__wbg_charCodeAt_90635349fbda9f5f: function(arg0, arg1) {
|
|
1255
|
+
const ret = getObject(arg0).charCodeAt(arg1 >>> 0);
|
|
1256
|
+
return ret;
|
|
1257
|
+
},
|
|
1089
1258
|
__wbg_done_cffed884d87aa22e: function(arg0) {
|
|
1090
1259
|
const ret = getObject(arg0).done;
|
|
1091
1260
|
return ret;
|
|
@@ -1168,6 +1337,10 @@ function __wbg_get_imports() {
|
|
|
1168
1337
|
const ret = getObject(arg0).length;
|
|
1169
1338
|
return ret;
|
|
1170
1339
|
},
|
|
1340
|
+
__wbg_length_d52ee452c5be0c99: function(arg0) {
|
|
1341
|
+
const ret = getObject(arg0).length;
|
|
1342
|
+
return ret;
|
|
1343
|
+
},
|
|
1171
1344
|
__wbg_new_1da3429bc3c4541c: function(arg0) {
|
|
1172
1345
|
const ret = new Uint8Array(getObject(arg0));
|
|
1173
1346
|
return addHeapObject(ret);
|
|
@@ -1191,7 +1364,7 @@ function __wbg_get_imports() {
|
|
|
1191
1364
|
const a = state0.a;
|
|
1192
1365
|
state0.a = 0;
|
|
1193
1366
|
try {
|
|
1194
|
-
return
|
|
1367
|
+
return __wasm_bindgen_func_elem_916(a, state0.b, arg0, arg1);
|
|
1195
1368
|
} finally {
|
|
1196
1369
|
state0.a = a;
|
|
1197
1370
|
}
|
|
@@ -1218,53 +1391,53 @@ function __wbg_get_imports() {
|
|
|
1218
1391
|
const ret = Date.now();
|
|
1219
1392
|
return ret;
|
|
1220
1393
|
},
|
|
1221
|
-
|
|
1394
|
+
__wbg_opfsAppendOffset_079e62a0918675a3: function() { return handleError(function (arg0, arg1) {
|
|
1222
1395
|
const ret = opfsAppendOffset(arg0 >>> 0, arg1 >>> 0);
|
|
1223
1396
|
return ret;
|
|
1224
1397
|
}, arguments) ?? 0n; },
|
|
1225
|
-
|
|
1398
|
+
__wbg_opfsCleanupInactiveEntries_c6bf5d2d14dfe20d: function() { return handleError(function (arg0, arg1) {
|
|
1226
1399
|
const ret = opfsCleanupInactiveEntries(getStringFromWasm0(arg0, arg1));
|
|
1227
1400
|
return addHeapObject(ret);
|
|
1228
1401
|
}, arguments); },
|
|
1229
|
-
|
|
1402
|
+
__wbg_opfsCloseSession_c5985f72939c3aba: function() { return handleError(function (arg0) {
|
|
1230
1403
|
opfsCloseSession(arg0 >>> 0);
|
|
1231
1404
|
}, arguments); },
|
|
1232
|
-
|
|
1405
|
+
__wbg_opfsDbDirectorySize_4ed1accc247da9a5: function() { return handleError(function (arg0, arg1) {
|
|
1233
1406
|
const ret = opfsDbDirectorySize(getStringFromWasm0(arg0, arg1));
|
|
1234
1407
|
return addHeapObject(ret);
|
|
1235
1408
|
}, arguments); },
|
|
1236
|
-
|
|
1409
|
+
__wbg_opfsFlush_b002f278c816006a: function() { return handleError(function (arg0, arg1) {
|
|
1237
1410
|
opfsFlush(arg0 >>> 0, arg1 >>> 0);
|
|
1238
1411
|
}, arguments); },
|
|
1239
|
-
|
|
1412
|
+
__wbg_opfsLen_043f6eaf60974132: function() { return handleError(function (arg0, arg1) {
|
|
1240
1413
|
const ret = opfsLen(arg0 >>> 0, arg1 >>> 0);
|
|
1241
1414
|
return ret;
|
|
1242
1415
|
}, arguments) ?? 0n; },
|
|
1243
|
-
|
|
1416
|
+
__wbg_opfsOpenActiveDb_ef3b8f86c1e64ae9: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1244
1417
|
const ret = opfsOpenActiveDb(getStringFromWasm0(arg0, arg1), arg2 !== 0);
|
|
1245
1418
|
return addHeapObject(ret);
|
|
1246
1419
|
}, arguments); },
|
|
1247
|
-
|
|
1420
|
+
__wbg_opfsOpenGenerationDb_93d8ee20c6777ffc: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
1248
1421
|
const ret = opfsOpenGenerationDb(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), arg4 !== 0);
|
|
1249
1422
|
return addHeapObject(ret);
|
|
1250
1423
|
}, arguments); },
|
|
1251
|
-
|
|
1424
|
+
__wbg_opfsPrepareRebuildTarget_8de6202cb70e0cdb: function() { return handleError(function (arg0, arg1) {
|
|
1252
1425
|
const ret = opfsPrepareRebuildTarget(getStringFromWasm0(arg0, arg1));
|
|
1253
1426
|
return addHeapObject(ret);
|
|
1254
1427
|
}, arguments); },
|
|
1255
|
-
|
|
1428
|
+
__wbg_opfsReadActiveGeneration_671461e389e1c678: function() { return handleError(function (arg0, arg1) {
|
|
1256
1429
|
const ret = opfsReadActiveGeneration(getStringFromWasm0(arg0, arg1));
|
|
1257
1430
|
return addHeapObject(ret);
|
|
1258
1431
|
}, arguments); },
|
|
1259
|
-
|
|
1432
|
+
__wbg_opfsReadAtInto_43f6bbc2f7887ae6: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
1260
1433
|
const ret = opfsReadAtInto(arg0 >>> 0, arg1 >>> 0, BigInt.asUintN(64, arg2), getArrayU8FromWasm0(arg3, arg4));
|
|
1261
1434
|
return ret;
|
|
1262
1435
|
}, arguments); },
|
|
1263
|
-
|
|
1436
|
+
__wbg_opfsRemoveDb_52e0544241d6db70: function() { return handleError(function (arg0, arg1) {
|
|
1264
1437
|
const ret = opfsRemoveDb(getStringFromWasm0(arg0, arg1));
|
|
1265
1438
|
return addHeapObject(ret);
|
|
1266
1439
|
}, arguments); },
|
|
1267
|
-
|
|
1440
|
+
__wbg_opfsSwapActiveGeneration_19bf7e9afad80e65: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4, arg5) {
|
|
1268
1441
|
let v0;
|
|
1269
1442
|
if (arg4 !== 0) {
|
|
1270
1443
|
v0 = getStringFromWasm0(arg4, arg5);
|
|
@@ -1273,10 +1446,10 @@ function __wbg_get_imports() {
|
|
|
1273
1446
|
const ret = opfsSwapActiveGeneration(getStringFromWasm0(arg0, arg1), getStringFromWasm0(arg2, arg3), v0);
|
|
1274
1447
|
return addHeapObject(ret);
|
|
1275
1448
|
}, arguments); },
|
|
1276
|
-
|
|
1449
|
+
__wbg_opfsTruncate_ca91ef811dec439a: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1277
1450
|
opfsTruncate(arg0 >>> 0, arg1 >>> 0, BigInt.asUintN(64, arg2));
|
|
1278
1451
|
}, arguments); },
|
|
1279
|
-
|
|
1452
|
+
__wbg_opfsWriteAt_b134ceb0781d605b: function() { return handleError(function (arg0, arg1, arg2, arg3, arg4) {
|
|
1280
1453
|
const ret = opfsWriteAt(arg0 >>> 0, arg1 >>> 0, BigInt.asUintN(64, arg2), getArrayU8FromWasm0(arg3, arg4));
|
|
1281
1454
|
return ret;
|
|
1282
1455
|
}, arguments); },
|
|
@@ -1333,8 +1506,8 @@ function __wbg_get_imports() {
|
|
|
1333
1506
|
return addHeapObject(ret);
|
|
1334
1507
|
},
|
|
1335
1508
|
__wbindgen_generic_0000000000000001: function(arg0, arg1) {
|
|
1336
|
-
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx:
|
|
1337
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
1509
|
+
// Cast intrinsic for `Closure(Closure { owned: true, function: Function { arguments: [Externref], shim_idx: 113, ret: Result(Unit), inner_ret: Some(Result(Unit)) }, mutable: true }) -> Externref`.
|
|
1510
|
+
const ret = makeMutClosure(arg0, arg1, __wasm_bindgen_func_elem_901);
|
|
1338
1511
|
return addHeapObject(ret);
|
|
1339
1512
|
},
|
|
1340
1513
|
__wbindgen_generic_0000000000000002: function(arg0) {
|
|
@@ -1376,14 +1549,14 @@ function __wbg_get_imports() {
|
|
|
1376
1549
|
};
|
|
1377
1550
|
}
|
|
1378
1551
|
|
|
1379
|
-
function
|
|
1380
|
-
wasm.
|
|
1552
|
+
function __wasm_bindgen_func_elem_916(arg0, arg1, arg2, arg3) {
|
|
1553
|
+
wasm.__wasm_bindgen_func_elem_916(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
1381
1554
|
}
|
|
1382
1555
|
|
|
1383
|
-
function
|
|
1556
|
+
function __wasm_bindgen_func_elem_901(arg0, arg1, arg2) {
|
|
1384
1557
|
try {
|
|
1385
1558
|
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
1386
|
-
wasm.
|
|
1559
|
+
wasm.__wasm_bindgen_func_elem_901(retptr, arg0, arg1, addHeapObject(arg2));
|
|
1387
1560
|
var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
|
|
1388
1561
|
var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
|
|
1389
1562
|
if (r1) {
|
|
@@ -1488,6 +1661,11 @@ function dropObject(idx) {
|
|
|
1488
1661
|
heap_next = idx;
|
|
1489
1662
|
}
|
|
1490
1663
|
|
|
1664
|
+
function getArrayU32FromWasm0(ptr, len) {
|
|
1665
|
+
ptr = ptr >>> 0;
|
|
1666
|
+
return getUint32ArrayMemory0().subarray(ptr / 4, ptr / 4 + len);
|
|
1667
|
+
}
|
|
1668
|
+
|
|
1491
1669
|
function getArrayU8FromWasm0(ptr, len) {
|
|
1492
1670
|
ptr = ptr >>> 0;
|
|
1493
1671
|
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
@@ -1505,6 +1683,14 @@ function getStringFromWasm0(ptr, len) {
|
|
|
1505
1683
|
return decodeText(ptr >>> 0, len);
|
|
1506
1684
|
}
|
|
1507
1685
|
|
|
1686
|
+
let cachedUint32ArrayMemory0 = null;
|
|
1687
|
+
function getUint32ArrayMemory0() {
|
|
1688
|
+
if (cachedUint32ArrayMemory0 === null || cachedUint32ArrayMemory0.byteLength === 0) {
|
|
1689
|
+
cachedUint32ArrayMemory0 = new Uint32Array(wasm.memory.buffer);
|
|
1690
|
+
}
|
|
1691
|
+
return cachedUint32ArrayMemory0;
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1508
1694
|
let cachedUint8ArrayMemory0 = null;
|
|
1509
1695
|
function getUint8ArrayMemory0() {
|
|
1510
1696
|
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
@@ -1645,6 +1831,7 @@ function __wbg_finalize_init(instance, module) {
|
|
|
1645
1831
|
wasm = instance.exports;
|
|
1646
1832
|
wasmModule = module;
|
|
1647
1833
|
cachedDataViewMemory0 = null;
|
|
1834
|
+
cachedUint32ArrayMemory0 = null;
|
|
1648
1835
|
cachedUint8ArrayMemory0 = null;
|
|
1649
1836
|
return wasm;
|
|
1650
1837
|
}
|
|
Binary file
|