@rainlanguage/sqlite-web 0.0.1 → 0.0.3
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 +57 -41
- package/sqlite_web.js +673 -534
- package/sqlite_web_bg.wasm +0 -0
package/package.json
CHANGED
package/sqlite_web.d.ts
CHANGED
|
@@ -1,62 +1,78 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
|
-
export type WasmEncodedResult<T> = { value: T; error: undefined } | { value: undefined; error: WasmEncodedError };
|
|
4
|
-
|
|
5
3
|
export interface WasmEncodedError {
|
|
6
4
|
msg: string;
|
|
7
5
|
readableMsg: string;
|
|
8
6
|
}
|
|
9
7
|
|
|
8
|
+
export type WasmEncodedResult<T> = { value: T; error: undefined } | { value: undefined; error: WasmEncodedError };
|
|
9
|
+
|
|
10
|
+
|
|
10
11
|
export class SQLiteWasmDatabase {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
12
|
+
private constructor();
|
|
13
|
+
free(): void;
|
|
14
|
+
[Symbol.dispose](): void;
|
|
15
|
+
/**
|
|
16
|
+
* Create a new database connection with fully embedded worker
|
|
17
|
+
*/
|
|
18
|
+
static new(db_name: string): Promise<WasmEncodedResult<SQLiteWasmDatabase>>;
|
|
19
|
+
/**
|
|
20
|
+
* Execute a SQL query (optionally parameterized via JS Array)
|
|
21
|
+
*
|
|
22
|
+
* Passing `undefined`/`null` from JS maps to `None`.
|
|
23
|
+
*/
|
|
24
|
+
query(sql: string, params?: Array<any> | null): Promise<WasmEncodedResult<string>>;
|
|
25
|
+
/**
|
|
26
|
+
* Execute a list of single SQL statements atomically as one worker job.
|
|
27
|
+
*
|
|
28
|
+
* Each item must be `{ sql: string, params?: Array }`. Do not include
|
|
29
|
+
* transaction-control statements; the worker owns the transaction.
|
|
30
|
+
*/
|
|
31
|
+
transaction(statements: Array<any>): Promise<WasmEncodedResult<string>>;
|
|
32
|
+
wipeAndRecreate(): Promise<WasmEncodedResult<void>>;
|
|
23
33
|
}
|
|
24
34
|
|
|
25
35
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
26
36
|
|
|
27
37
|
export interface InitOutput {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
readonly memory: WebAssembly.Memory;
|
|
39
|
+
readonly __wbg_sqlitewasmdatabase_free: (a: number, b: number) => void;
|
|
40
|
+
readonly sqlitewasmdatabase_new: (a: number, b: number) => any;
|
|
41
|
+
readonly sqlitewasmdatabase_query: (a: number, b: number, c: number, d: number) => any;
|
|
42
|
+
readonly sqlitewasmdatabase_transaction: (a: number, b: any) => any;
|
|
43
|
+
readonly sqlitewasmdatabase_wipeAndRecreate: (a: number) => any;
|
|
44
|
+
readonly wasm_bindgen__convert__closures_____invoke__h662cc5297105c4a7: (a: number, b: number, c: any) => [number, number];
|
|
45
|
+
readonly wasm_bindgen__convert__closures_____invoke__h3fea4067346f5309: (a: number, b: number, c: any, d: any) => void;
|
|
46
|
+
readonly wasm_bindgen__convert__closures_____invoke__h27ec19c17abe8f50: (a: number, b: number, c: any) => void;
|
|
47
|
+
readonly wasm_bindgen__convert__closures_____invoke__h78dad3b4b0b34364: (a: number, b: number) => void;
|
|
48
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
49
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
50
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
51
|
+
readonly __externref_table_alloc: () => number;
|
|
52
|
+
readonly __wbindgen_externrefs: WebAssembly.Table;
|
|
53
|
+
readonly __wbindgen_destroy_closure: (a: number, b: number) => void;
|
|
54
|
+
readonly __externref_table_dealloc: (a: number) => void;
|
|
55
|
+
readonly __wbindgen_start: () => void;
|
|
41
56
|
}
|
|
42
57
|
|
|
43
58
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
59
|
+
|
|
44
60
|
/**
|
|
45
|
-
* Instantiates the given `module`, which can either be bytes or
|
|
46
|
-
* a precompiled `WebAssembly.Module`.
|
|
47
|
-
*
|
|
48
|
-
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
49
|
-
*
|
|
50
|
-
* @returns {InitOutput}
|
|
51
|
-
*/
|
|
61
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
62
|
+
* a precompiled `WebAssembly.Module`.
|
|
63
|
+
*
|
|
64
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
65
|
+
*
|
|
66
|
+
* @returns {InitOutput}
|
|
67
|
+
*/
|
|
52
68
|
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
53
69
|
|
|
54
70
|
/**
|
|
55
|
-
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
56
|
-
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
57
|
-
*
|
|
58
|
-
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
59
|
-
*
|
|
60
|
-
* @returns {Promise<InitOutput>}
|
|
61
|
-
*/
|
|
71
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
72
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
73
|
+
*
|
|
74
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
75
|
+
*
|
|
76
|
+
* @returns {Promise<InitOutput>}
|
|
77
|
+
*/
|
|
62
78
|
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|