@rainlanguage/sqlite-web 0.0.1-alpha.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/package.json +15 -0
- package/sqlite_web.d.ts +60 -0
- package/sqlite_web.js +552 -0
- package/sqlite_web_bg.wasm +0 -0
package/package.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@rainlanguage/sqlite-web",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.1-alpha.0",
|
|
5
|
+
"files": [
|
|
6
|
+
"sqlite_web_bg.wasm",
|
|
7
|
+
"sqlite_web.js",
|
|
8
|
+
"sqlite_web.d.ts"
|
|
9
|
+
],
|
|
10
|
+
"main": "sqlite_web.js",
|
|
11
|
+
"types": "sqlite_web.d.ts",
|
|
12
|
+
"sideEffects": [
|
|
13
|
+
"./snippets/*"
|
|
14
|
+
]
|
|
15
|
+
}
|
package/sqlite_web.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export type WasmEncodedResult<T> = { value: T; error: undefined } | { value: undefined; error: WasmEncodedError };
|
|
4
|
+
|
|
5
|
+
export interface WasmEncodedError {
|
|
6
|
+
msg: string;
|
|
7
|
+
readableMsg: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export class SQLiteWasmDatabase {
|
|
11
|
+
private constructor();
|
|
12
|
+
free(): void;
|
|
13
|
+
/**
|
|
14
|
+
* Create a new database connection with fully embedded worker
|
|
15
|
+
*/
|
|
16
|
+
static new(): WasmEncodedResult<SQLiteWasmDatabase>;
|
|
17
|
+
/**
|
|
18
|
+
* Execute a SQL query
|
|
19
|
+
*/
|
|
20
|
+
query(sql: string): Promise<WasmEncodedResult<string>>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
24
|
+
|
|
25
|
+
export interface InitOutput {
|
|
26
|
+
readonly memory: WebAssembly.Memory;
|
|
27
|
+
readonly __wbg_sqlitewasmdatabase_free: (a: number, b: number) => void;
|
|
28
|
+
readonly sqlitewasmdatabase_new: () => any;
|
|
29
|
+
readonly sqlitewasmdatabase_query: (a: number, b: number, c: number) => any;
|
|
30
|
+
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
31
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
32
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
33
|
+
readonly __externref_table_alloc: () => number;
|
|
34
|
+
readonly __wbindgen_export_4: WebAssembly.Table;
|
|
35
|
+
readonly __wbindgen_export_5: WebAssembly.Table;
|
|
36
|
+
readonly closure21_externref_shim: (a: number, b: number, c: any) => void;
|
|
37
|
+
readonly closure15_externref_shim: (a: number, b: number, c: any, d: any) => void;
|
|
38
|
+
readonly __wbindgen_start: () => void;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
42
|
+
/**
|
|
43
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
44
|
+
* a precompiled `WebAssembly.Module`.
|
|
45
|
+
*
|
|
46
|
+
* @param {{ module: SyncInitInput }} module - Passing `SyncInitInput` directly is deprecated.
|
|
47
|
+
*
|
|
48
|
+
* @returns {InitOutput}
|
|
49
|
+
*/
|
|
50
|
+
export function initSync(module: { module: SyncInitInput } | SyncInitInput): InitOutput;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
54
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
55
|
+
*
|
|
56
|
+
* @param {{ module_or_path: InitInput | Promise<InitInput> }} module_or_path - Passing `InitInput` directly is deprecated.
|
|
57
|
+
*
|
|
58
|
+
* @returns {Promise<InitOutput>}
|
|
59
|
+
*/
|
|
60
|
+
export default function __wbg_init (module_or_path?: { module_or_path: InitInput | Promise<InitInput> } | InitInput | Promise<InitInput>): Promise<InitOutput>;
|
package/sqlite_web.js
ADDED
|
@@ -0,0 +1,552 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
|
|
3
|
+
let WASM_VECTOR_LEN = 0;
|
|
4
|
+
|
|
5
|
+
let cachedUint8ArrayMemory0 = null;
|
|
6
|
+
|
|
7
|
+
function getUint8ArrayMemory0() {
|
|
8
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
9
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
10
|
+
}
|
|
11
|
+
return cachedUint8ArrayMemory0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
15
|
+
|
|
16
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
17
|
+
? function (arg, view) {
|
|
18
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
19
|
+
}
|
|
20
|
+
: function (arg, view) {
|
|
21
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
22
|
+
view.set(buf);
|
|
23
|
+
return {
|
|
24
|
+
read: arg.length,
|
|
25
|
+
written: buf.length
|
|
26
|
+
};
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
30
|
+
|
|
31
|
+
if (realloc === undefined) {
|
|
32
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
33
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
34
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
35
|
+
WASM_VECTOR_LEN = buf.length;
|
|
36
|
+
return ptr;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
let len = arg.length;
|
|
40
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
41
|
+
|
|
42
|
+
const mem = getUint8ArrayMemory0();
|
|
43
|
+
|
|
44
|
+
let offset = 0;
|
|
45
|
+
|
|
46
|
+
for (; offset < len; offset++) {
|
|
47
|
+
const code = arg.charCodeAt(offset);
|
|
48
|
+
if (code > 0x7F) break;
|
|
49
|
+
mem[ptr + offset] = code;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
if (offset !== len) {
|
|
53
|
+
if (offset !== 0) {
|
|
54
|
+
arg = arg.slice(offset);
|
|
55
|
+
}
|
|
56
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
57
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
58
|
+
const ret = encodeString(arg, view);
|
|
59
|
+
|
|
60
|
+
offset += ret.written;
|
|
61
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
WASM_VECTOR_LEN = offset;
|
|
65
|
+
return ptr;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
let cachedDataViewMemory0 = null;
|
|
69
|
+
|
|
70
|
+
function getDataViewMemory0() {
|
|
71
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
72
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
73
|
+
}
|
|
74
|
+
return cachedDataViewMemory0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function addToExternrefTable0(obj) {
|
|
78
|
+
const idx = wasm.__externref_table_alloc();
|
|
79
|
+
wasm.__wbindgen_export_4.set(idx, obj);
|
|
80
|
+
return idx;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function handleError(f, args) {
|
|
84
|
+
try {
|
|
85
|
+
return f.apply(this, args);
|
|
86
|
+
} catch (e) {
|
|
87
|
+
const idx = addToExternrefTable0(e);
|
|
88
|
+
wasm.__wbindgen_exn_store(idx);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
93
|
+
|
|
94
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
95
|
+
|
|
96
|
+
function getStringFromWasm0(ptr, len) {
|
|
97
|
+
ptr = ptr >>> 0;
|
|
98
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
function isLikeNone(x) {
|
|
102
|
+
return x === undefined || x === null;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')
|
|
106
|
+
? { register: () => {}, unregister: () => {} }
|
|
107
|
+
: new FinalizationRegistry(state => {
|
|
108
|
+
wasm.__wbindgen_export_5.get(state.dtor)(state.a, state.b)
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
112
|
+
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
113
|
+
const real = (...args) => {
|
|
114
|
+
// First up with a closure we increment the internal reference
|
|
115
|
+
// count. This ensures that the Rust closure environment won't
|
|
116
|
+
// be deallocated while we're invoking it.
|
|
117
|
+
state.cnt++;
|
|
118
|
+
const a = state.a;
|
|
119
|
+
state.a = 0;
|
|
120
|
+
try {
|
|
121
|
+
return f(a, state.b, ...args);
|
|
122
|
+
} finally {
|
|
123
|
+
if (--state.cnt === 0) {
|
|
124
|
+
wasm.__wbindgen_export_5.get(state.dtor)(a, state.b);
|
|
125
|
+
CLOSURE_DTORS.unregister(state);
|
|
126
|
+
} else {
|
|
127
|
+
state.a = a;
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
real.original = state;
|
|
132
|
+
CLOSURE_DTORS.register(real, state, state);
|
|
133
|
+
return real;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
function debugString(val) {
|
|
137
|
+
// primitive types
|
|
138
|
+
const type = typeof val;
|
|
139
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
140
|
+
return `${val}`;
|
|
141
|
+
}
|
|
142
|
+
if (type == 'string') {
|
|
143
|
+
return `"${val}"`;
|
|
144
|
+
}
|
|
145
|
+
if (type == 'symbol') {
|
|
146
|
+
const description = val.description;
|
|
147
|
+
if (description == null) {
|
|
148
|
+
return 'Symbol';
|
|
149
|
+
} else {
|
|
150
|
+
return `Symbol(${description})`;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
if (type == 'function') {
|
|
154
|
+
const name = val.name;
|
|
155
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
156
|
+
return `Function(${name})`;
|
|
157
|
+
} else {
|
|
158
|
+
return 'Function';
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
// objects
|
|
162
|
+
if (Array.isArray(val)) {
|
|
163
|
+
const length = val.length;
|
|
164
|
+
let debug = '[';
|
|
165
|
+
if (length > 0) {
|
|
166
|
+
debug += debugString(val[0]);
|
|
167
|
+
}
|
|
168
|
+
for(let i = 1; i < length; i++) {
|
|
169
|
+
debug += ', ' + debugString(val[i]);
|
|
170
|
+
}
|
|
171
|
+
debug += ']';
|
|
172
|
+
return debug;
|
|
173
|
+
}
|
|
174
|
+
// Test for built-in
|
|
175
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
176
|
+
let className;
|
|
177
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
178
|
+
className = builtInMatches[1];
|
|
179
|
+
} else {
|
|
180
|
+
// Failed to match the standard '[object ClassName]'
|
|
181
|
+
return toString.call(val);
|
|
182
|
+
}
|
|
183
|
+
if (className == 'Object') {
|
|
184
|
+
// we're a user defined class or Object
|
|
185
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
186
|
+
// easier than looping through ownProperties of `val`.
|
|
187
|
+
try {
|
|
188
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
189
|
+
} catch (_) {
|
|
190
|
+
return 'Object';
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
// errors
|
|
194
|
+
if (val instanceof Error) {
|
|
195
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
196
|
+
}
|
|
197
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
198
|
+
return className;
|
|
199
|
+
}
|
|
200
|
+
function __wbg_adapter_24(arg0, arg1, arg2) {
|
|
201
|
+
wasm.closure21_externref_shim(arg0, arg1, arg2);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
function __wbg_adapter_43(arg0, arg1, arg2, arg3) {
|
|
205
|
+
wasm.closure15_externref_shim(arg0, arg1, arg2, arg3);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
const SQLiteWasmDatabaseFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
209
|
+
? { register: () => {}, unregister: () => {} }
|
|
210
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_sqlitewasmdatabase_free(ptr >>> 0, 1));
|
|
211
|
+
|
|
212
|
+
export class SQLiteWasmDatabase {
|
|
213
|
+
|
|
214
|
+
static __wrap(ptr) {
|
|
215
|
+
ptr = ptr >>> 0;
|
|
216
|
+
const obj = Object.create(SQLiteWasmDatabase.prototype);
|
|
217
|
+
obj.__wbg_ptr = ptr;
|
|
218
|
+
SQLiteWasmDatabaseFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
219
|
+
return obj;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
__destroy_into_raw() {
|
|
223
|
+
const ptr = this.__wbg_ptr;
|
|
224
|
+
this.__wbg_ptr = 0;
|
|
225
|
+
SQLiteWasmDatabaseFinalization.unregister(this);
|
|
226
|
+
return ptr;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
free() {
|
|
230
|
+
const ptr = this.__destroy_into_raw();
|
|
231
|
+
wasm.__wbg_sqlitewasmdatabase_free(ptr, 0);
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Create a new database connection with fully embedded worker
|
|
235
|
+
* @returns {WasmEncodedResult<SQLiteWasmDatabase>}
|
|
236
|
+
*/
|
|
237
|
+
static new() {
|
|
238
|
+
const ret = wasm.sqlitewasmdatabase_new();
|
|
239
|
+
return ret;
|
|
240
|
+
}
|
|
241
|
+
/**
|
|
242
|
+
* Execute a SQL query
|
|
243
|
+
* @param {string} sql
|
|
244
|
+
* @returns {WasmEncodedResult<string>}
|
|
245
|
+
*/
|
|
246
|
+
query(sql) {
|
|
247
|
+
const ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
248
|
+
const len0 = WASM_VECTOR_LEN;
|
|
249
|
+
const ret = wasm.sqlitewasmdatabase_query(this.__wbg_ptr, ptr0, len0);
|
|
250
|
+
return ret;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
async function __wbg_load(module, imports) {
|
|
255
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
256
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
257
|
+
try {
|
|
258
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
259
|
+
|
|
260
|
+
} catch (e) {
|
|
261
|
+
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
262
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
263
|
+
|
|
264
|
+
} else {
|
|
265
|
+
throw e;
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
const bytes = await module.arrayBuffer();
|
|
271
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
272
|
+
|
|
273
|
+
} else {
|
|
274
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
275
|
+
|
|
276
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
277
|
+
return { instance, module };
|
|
278
|
+
|
|
279
|
+
} else {
|
|
280
|
+
return instance;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
function __wbg_get_imports() {
|
|
286
|
+
const imports = {};
|
|
287
|
+
imports.wbg = {};
|
|
288
|
+
imports.wbg.__wbg_String_8f0eb39a4a4c2f66 = function(arg0, arg1) {
|
|
289
|
+
const ret = String(arg1);
|
|
290
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
291
|
+
const len1 = WASM_VECTOR_LEN;
|
|
292
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
293
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
294
|
+
};
|
|
295
|
+
imports.wbg.__wbg_call_672a4d21634d4a24 = function() { return handleError(function (arg0, arg1) {
|
|
296
|
+
const ret = arg0.call(arg1);
|
|
297
|
+
return ret;
|
|
298
|
+
}, arguments) };
|
|
299
|
+
imports.wbg.__wbg_call_7cccdd69e0791ae2 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
300
|
+
const ret = arg0.call(arg1, arg2);
|
|
301
|
+
return ret;
|
|
302
|
+
}, arguments) };
|
|
303
|
+
imports.wbg.__wbg_createObjectURL_6e98d2f9c7bd9764 = function() { return handleError(function (arg0, arg1) {
|
|
304
|
+
const ret = URL.createObjectURL(arg1);
|
|
305
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
306
|
+
const len1 = WASM_VECTOR_LEN;
|
|
307
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
308
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
309
|
+
}, arguments) };
|
|
310
|
+
imports.wbg.__wbg_data_432d9c3df2630942 = function(arg0) {
|
|
311
|
+
const ret = arg0.data;
|
|
312
|
+
return ret;
|
|
313
|
+
};
|
|
314
|
+
imports.wbg.__wbg_get_67b2ba62fc30de12 = function() { return handleError(function (arg0, arg1) {
|
|
315
|
+
const ret = Reflect.get(arg0, arg1);
|
|
316
|
+
return ret;
|
|
317
|
+
}, arguments) };
|
|
318
|
+
imports.wbg.__wbg_new_23a2665fac83c611 = function(arg0, arg1) {
|
|
319
|
+
try {
|
|
320
|
+
var state0 = {a: arg0, b: arg1};
|
|
321
|
+
var cb0 = (arg0, arg1) => {
|
|
322
|
+
const a = state0.a;
|
|
323
|
+
state0.a = 0;
|
|
324
|
+
try {
|
|
325
|
+
return __wbg_adapter_43(a, state0.b, arg0, arg1);
|
|
326
|
+
} finally {
|
|
327
|
+
state0.a = a;
|
|
328
|
+
}
|
|
329
|
+
};
|
|
330
|
+
const ret = new Promise(cb0);
|
|
331
|
+
return ret;
|
|
332
|
+
} finally {
|
|
333
|
+
state0.a = state0.b = 0;
|
|
334
|
+
}
|
|
335
|
+
};
|
|
336
|
+
imports.wbg.__wbg_new_405e22f390576ce2 = function() {
|
|
337
|
+
const ret = new Object();
|
|
338
|
+
return ret;
|
|
339
|
+
};
|
|
340
|
+
imports.wbg.__wbg_new_78feb108b6472713 = function() {
|
|
341
|
+
const ret = new Array();
|
|
342
|
+
return ret;
|
|
343
|
+
};
|
|
344
|
+
imports.wbg.__wbg_new_b1a33e5095abf678 = function() { return handleError(function (arg0, arg1) {
|
|
345
|
+
const ret = new Worker(getStringFromWasm0(arg0, arg1));
|
|
346
|
+
return ret;
|
|
347
|
+
}, arguments) };
|
|
348
|
+
imports.wbg.__wbg_newnoargs_105ed471475aaf50 = function(arg0, arg1) {
|
|
349
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
350
|
+
return ret;
|
|
351
|
+
};
|
|
352
|
+
imports.wbg.__wbg_newwithstrsequenceandoptions_aaff55b467c81b63 = function() { return handleError(function (arg0, arg1) {
|
|
353
|
+
const ret = new Blob(arg0, arg1);
|
|
354
|
+
return ret;
|
|
355
|
+
}, arguments) };
|
|
356
|
+
imports.wbg.__wbg_postMessage_6edafa8f7b9c2f52 = function() { return handleError(function (arg0, arg1) {
|
|
357
|
+
arg0.postMessage(arg1);
|
|
358
|
+
}, arguments) };
|
|
359
|
+
imports.wbg.__wbg_push_737cfc8c1432c2c6 = function(arg0, arg1) {
|
|
360
|
+
const ret = arg0.push(arg1);
|
|
361
|
+
return ret;
|
|
362
|
+
};
|
|
363
|
+
imports.wbg.__wbg_queueMicrotask_97d92b4fcc8a61c5 = function(arg0) {
|
|
364
|
+
queueMicrotask(arg0);
|
|
365
|
+
};
|
|
366
|
+
imports.wbg.__wbg_queueMicrotask_d3219def82552485 = function(arg0) {
|
|
367
|
+
const ret = arg0.queueMicrotask;
|
|
368
|
+
return ret;
|
|
369
|
+
};
|
|
370
|
+
imports.wbg.__wbg_resolve_4851785c9c5f573d = function(arg0) {
|
|
371
|
+
const ret = Promise.resolve(arg0);
|
|
372
|
+
return ret;
|
|
373
|
+
};
|
|
374
|
+
imports.wbg.__wbg_revokeObjectURL_27267efebeb457c7 = function() { return handleError(function (arg0, arg1) {
|
|
375
|
+
URL.revokeObjectURL(getStringFromWasm0(arg0, arg1));
|
|
376
|
+
}, arguments) };
|
|
377
|
+
imports.wbg.__wbg_set_3f1d0b984ed272ed = function(arg0, arg1, arg2) {
|
|
378
|
+
arg0[arg1] = arg2;
|
|
379
|
+
};
|
|
380
|
+
imports.wbg.__wbg_set_bb8cecf6a62b9f46 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
381
|
+
const ret = Reflect.set(arg0, arg1, arg2);
|
|
382
|
+
return ret;
|
|
383
|
+
}, arguments) };
|
|
384
|
+
imports.wbg.__wbg_setonmessage_5a885b16bdc6dca6 = function(arg0, arg1) {
|
|
385
|
+
arg0.onmessage = arg1;
|
|
386
|
+
};
|
|
387
|
+
imports.wbg.__wbg_settype_39ed370d3edd403c = function(arg0, arg1, arg2) {
|
|
388
|
+
arg0.type = getStringFromWasm0(arg1, arg2);
|
|
389
|
+
};
|
|
390
|
+
imports.wbg.__wbg_sqlitewasmdatabase_new = function(arg0) {
|
|
391
|
+
const ret = SQLiteWasmDatabase.__wrap(arg0);
|
|
392
|
+
return ret;
|
|
393
|
+
};
|
|
394
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_88a902d13a557d07 = function() {
|
|
395
|
+
const ret = typeof global === 'undefined' ? null : global;
|
|
396
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
397
|
+
};
|
|
398
|
+
imports.wbg.__wbg_static_accessor_GLOBAL_THIS_56578be7e9f832b0 = function() {
|
|
399
|
+
const ret = typeof globalThis === 'undefined' ? null : globalThis;
|
|
400
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
401
|
+
};
|
|
402
|
+
imports.wbg.__wbg_static_accessor_SELF_37c5d418e4bf5819 = function() {
|
|
403
|
+
const ret = typeof self === 'undefined' ? null : self;
|
|
404
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
405
|
+
};
|
|
406
|
+
imports.wbg.__wbg_static_accessor_WINDOW_5de37043a91a9c40 = function() {
|
|
407
|
+
const ret = typeof window === 'undefined' ? null : window;
|
|
408
|
+
return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
|
|
409
|
+
};
|
|
410
|
+
imports.wbg.__wbg_then_44b73946d2fb3e7d = function(arg0, arg1) {
|
|
411
|
+
const ret = arg0.then(arg1);
|
|
412
|
+
return ret;
|
|
413
|
+
};
|
|
414
|
+
imports.wbg.__wbg_then_48b406749878a531 = function(arg0, arg1, arg2) {
|
|
415
|
+
const ret = arg0.then(arg1, arg2);
|
|
416
|
+
return ret;
|
|
417
|
+
};
|
|
418
|
+
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
|
419
|
+
const obj = arg0.original;
|
|
420
|
+
if (obj.cnt-- == 1) {
|
|
421
|
+
obj.a = 0;
|
|
422
|
+
return true;
|
|
423
|
+
}
|
|
424
|
+
const ret = false;
|
|
425
|
+
return ret;
|
|
426
|
+
};
|
|
427
|
+
imports.wbg.__wbindgen_closure_wrapper113 = function(arg0, arg1, arg2) {
|
|
428
|
+
const ret = makeMutClosure(arg0, arg1, 22, __wbg_adapter_24);
|
|
429
|
+
return ret;
|
|
430
|
+
};
|
|
431
|
+
imports.wbg.__wbindgen_closure_wrapper60 = function(arg0, arg1, arg2) {
|
|
432
|
+
const ret = makeMutClosure(arg0, arg1, 27, __wbg_adapter_24);
|
|
433
|
+
return ret;
|
|
434
|
+
};
|
|
435
|
+
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
436
|
+
const ret = debugString(arg1);
|
|
437
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
438
|
+
const len1 = WASM_VECTOR_LEN;
|
|
439
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
440
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
441
|
+
};
|
|
442
|
+
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
443
|
+
const table = wasm.__wbindgen_export_4;
|
|
444
|
+
const offset = table.grow(4);
|
|
445
|
+
table.set(0, undefined);
|
|
446
|
+
table.set(offset + 0, undefined);
|
|
447
|
+
table.set(offset + 1, null);
|
|
448
|
+
table.set(offset + 2, true);
|
|
449
|
+
table.set(offset + 3, false);
|
|
450
|
+
;
|
|
451
|
+
};
|
|
452
|
+
imports.wbg.__wbindgen_is_function = function(arg0) {
|
|
453
|
+
const ret = typeof(arg0) === 'function';
|
|
454
|
+
return ret;
|
|
455
|
+
};
|
|
456
|
+
imports.wbg.__wbindgen_is_null = function(arg0) {
|
|
457
|
+
const ret = arg0 === null;
|
|
458
|
+
return ret;
|
|
459
|
+
};
|
|
460
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
461
|
+
const ret = arg0 === undefined;
|
|
462
|
+
return ret;
|
|
463
|
+
};
|
|
464
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
465
|
+
const obj = arg1;
|
|
466
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
467
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
468
|
+
var len1 = WASM_VECTOR_LEN;
|
|
469
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
470
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
471
|
+
};
|
|
472
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
473
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
474
|
+
return ret;
|
|
475
|
+
};
|
|
476
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
477
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
478
|
+
};
|
|
479
|
+
|
|
480
|
+
return imports;
|
|
481
|
+
}
|
|
482
|
+
|
|
483
|
+
function __wbg_init_memory(imports, memory) {
|
|
484
|
+
|
|
485
|
+
}
|
|
486
|
+
|
|
487
|
+
function __wbg_finalize_init(instance, module) {
|
|
488
|
+
wasm = instance.exports;
|
|
489
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
490
|
+
cachedDataViewMemory0 = null;
|
|
491
|
+
cachedUint8ArrayMemory0 = null;
|
|
492
|
+
|
|
493
|
+
|
|
494
|
+
wasm.__wbindgen_start();
|
|
495
|
+
return wasm;
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
function initSync(module) {
|
|
499
|
+
if (wasm !== undefined) return wasm;
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
if (typeof module !== 'undefined') {
|
|
503
|
+
if (Object.getPrototypeOf(module) === Object.prototype) {
|
|
504
|
+
({module} = module)
|
|
505
|
+
} else {
|
|
506
|
+
console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
const imports = __wbg_get_imports();
|
|
511
|
+
|
|
512
|
+
__wbg_init_memory(imports);
|
|
513
|
+
|
|
514
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
515
|
+
module = new WebAssembly.Module(module);
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
519
|
+
|
|
520
|
+
return __wbg_finalize_init(instance, module);
|
|
521
|
+
}
|
|
522
|
+
|
|
523
|
+
async function __wbg_init(module_or_path) {
|
|
524
|
+
if (wasm !== undefined) return wasm;
|
|
525
|
+
|
|
526
|
+
|
|
527
|
+
if (typeof module_or_path !== 'undefined') {
|
|
528
|
+
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
529
|
+
({module_or_path} = module_or_path)
|
|
530
|
+
} else {
|
|
531
|
+
console.warn('using deprecated parameters for the initialization function; pass a single object instead')
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
|
|
535
|
+
if (typeof module_or_path === 'undefined') {
|
|
536
|
+
module_or_path = new URL('sqlite_web_bg.wasm', import.meta.url);
|
|
537
|
+
}
|
|
538
|
+
const imports = __wbg_get_imports();
|
|
539
|
+
|
|
540
|
+
if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
|
|
541
|
+
module_or_path = fetch(module_or_path);
|
|
542
|
+
}
|
|
543
|
+
|
|
544
|
+
__wbg_init_memory(imports);
|
|
545
|
+
|
|
546
|
+
const { instance, module } = await __wbg_load(await module_or_path, imports);
|
|
547
|
+
|
|
548
|
+
return __wbg_finalize_init(instance, module);
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
export { initSync };
|
|
552
|
+
export default __wbg_init;
|
|
Binary file
|