@rainlanguage/sqlite-web 0.0.1-alpha.6 → 0.0.1-alpha.8
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 +1 -1
- package/sqlite_web.d.ts +8 -6
- package/sqlite_web.js +162 -12
- package/sqlite_web_bg.wasm +0 -0
package/package.json
CHANGED
package/sqlite_web.d.ts
CHANGED
|
@@ -13,11 +13,13 @@ export class SQLiteWasmDatabase {
|
|
|
13
13
|
/**
|
|
14
14
|
* Create a new database connection with fully embedded worker
|
|
15
15
|
*/
|
|
16
|
-
static new(db_name: string): WasmEncodedResult<SQLiteWasmDatabase
|
|
16
|
+
static new(db_name: string): Promise<WasmEncodedResult<SQLiteWasmDatabase>>;
|
|
17
17
|
/**
|
|
18
|
-
* Execute a SQL query
|
|
18
|
+
* Execute a SQL query (optionally parameterized via JS Array)
|
|
19
|
+
*
|
|
20
|
+
* Passing `undefined`/`null` from JS maps to `None`.
|
|
19
21
|
*/
|
|
20
|
-
query(sql: string): Promise<WasmEncodedResult<string>>;
|
|
22
|
+
query(sql: string, params?: Array<any> | null): Promise<WasmEncodedResult<string>>;
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
@@ -26,15 +28,15 @@ export interface InitOutput {
|
|
|
26
28
|
readonly memory: WebAssembly.Memory;
|
|
27
29
|
readonly __wbg_sqlitewasmdatabase_free: (a: number, b: number) => void;
|
|
28
30
|
readonly sqlitewasmdatabase_new: (a: number, b: number) => any;
|
|
29
|
-
readonly sqlitewasmdatabase_query: (a: number, b: number, c: number) => any;
|
|
31
|
+
readonly sqlitewasmdatabase_query: (a: number, b: number, c: number, d: number) => any;
|
|
30
32
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
31
33
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
32
34
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
33
35
|
readonly __externref_table_alloc: () => number;
|
|
34
36
|
readonly __wbindgen_export_4: WebAssembly.Table;
|
|
35
37
|
readonly __wbindgen_export_5: WebAssembly.Table;
|
|
36
|
-
readonly
|
|
37
|
-
readonly
|
|
38
|
+
readonly closure2_externref_shim: (a: number, b: number, c: any) => void;
|
|
39
|
+
readonly closure25_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
38
40
|
readonly __wbindgen_start: () => void;
|
|
39
41
|
}
|
|
40
42
|
|
package/sqlite_web.js
CHANGED
|
@@ -197,12 +197,12 @@ function debugString(val) {
|
|
|
197
197
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
198
198
|
return className;
|
|
199
199
|
}
|
|
200
|
-
function
|
|
201
|
-
wasm.
|
|
200
|
+
function __wbg_adapter_50(arg0, arg1, arg2) {
|
|
201
|
+
wasm.closure2_externref_shim(arg0, arg1, arg2);
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
function
|
|
205
|
-
wasm.
|
|
204
|
+
function __wbg_adapter_91(arg0, arg1, arg2, arg3) {
|
|
205
|
+
wasm.closure25_externref_shim(arg0, arg1, arg2, arg3);
|
|
206
206
|
}
|
|
207
207
|
|
|
208
208
|
const SQLiteWasmDatabaseFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
@@ -242,14 +242,17 @@ export class SQLiteWasmDatabase {
|
|
|
242
242
|
return ret;
|
|
243
243
|
}
|
|
244
244
|
/**
|
|
245
|
-
* Execute a SQL query
|
|
245
|
+
* Execute a SQL query (optionally parameterized via JS Array)
|
|
246
|
+
*
|
|
247
|
+
* Passing `undefined`/`null` from JS maps to `None`.
|
|
246
248
|
* @param {string} sql
|
|
249
|
+
* @param {Array<any> | null} [params]
|
|
247
250
|
* @returns {WasmEncodedResult<string>}
|
|
248
251
|
*/
|
|
249
|
-
query(sql) {
|
|
252
|
+
query(sql, params) {
|
|
250
253
|
const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
251
254
|
const len0 = WASM_VECTOR_LEN;
|
|
252
|
-
const ret = wasm.sqlitewasmdatabase_query(this.__wbg_ptr, ptr0, len0);
|
|
255
|
+
const ret = wasm.sqlitewasmdatabase_query(this.__wbg_ptr, ptr0, len0, isLikeNone(params) ? 0 : addToExternrefTable0(params));
|
|
253
256
|
return ret;
|
|
254
257
|
}
|
|
255
258
|
}
|
|
@@ -295,6 +298,10 @@ function __wbg_get_imports() {
|
|
|
295
298
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
296
299
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
297
300
|
};
|
|
301
|
+
imports.wbg.__wbg_buffer_609cc3eee51ed158 = function(arg0) {
|
|
302
|
+
const ret = arg0.buffer;
|
|
303
|
+
return ret;
|
|
304
|
+
};
|
|
298
305
|
imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
|
|
299
306
|
const ret = arg0.call(arg1);
|
|
300
307
|
return ret;
|
|
@@ -314,10 +321,72 @@ function __wbg_get_imports() {
|
|
|
314
321
|
const ret = arg0.data;
|
|
315
322
|
return ret;
|
|
316
323
|
};
|
|
324
|
+
imports.wbg.__wbg_done_769e5ede4b31c67b = function(arg0) {
|
|
325
|
+
const ret = arg0.done;
|
|
326
|
+
return ret;
|
|
327
|
+
};
|
|
328
|
+
imports.wbg.__wbg_entries_3265d4158b33e5dc = function(arg0) {
|
|
329
|
+
const ret = Object.entries(arg0);
|
|
330
|
+
return ret;
|
|
331
|
+
};
|
|
317
332
|
imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
|
|
318
333
|
const ret = Reflect.get(arg0, arg1);
|
|
319
334
|
return ret;
|
|
320
335
|
}, arguments) };
|
|
336
|
+
imports.wbg.__wbg_get_b9b93047fe3cf45b = function(arg0, arg1) {
|
|
337
|
+
const ret = arg0[arg1 >>> 0];
|
|
338
|
+
return ret;
|
|
339
|
+
};
|
|
340
|
+
imports.wbg.__wbg_instanceof_ArrayBuffer_e14585432e3737fc = function(arg0) {
|
|
341
|
+
let result;
|
|
342
|
+
try {
|
|
343
|
+
result = arg0 instanceof ArrayBuffer;
|
|
344
|
+
} catch (_) {
|
|
345
|
+
result = false;
|
|
346
|
+
}
|
|
347
|
+
const ret = result;
|
|
348
|
+
return ret;
|
|
349
|
+
};
|
|
350
|
+
imports.wbg.__wbg_instanceof_Map_f3469ce2244d2430 = function(arg0) {
|
|
351
|
+
let result;
|
|
352
|
+
try {
|
|
353
|
+
result = arg0 instanceof Map;
|
|
354
|
+
} catch (_) {
|
|
355
|
+
result = false;
|
|
356
|
+
}
|
|
357
|
+
const ret = result;
|
|
358
|
+
return ret;
|
|
359
|
+
};
|
|
360
|
+
imports.wbg.__wbg_instanceof_Uint8Array_17156bcf118086a9 = function(arg0) {
|
|
361
|
+
let result;
|
|
362
|
+
try {
|
|
363
|
+
result = arg0 instanceof Uint8Array;
|
|
364
|
+
} catch (_) {
|
|
365
|
+
result = false;
|
|
366
|
+
}
|
|
367
|
+
const ret = result;
|
|
368
|
+
return ret;
|
|
369
|
+
};
|
|
370
|
+
imports.wbg.__wbg_isArray_a1eab7e0d067391b = function(arg0) {
|
|
371
|
+
const ret = Array.isArray(arg0);
|
|
372
|
+
return ret;
|
|
373
|
+
};
|
|
374
|
+
imports.wbg.__wbg_isSafeInteger_343e2beeeece1bb0 = function(arg0) {
|
|
375
|
+
const ret = Number.isSafeInteger(arg0);
|
|
376
|
+
return ret;
|
|
377
|
+
};
|
|
378
|
+
imports.wbg.__wbg_iterator_9a24c88df860dc65 = function() {
|
|
379
|
+
const ret = Symbol.iterator;
|
|
380
|
+
return ret;
|
|
381
|
+
};
|
|
382
|
+
imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) {
|
|
383
|
+
const ret = arg0.length;
|
|
384
|
+
return ret;
|
|
385
|
+
};
|
|
386
|
+
imports.wbg.__wbg_length_e2d2a49132c1b256 = function(arg0) {
|
|
387
|
+
const ret = arg0.length;
|
|
388
|
+
return ret;
|
|
389
|
+
};
|
|
321
390
|
imports.wbg.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
|
|
322
391
|
try {
|
|
323
392
|
var state0 = {a: arg0, b: arg1};
|
|
@@ -325,7 +394,7 @@ function __wbg_get_imports() {
|
|
|
325
394
|
const a = state0.a;
|
|
326
395
|
state0.a = 0;
|
|
327
396
|
try {
|
|
328
|
-
return
|
|
397
|
+
return __wbg_adapter_91(a, state0.b, arg0, arg1);
|
|
329
398
|
} finally {
|
|
330
399
|
state0.a = a;
|
|
331
400
|
}
|
|
@@ -344,6 +413,10 @@ function __wbg_get_imports() {
|
|
|
344
413
|
const ret = new Array();
|
|
345
414
|
return ret;
|
|
346
415
|
};
|
|
416
|
+
imports.wbg.__wbg_new_a12002a7f91c75be = function(arg0) {
|
|
417
|
+
const ret = new Uint8Array(arg0);
|
|
418
|
+
return ret;
|
|
419
|
+
};
|
|
347
420
|
imports.wbg.__wbg_new_b1a33e5095abf678 = function() { return handleError(function (arg0, arg1) {
|
|
348
421
|
const ret = new Worker(getStringFromWasm0(arg0, arg1));
|
|
349
422
|
return ret;
|
|
@@ -356,6 +429,14 @@ function __wbg_get_imports() {
|
|
|
356
429
|
const ret = new Blob(arg0, arg1);
|
|
357
430
|
return ret;
|
|
358
431
|
}, arguments) };
|
|
432
|
+
imports.wbg.__wbg_next_25feadfc0913fea9 = function(arg0) {
|
|
433
|
+
const ret = arg0.next;
|
|
434
|
+
return ret;
|
|
435
|
+
};
|
|
436
|
+
imports.wbg.__wbg_next_6574e1a8a62d1055 = function() { return handleError(function (arg0) {
|
|
437
|
+
const ret = arg0.next();
|
|
438
|
+
return ret;
|
|
439
|
+
}, arguments) };
|
|
359
440
|
imports.wbg.__wbg_postMessage_6edafa8f7b9c2f52 = function() { return handleError(function (arg0, arg1) {
|
|
360
441
|
arg0.postMessage(arg1);
|
|
361
442
|
}, arguments) };
|
|
@@ -380,6 +461,9 @@ function __wbg_get_imports() {
|
|
|
380
461
|
imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
381
462
|
arg0[arg1] = arg2;
|
|
382
463
|
};
|
|
464
|
+
imports.wbg.__wbg_set_65595bdd868b3009 = function(arg0, arg1, arg2) {
|
|
465
|
+
arg0.set(arg1, arg2 >>> 0);
|
|
466
|
+
};
|
|
383
467
|
imports.wbg.__wbg_set_bb8cecf6a62b9f46 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
384
468
|
const ret = Reflect.set(arg0, arg1, arg2);
|
|
385
469
|
return ret;
|
|
@@ -418,6 +502,33 @@ function __wbg_get_imports() {
|
|
|
418
502
|
const ret = arg0.then(arg1, arg2);
|
|
419
503
|
return ret;
|
|
420
504
|
};
|
|
505
|
+
imports.wbg.__wbg_toString_b5d4438bc26b267c = function() { return handleError(function (arg0, arg1) {
|
|
506
|
+
const ret = arg0.toString(arg1);
|
|
507
|
+
return ret;
|
|
508
|
+
}, arguments) };
|
|
509
|
+
imports.wbg.__wbg_value_cd1ffa7b1ab794f1 = function(arg0) {
|
|
510
|
+
const ret = arg0.value;
|
|
511
|
+
return ret;
|
|
512
|
+
};
|
|
513
|
+
imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
|
|
514
|
+
const ret = arg0;
|
|
515
|
+
return ret;
|
|
516
|
+
};
|
|
517
|
+
imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
518
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
519
|
+
return ret;
|
|
520
|
+
};
|
|
521
|
+
imports.wbg.__wbindgen_bigint_get_as_i64 = function(arg0, arg1) {
|
|
522
|
+
const v = arg1;
|
|
523
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
524
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
525
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
526
|
+
};
|
|
527
|
+
imports.wbg.__wbindgen_boolean_get = function(arg0) {
|
|
528
|
+
const v = arg0;
|
|
529
|
+
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
530
|
+
return ret;
|
|
531
|
+
};
|
|
421
532
|
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
|
422
533
|
const obj = arg0.original;
|
|
423
534
|
if (obj.cnt-- == 1) {
|
|
@@ -427,12 +538,12 @@ function __wbg_get_imports() {
|
|
|
427
538
|
const ret = false;
|
|
428
539
|
return ret;
|
|
429
540
|
};
|
|
430
|
-
imports.wbg.
|
|
431
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
541
|
+
imports.wbg.__wbindgen_closure_wrapper1061 = function(arg0, arg1, arg2) {
|
|
542
|
+
const ret = makeMutClosure(arg0, arg1, 49, __wbg_adapter_50);
|
|
432
543
|
return ret;
|
|
433
544
|
};
|
|
434
|
-
imports.wbg.
|
|
435
|
-
const ret = makeMutClosure(arg0, arg1,
|
|
545
|
+
imports.wbg.__wbindgen_closure_wrapper76 = function(arg0, arg1, arg2) {
|
|
546
|
+
const ret = makeMutClosure(arg0, arg1, 3, __wbg_adapter_50);
|
|
436
547
|
return ret;
|
|
437
548
|
};
|
|
438
549
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
@@ -442,6 +553,14 @@ function __wbg_get_imports() {
|
|
|
442
553
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
443
554
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
444
555
|
};
|
|
556
|
+
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
557
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
558
|
+
return ret;
|
|
559
|
+
};
|
|
560
|
+
imports.wbg.__wbindgen_in = function(arg0, arg1) {
|
|
561
|
+
const ret = arg0 in arg1;
|
|
562
|
+
return ret;
|
|
563
|
+
};
|
|
445
564
|
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
446
565
|
const table = wasm.__wbindgen_export_4;
|
|
447
566
|
const offset = table.grow(4);
|
|
@@ -452,6 +571,10 @@ function __wbg_get_imports() {
|
|
|
452
571
|
table.set(offset + 3, false);
|
|
453
572
|
;
|
|
454
573
|
};
|
|
574
|
+
imports.wbg.__wbindgen_is_bigint = function(arg0) {
|
|
575
|
+
const ret = typeof(arg0) === 'bigint';
|
|
576
|
+
return ret;
|
|
577
|
+
};
|
|
455
578
|
imports.wbg.__wbindgen_is_function = function(arg0) {
|
|
456
579
|
const ret = typeof(arg0) === 'function';
|
|
457
580
|
return ret;
|
|
@@ -460,10 +583,37 @@ function __wbg_get_imports() {
|
|
|
460
583
|
const ret = arg0 === null;
|
|
461
584
|
return ret;
|
|
462
585
|
};
|
|
586
|
+
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
587
|
+
const val = arg0;
|
|
588
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
589
|
+
return ret;
|
|
590
|
+
};
|
|
463
591
|
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
464
592
|
const ret = arg0 === undefined;
|
|
465
593
|
return ret;
|
|
466
594
|
};
|
|
595
|
+
imports.wbg.__wbindgen_jsval_eq = function(arg0, arg1) {
|
|
596
|
+
const ret = arg0 === arg1;
|
|
597
|
+
return ret;
|
|
598
|
+
};
|
|
599
|
+
imports.wbg.__wbindgen_jsval_loose_eq = function(arg0, arg1) {
|
|
600
|
+
const ret = arg0 == arg1;
|
|
601
|
+
return ret;
|
|
602
|
+
};
|
|
603
|
+
imports.wbg.__wbindgen_memory = function() {
|
|
604
|
+
const ret = wasm.memory;
|
|
605
|
+
return ret;
|
|
606
|
+
};
|
|
607
|
+
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
608
|
+
const obj = arg1;
|
|
609
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
610
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
611
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
612
|
+
};
|
|
613
|
+
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
614
|
+
const ret = arg0;
|
|
615
|
+
return ret;
|
|
616
|
+
};
|
|
467
617
|
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
468
618
|
const obj = arg1;
|
|
469
619
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
package/sqlite_web_bg.wasm
CHANGED
|
Binary file
|