@reifydb/wasm 0.4.1 → 0.4.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/package.json
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@reifydb/wasm",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
7
7
|
"dependencies": {
|
|
8
|
-
"@reifydb/core": "0.4.
|
|
8
|
+
"@reifydb/core": "0.4.2"
|
|
9
9
|
},
|
|
10
10
|
"devDependencies": {
|
|
11
11
|
"@types/node": "^24.0.10",
|
package/wasm/package.json
CHANGED
|
@@ -41,6 +41,10 @@ export class WasmDB {
|
|
|
41
41
|
* ```
|
|
42
42
|
*/
|
|
43
43
|
admin(rql: string): any;
|
|
44
|
+
/**
|
|
45
|
+
* Execute an admin operation and return Display-formatted text output
|
|
46
|
+
*/
|
|
47
|
+
adminText(rql: string): string;
|
|
44
48
|
/**
|
|
45
49
|
* Execute admin with JSON parameters
|
|
46
50
|
*/
|
|
@@ -52,6 +56,10 @@ export class WasmDB {
|
|
|
52
56
|
* For DDL operations (CREATE, ALTER), use `admin()` instead.
|
|
53
57
|
*/
|
|
54
58
|
command(rql: string): any;
|
|
59
|
+
/**
|
|
60
|
+
* Execute a command and return Display-formatted text output
|
|
61
|
+
*/
|
|
62
|
+
commandText(rql: string): string;
|
|
55
63
|
/**
|
|
56
64
|
* Execute command with JSON parameters
|
|
57
65
|
*/
|
|
@@ -83,6 +91,10 @@ export class WasmDB {
|
|
|
83
91
|
* ```
|
|
84
92
|
*/
|
|
85
93
|
query(rql: string): any;
|
|
94
|
+
/**
|
|
95
|
+
* Execute a query and return Display-formatted text output
|
|
96
|
+
*/
|
|
97
|
+
queryText(rql: string): string;
|
|
86
98
|
/**
|
|
87
99
|
* Execute query with JSON parameters
|
|
88
100
|
*
|
|
@@ -76,6 +76,31 @@ export class WasmDB {
|
|
|
76
76
|
}
|
|
77
77
|
return takeFromExternrefTable0(ret[0]);
|
|
78
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* Execute an admin operation and return Display-formatted text output
|
|
81
|
+
* @param {string} rql
|
|
82
|
+
* @returns {string}
|
|
83
|
+
*/
|
|
84
|
+
adminText(rql) {
|
|
85
|
+
let deferred3_0;
|
|
86
|
+
let deferred3_1;
|
|
87
|
+
try {
|
|
88
|
+
const ptr0 = passStringToWasm0(rql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
89
|
+
const len0 = WASM_VECTOR_LEN;
|
|
90
|
+
const ret = wasm.wasmdb_adminText(this.__wbg_ptr, ptr0, len0);
|
|
91
|
+
var ptr2 = ret[0];
|
|
92
|
+
var len2 = ret[1];
|
|
93
|
+
if (ret[3]) {
|
|
94
|
+
ptr2 = 0; len2 = 0;
|
|
95
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
96
|
+
}
|
|
97
|
+
deferred3_0 = ptr2;
|
|
98
|
+
deferred3_1 = len2;
|
|
99
|
+
return getStringFromWasm0(ptr2, len2);
|
|
100
|
+
} finally {
|
|
101
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
79
104
|
/**
|
|
80
105
|
* Execute admin with JSON parameters
|
|
81
106
|
* @param {string} rql
|
|
@@ -108,6 +133,31 @@ export class WasmDB {
|
|
|
108
133
|
}
|
|
109
134
|
return takeFromExternrefTable0(ret[0]);
|
|
110
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Execute a command and return Display-formatted text output
|
|
138
|
+
* @param {string} rql
|
|
139
|
+
* @returns {string}
|
|
140
|
+
*/
|
|
141
|
+
commandText(rql) {
|
|
142
|
+
let deferred3_0;
|
|
143
|
+
let deferred3_1;
|
|
144
|
+
try {
|
|
145
|
+
const ptr0 = passStringToWasm0(rql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
146
|
+
const len0 = WASM_VECTOR_LEN;
|
|
147
|
+
const ret = wasm.wasmdb_commandText(this.__wbg_ptr, ptr0, len0);
|
|
148
|
+
var ptr2 = ret[0];
|
|
149
|
+
var len2 = ret[1];
|
|
150
|
+
if (ret[3]) {
|
|
151
|
+
ptr2 = 0; len2 = 0;
|
|
152
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
153
|
+
}
|
|
154
|
+
deferred3_0 = ptr2;
|
|
155
|
+
deferred3_1 = len2;
|
|
156
|
+
return getStringFromWasm0(ptr2, len2);
|
|
157
|
+
} finally {
|
|
158
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
111
161
|
/**
|
|
112
162
|
* Execute command with JSON parameters
|
|
113
163
|
* @param {string} rql
|
|
@@ -168,6 +218,31 @@ export class WasmDB {
|
|
|
168
218
|
}
|
|
169
219
|
return takeFromExternrefTable0(ret[0]);
|
|
170
220
|
}
|
|
221
|
+
/**
|
|
222
|
+
* Execute a query and return Display-formatted text output
|
|
223
|
+
* @param {string} rql
|
|
224
|
+
* @returns {string}
|
|
225
|
+
*/
|
|
226
|
+
queryText(rql) {
|
|
227
|
+
let deferred3_0;
|
|
228
|
+
let deferred3_1;
|
|
229
|
+
try {
|
|
230
|
+
const ptr0 = passStringToWasm0(rql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
231
|
+
const len0 = WASM_VECTOR_LEN;
|
|
232
|
+
const ret = wasm.wasmdb_queryText(this.__wbg_ptr, ptr0, len0);
|
|
233
|
+
var ptr2 = ret[0];
|
|
234
|
+
var len2 = ret[1];
|
|
235
|
+
if (ret[3]) {
|
|
236
|
+
ptr2 = 0; len2 = 0;
|
|
237
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
238
|
+
}
|
|
239
|
+
deferred3_0 = ptr2;
|
|
240
|
+
deferred3_1 = len2;
|
|
241
|
+
return getStringFromWasm0(ptr2, len2);
|
|
242
|
+
} finally {
|
|
243
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
171
246
|
/**
|
|
172
247
|
* Execute query with JSON parameters
|
|
173
248
|
*
|
|
@@ -194,13 +269,6 @@ export class WasmDB {
|
|
|
194
269
|
}
|
|
195
270
|
}
|
|
196
271
|
if (Symbol.dispose) WasmDB.prototype[Symbol.dispose] = WasmDB.prototype.free;
|
|
197
|
-
export function __wbg___wbindgen_debug_string_0bc8482c6e3508ae(arg0, arg1) {
|
|
198
|
-
const ret = debugString(arg1);
|
|
199
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
200
|
-
const len1 = WASM_VECTOR_LEN;
|
|
201
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
202
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
203
|
-
}
|
|
204
272
|
export function __wbg___wbindgen_is_null_ac34f5003991759a(arg0) {
|
|
205
273
|
const ret = arg0 === null;
|
|
206
274
|
return ret;
|
|
@@ -224,8 +292,8 @@ export function __wbg_call_389efe28435a9388() { return handleError(function (arg
|
|
|
224
292
|
const ret = arg0.call(arg1);
|
|
225
293
|
return ret;
|
|
226
294
|
}, arguments); }
|
|
227
|
-
export function
|
|
228
|
-
|
|
295
|
+
export function __wbg_clearInterval_b7b60b3b939a3e0d(arg0) {
|
|
296
|
+
clearInterval(arg0);
|
|
229
297
|
}
|
|
230
298
|
export function __wbg_error_7534b8e9a36f1ab4(arg0, arg1) {
|
|
231
299
|
let deferred0_0;
|
|
@@ -254,10 +322,6 @@ export function __wbg_instanceof_Window_ed49b2db8df90359(arg0) {
|
|
|
254
322
|
const ret = result;
|
|
255
323
|
return ret;
|
|
256
324
|
}
|
|
257
|
-
export function __wbg_length_32ed9a279acd054c(arg0) {
|
|
258
|
-
const ret = arg0.length;
|
|
259
|
-
return ret;
|
|
260
|
-
}
|
|
261
325
|
export function __wbg_log_6b5ca2e6124b2808(arg0) {
|
|
262
326
|
console.log(arg0);
|
|
263
327
|
}
|
|
@@ -277,10 +341,6 @@ export function __wbg_new_no_args_1c7c842f08d00ebb(arg0, arg1) {
|
|
|
277
341
|
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
278
342
|
return ret;
|
|
279
343
|
}
|
|
280
|
-
export function __wbg_new_with_length_a2c39cbe88fd8ff1(arg0) {
|
|
281
|
-
const ret = new Uint8Array(arg0 >>> 0);
|
|
282
|
-
return ret;
|
|
283
|
-
}
|
|
284
344
|
export function __wbg_now_37839916ec63896b() { return handleError(function () {
|
|
285
345
|
const ret = Date.now();
|
|
286
346
|
return ret;
|
|
@@ -289,25 +349,30 @@ export function __wbg_now_a3af9a2f4bbaa4d1() {
|
|
|
289
349
|
const ret = Date.now();
|
|
290
350
|
return ret;
|
|
291
351
|
}
|
|
352
|
+
export function __wbg_now_ebffdf7e580f210d(arg0) {
|
|
353
|
+
const ret = arg0.now();
|
|
354
|
+
return ret;
|
|
355
|
+
}
|
|
356
|
+
export function __wbg_performance_06f12ba62483475d(arg0) {
|
|
357
|
+
const ret = arg0.performance;
|
|
358
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
359
|
+
}
|
|
292
360
|
export function __wbg_push_8ffdcb2063340ba5(arg0, arg1) {
|
|
293
361
|
const ret = arg0.push(arg1);
|
|
294
362
|
return ret;
|
|
295
363
|
}
|
|
296
|
-
export function
|
|
297
|
-
const ret =
|
|
364
|
+
export function __wbg_setInterval_ab894f21d858a133(arg0, arg1) {
|
|
365
|
+
const ret = setInterval(arg0, arg1);
|
|
298
366
|
return ret;
|
|
299
|
-
}
|
|
300
|
-
export function
|
|
301
|
-
const ret =
|
|
367
|
+
}
|
|
368
|
+
export function __wbg_setTimeout_7702ef22255da2d5(arg0, arg1) {
|
|
369
|
+
const ret = setTimeout(arg0, arg1);
|
|
302
370
|
return ret;
|
|
303
|
-
}
|
|
371
|
+
}
|
|
304
372
|
export function __wbg_set_6cb8631f80447a67() { return handleError(function (arg0, arg1, arg2) {
|
|
305
373
|
const ret = Reflect.set(arg0, arg1, arg2);
|
|
306
374
|
return ret;
|
|
307
375
|
}, arguments); }
|
|
308
|
-
export function __wbg_set_cc56eefd2dd91957(arg0, arg1, arg2) {
|
|
309
|
-
arg0.set(getArrayU8FromWasm0(arg1, arg2));
|
|
310
|
-
}
|
|
311
376
|
export function __wbg_stack_0ed75d68575b0f3c(arg0, arg1) {
|
|
312
377
|
const ret = arg1.stack;
|
|
313
378
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -336,16 +401,11 @@ export function __wbg_stringify_8d1cc6ff383e8bae() { return handleError(function
|
|
|
336
401
|
return ret;
|
|
337
402
|
}, arguments); }
|
|
338
403
|
export function __wbindgen_cast_0000000000000001(arg0, arg1) {
|
|
339
|
-
// Cast intrinsic for `Closure(Closure { dtor_idx:
|
|
340
|
-
const ret = makeMutClosure(arg0, arg1, wasm.
|
|
404
|
+
// Cast intrinsic for `Closure(Closure { dtor_idx: 2561, function: Function { arguments: [], shim_idx: 2562, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`.
|
|
405
|
+
const ret = makeMutClosure(arg0, arg1, wasm.wasm_bindgen__closure__destroy__h975cc9e2fa1a0ad4, wasm_bindgen__convert__closures_____invoke__h0facaf7b2541447d);
|
|
341
406
|
return ret;
|
|
342
407
|
}
|
|
343
|
-
export function __wbindgen_cast_0000000000000002(arg0) {
|
|
344
|
-
// Cast intrinsic for `F64 -> Externref`.
|
|
345
|
-
const ret = arg0;
|
|
346
|
-
return ret;
|
|
347
|
-
}
|
|
348
|
-
export function __wbindgen_cast_0000000000000003(arg0, arg1) {
|
|
408
|
+
export function __wbindgen_cast_0000000000000002(arg0, arg1) {
|
|
349
409
|
// Cast intrinsic for `Ref(String) -> Externref`.
|
|
350
410
|
const ret = getStringFromWasm0(arg0, arg1);
|
|
351
411
|
return ret;
|
|
@@ -359,8 +419,8 @@ export function __wbindgen_init_externref_table() {
|
|
|
359
419
|
table.set(offset + 2, true);
|
|
360
420
|
table.set(offset + 3, false);
|
|
361
421
|
}
|
|
362
|
-
function
|
|
363
|
-
wasm.
|
|
422
|
+
function wasm_bindgen__convert__closures_____invoke__h0facaf7b2541447d(arg0, arg1) {
|
|
423
|
+
wasm.wasm_bindgen__convert__closures_____invoke__h0facaf7b2541447d(arg0, arg1);
|
|
364
424
|
}
|
|
365
425
|
|
|
366
426
|
const JsErrorFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -380,71 +440,6 @@ const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
|
380
440
|
? { register: () => {}, unregister: () => {} }
|
|
381
441
|
: new FinalizationRegistry(state => state.dtor(state.a, state.b));
|
|
382
442
|
|
|
383
|
-
function debugString(val) {
|
|
384
|
-
// primitive types
|
|
385
|
-
const type = typeof val;
|
|
386
|
-
if (type == 'number' || type == 'boolean' || val == null) {
|
|
387
|
-
return `${val}`;
|
|
388
|
-
}
|
|
389
|
-
if (type == 'string') {
|
|
390
|
-
return `"${val}"`;
|
|
391
|
-
}
|
|
392
|
-
if (type == 'symbol') {
|
|
393
|
-
const description = val.description;
|
|
394
|
-
if (description == null) {
|
|
395
|
-
return 'Symbol';
|
|
396
|
-
} else {
|
|
397
|
-
return `Symbol(${description})`;
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
if (type == 'function') {
|
|
401
|
-
const name = val.name;
|
|
402
|
-
if (typeof name == 'string' && name.length > 0) {
|
|
403
|
-
return `Function(${name})`;
|
|
404
|
-
} else {
|
|
405
|
-
return 'Function';
|
|
406
|
-
}
|
|
407
|
-
}
|
|
408
|
-
// objects
|
|
409
|
-
if (Array.isArray(val)) {
|
|
410
|
-
const length = val.length;
|
|
411
|
-
let debug = '[';
|
|
412
|
-
if (length > 0) {
|
|
413
|
-
debug += debugString(val[0]);
|
|
414
|
-
}
|
|
415
|
-
for(let i = 1; i < length; i++) {
|
|
416
|
-
debug += ', ' + debugString(val[i]);
|
|
417
|
-
}
|
|
418
|
-
debug += ']';
|
|
419
|
-
return debug;
|
|
420
|
-
}
|
|
421
|
-
// Test for built-in
|
|
422
|
-
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
423
|
-
let className;
|
|
424
|
-
if (builtInMatches && builtInMatches.length > 1) {
|
|
425
|
-
className = builtInMatches[1];
|
|
426
|
-
} else {
|
|
427
|
-
// Failed to match the standard '[object ClassName]'
|
|
428
|
-
return toString.call(val);
|
|
429
|
-
}
|
|
430
|
-
if (className == 'Object') {
|
|
431
|
-
// we're a user defined class or Object
|
|
432
|
-
// JSON.stringify avoids problems with cycles, and is generally much
|
|
433
|
-
// easier than looping through ownProperties of `val`.
|
|
434
|
-
try {
|
|
435
|
-
return 'Object(' + JSON.stringify(val) + ')';
|
|
436
|
-
} catch (_) {
|
|
437
|
-
return 'Object';
|
|
438
|
-
}
|
|
439
|
-
}
|
|
440
|
-
// errors
|
|
441
|
-
if (val instanceof Error) {
|
|
442
|
-
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
443
|
-
}
|
|
444
|
-
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
445
|
-
return className;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
443
|
function getArrayU8FromWasm0(ptr, len) {
|
|
449
444
|
ptr = ptr >>> 0;
|
|
450
445
|
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
Binary file
|
|
@@ -3,18 +3,21 @@
|
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
4
|
export const __wbg_wasmdb_free: (a: number, b: number) => void;
|
|
5
5
|
export const wasmdb_admin: (a: number, b: number, c: number) => [number, number, number];
|
|
6
|
+
export const wasmdb_adminText: (a: number, b: number, c: number) => [number, number, number, number];
|
|
6
7
|
export const wasmdb_adminWithParams: (a: number, b: number, c: number, d: any) => [number, number, number];
|
|
7
8
|
export const wasmdb_command: (a: number, b: number, c: number) => [number, number, number];
|
|
9
|
+
export const wasmdb_commandText: (a: number, b: number, c: number) => [number, number, number, number];
|
|
8
10
|
export const wasmdb_commandWithParams: (a: number, b: number, c: number, d: any) => [number, number, number];
|
|
9
11
|
export const wasmdb_new: () => [number, number, number];
|
|
10
12
|
export const wasmdb_query: (a: number, b: number, c: number) => [number, number, number];
|
|
13
|
+
export const wasmdb_queryText: (a: number, b: number, c: number) => [number, number, number, number];
|
|
11
14
|
export const wasmdb_queryWithParams: (a: number, b: number, c: number, d: any) => [number, number, number];
|
|
12
15
|
export const __wbg_jserror_free: (a: number, b: number) => void;
|
|
13
16
|
export const jserror_message: (a: number) => [number, number];
|
|
17
|
+
export const host_log_message: (a: bigint, b: number, c: number, d: number) => void;
|
|
14
18
|
export const host_alloc: (a: number) => number;
|
|
15
19
|
export const host_free: (a: number, b: number) => void;
|
|
16
20
|
export const host_realloc: (a: number, b: number, c: number) => number;
|
|
17
|
-
export const host_log_message: (a: bigint, b: number, c: number, d: number) => void;
|
|
18
21
|
export const test_alloc: (a: number) => number;
|
|
19
22
|
export const test_free: (a: number, b: number) => void;
|
|
20
23
|
export const test_log_message: (a: bigint, b: number, c: number, d: number) => void;
|
|
@@ -27,8 +30,8 @@ export const test_state_prefix: (a: bigint, b: number, c: number, d: number, e:
|
|
|
27
30
|
export const test_state_range: (a: bigint, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number) => number;
|
|
28
31
|
export const test_state_remove: (a: bigint, b: number, c: number, d: number) => number;
|
|
29
32
|
export const test_state_set: (a: bigint, b: number, c: number, d: number, e: number, f: number) => number;
|
|
30
|
-
export const
|
|
31
|
-
export const
|
|
33
|
+
export const wasm_bindgen__closure__destroy__h975cc9e2fa1a0ad4: (a: number, b: number) => void;
|
|
34
|
+
export const wasm_bindgen__convert__closures_____invoke__h0facaf7b2541447d: (a: number, b: number) => void;
|
|
32
35
|
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
33
36
|
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
34
37
|
export const __wbindgen_exn_store: (a: number) => void;
|