gluesql 0.3.2 → 0.10.2-rc.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/README.md +37 -100
- package/dist/bundler/gluesql.js +481 -0
- package/dist/bundler/gluesql.js.map +1 -0
- package/dist/nodejs/gluesql_js.js +430 -0
- package/dist/nodejs/gluesql_js_bg.wasm +0 -0
- package/dist/nodejs/package.json +18 -0
- package/dist/web/gluesql_js.js +432 -0
- package/dist/web/gluesql_js_bg.wasm +0 -0
- package/dist/web/package.json +19 -0
- package/gluesql.js +17 -2
- package/gluesql.node.js +7 -0
- package/gluesql.rollup.js +481 -0
- package/package.json +33 -14
- package/LICENSE +0 -201
- package/gluesql.d.ts +0 -17
- package/gluesql_bg.js +0 -342
- package/gluesql_bg.wasm +0 -0
|
@@ -0,0 +1,432 @@
|
|
|
1
|
+
|
|
2
|
+
let wasm;
|
|
3
|
+
|
|
4
|
+
const heap = new Array(32).fill(undefined);
|
|
5
|
+
|
|
6
|
+
heap.push(undefined, null, true, false);
|
|
7
|
+
|
|
8
|
+
function getObject(idx) { return heap[idx]; }
|
|
9
|
+
|
|
10
|
+
let heap_next = heap.length;
|
|
11
|
+
|
|
12
|
+
function dropObject(idx) {
|
|
13
|
+
if (idx < 36) return;
|
|
14
|
+
heap[idx] = heap_next;
|
|
15
|
+
heap_next = idx;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function takeObject(idx) {
|
|
19
|
+
const ret = getObject(idx);
|
|
20
|
+
dropObject(idx);
|
|
21
|
+
return ret;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
25
|
+
|
|
26
|
+
cachedTextDecoder.decode();
|
|
27
|
+
|
|
28
|
+
let cachegetUint8Memory0 = null;
|
|
29
|
+
function getUint8Memory0() {
|
|
30
|
+
if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) {
|
|
31
|
+
cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
32
|
+
}
|
|
33
|
+
return cachegetUint8Memory0;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function getStringFromWasm0(ptr, len) {
|
|
37
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function addHeapObject(obj) {
|
|
41
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
42
|
+
const idx = heap_next;
|
|
43
|
+
heap_next = heap[idx];
|
|
44
|
+
|
|
45
|
+
heap[idx] = obj;
|
|
46
|
+
return idx;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function makeMutClosure(arg0, arg1, dtor, f) {
|
|
50
|
+
const state = { a: arg0, b: arg1, cnt: 1, dtor };
|
|
51
|
+
const real = (...args) => {
|
|
52
|
+
// First up with a closure we increment the internal reference
|
|
53
|
+
// count. This ensures that the Rust closure environment won't
|
|
54
|
+
// be deallocated while we're invoking it.
|
|
55
|
+
state.cnt++;
|
|
56
|
+
const a = state.a;
|
|
57
|
+
state.a = 0;
|
|
58
|
+
try {
|
|
59
|
+
return f(a, state.b, ...args);
|
|
60
|
+
} finally {
|
|
61
|
+
if (--state.cnt === 0) {
|
|
62
|
+
wasm.__wbindgen_export_0.get(state.dtor)(a, state.b);
|
|
63
|
+
|
|
64
|
+
} else {
|
|
65
|
+
state.a = a;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
real.original = state;
|
|
70
|
+
|
|
71
|
+
return real;
|
|
72
|
+
}
|
|
73
|
+
function __wbg_adapter_22(arg0, arg1, arg2) {
|
|
74
|
+
wasm._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ha6fe96a9e8c1ad62(arg0, arg1, addHeapObject(arg2));
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
let WASM_VECTOR_LEN = 0;
|
|
78
|
+
|
|
79
|
+
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
80
|
+
|
|
81
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
82
|
+
? function (arg, view) {
|
|
83
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
84
|
+
}
|
|
85
|
+
: function (arg, view) {
|
|
86
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
87
|
+
view.set(buf);
|
|
88
|
+
return {
|
|
89
|
+
read: arg.length,
|
|
90
|
+
written: buf.length
|
|
91
|
+
};
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
95
|
+
|
|
96
|
+
if (realloc === undefined) {
|
|
97
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
98
|
+
const ptr = malloc(buf.length);
|
|
99
|
+
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
100
|
+
WASM_VECTOR_LEN = buf.length;
|
|
101
|
+
return ptr;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
let len = arg.length;
|
|
105
|
+
let ptr = malloc(len);
|
|
106
|
+
|
|
107
|
+
const mem = getUint8Memory0();
|
|
108
|
+
|
|
109
|
+
let offset = 0;
|
|
110
|
+
|
|
111
|
+
for (; offset < len; offset++) {
|
|
112
|
+
const code = arg.charCodeAt(offset);
|
|
113
|
+
if (code > 0x7F) break;
|
|
114
|
+
mem[ptr + offset] = code;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (offset !== len) {
|
|
118
|
+
if (offset !== 0) {
|
|
119
|
+
arg = arg.slice(offset);
|
|
120
|
+
}
|
|
121
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3);
|
|
122
|
+
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
123
|
+
const ret = encodeString(arg, view);
|
|
124
|
+
|
|
125
|
+
offset += ret.written;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
WASM_VECTOR_LEN = offset;
|
|
129
|
+
return ptr;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
let cachegetInt32Memory0 = null;
|
|
133
|
+
function getInt32Memory0() {
|
|
134
|
+
if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) {
|
|
135
|
+
cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
136
|
+
}
|
|
137
|
+
return cachegetInt32Memory0;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function handleError(f, args) {
|
|
141
|
+
try {
|
|
142
|
+
return f.apply(this, args);
|
|
143
|
+
} catch (e) {
|
|
144
|
+
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
149
|
+
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
150
|
+
}
|
|
151
|
+
function __wbg_adapter_59(arg0, arg1, arg2, arg3) {
|
|
152
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__hc1269849aa1d7043(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
*/
|
|
157
|
+
export class Glue {
|
|
158
|
+
|
|
159
|
+
static __wrap(ptr) {
|
|
160
|
+
const obj = Object.create(Glue.prototype);
|
|
161
|
+
obj.ptr = ptr;
|
|
162
|
+
|
|
163
|
+
return obj;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
__destroy_into_raw() {
|
|
167
|
+
const ptr = this.ptr;
|
|
168
|
+
this.ptr = 0;
|
|
169
|
+
|
|
170
|
+
return ptr;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
free() {
|
|
174
|
+
const ptr = this.__destroy_into_raw();
|
|
175
|
+
wasm.__wbg_glue_free(ptr);
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
*/
|
|
179
|
+
constructor() {
|
|
180
|
+
var ret = wasm.glue_new();
|
|
181
|
+
return Glue.__wrap(ret);
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* @param {string} sql
|
|
185
|
+
* @returns {Promise<any>}
|
|
186
|
+
*/
|
|
187
|
+
query(sql) {
|
|
188
|
+
var ptr0 = passStringToWasm0(sql, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
189
|
+
var len0 = WASM_VECTOR_LEN;
|
|
190
|
+
var ret = wasm.glue_query(this.ptr, ptr0, len0);
|
|
191
|
+
return takeObject(ret);
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
async function load(module, imports) {
|
|
196
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
197
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
198
|
+
try {
|
|
199
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
200
|
+
|
|
201
|
+
} catch (e) {
|
|
202
|
+
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
203
|
+
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);
|
|
204
|
+
|
|
205
|
+
} else {
|
|
206
|
+
throw e;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
const bytes = await module.arrayBuffer();
|
|
212
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
213
|
+
|
|
214
|
+
} else {
|
|
215
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
216
|
+
|
|
217
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
218
|
+
return { instance, module };
|
|
219
|
+
|
|
220
|
+
} else {
|
|
221
|
+
return instance;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
async function init(input) {
|
|
227
|
+
if (typeof input === 'undefined') {
|
|
228
|
+
input = new URL('gluesql_js_bg.wasm', import.meta.url);
|
|
229
|
+
}
|
|
230
|
+
const imports = {};
|
|
231
|
+
imports.wbg = {};
|
|
232
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
233
|
+
takeObject(arg0);
|
|
234
|
+
};
|
|
235
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
236
|
+
var ret = getStringFromWasm0(arg0, arg1);
|
|
237
|
+
return addHeapObject(ret);
|
|
238
|
+
};
|
|
239
|
+
imports.wbg.__wbg_log_8096e7715c582717 = function(arg0, arg1) {
|
|
240
|
+
console.log(getStringFromWasm0(arg0, arg1));
|
|
241
|
+
};
|
|
242
|
+
imports.wbg.__wbindgen_json_parse = function(arg0, arg1) {
|
|
243
|
+
var ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
244
|
+
return addHeapObject(ret);
|
|
245
|
+
};
|
|
246
|
+
imports.wbg.__wbg_new_693216e109162396 = function() {
|
|
247
|
+
var ret = new Error();
|
|
248
|
+
return addHeapObject(ret);
|
|
249
|
+
};
|
|
250
|
+
imports.wbg.__wbg_stack_0ddaca5d1abfb52f = function(arg0, arg1) {
|
|
251
|
+
var ret = getObject(arg1).stack;
|
|
252
|
+
var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
253
|
+
var len0 = WASM_VECTOR_LEN;
|
|
254
|
+
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
255
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
256
|
+
};
|
|
257
|
+
imports.wbg.__wbg_error_09919627ac0992f5 = function(arg0, arg1) {
|
|
258
|
+
try {
|
|
259
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
260
|
+
} finally {
|
|
261
|
+
wasm.__wbindgen_free(arg0, arg1);
|
|
262
|
+
}
|
|
263
|
+
};
|
|
264
|
+
imports.wbg.__wbindgen_cb_drop = function(arg0) {
|
|
265
|
+
const obj = takeObject(arg0).original;
|
|
266
|
+
if (obj.cnt-- == 1) {
|
|
267
|
+
obj.a = 0;
|
|
268
|
+
return true;
|
|
269
|
+
}
|
|
270
|
+
var ret = false;
|
|
271
|
+
return ret;
|
|
272
|
+
};
|
|
273
|
+
imports.wbg.__wbg_getRandomValues_98117e9a7e993920 = function() { return handleError(function (arg0, arg1) {
|
|
274
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
|
275
|
+
}, arguments) };
|
|
276
|
+
imports.wbg.__wbg_randomFillSync_64cc7d048f228ca8 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
277
|
+
getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2));
|
|
278
|
+
}, arguments) };
|
|
279
|
+
imports.wbg.__wbg_process_2f24d6544ea7b200 = function(arg0) {
|
|
280
|
+
var ret = getObject(arg0).process;
|
|
281
|
+
return addHeapObject(ret);
|
|
282
|
+
};
|
|
283
|
+
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
284
|
+
const val = getObject(arg0);
|
|
285
|
+
var ret = typeof(val) === 'object' && val !== null;
|
|
286
|
+
return ret;
|
|
287
|
+
};
|
|
288
|
+
imports.wbg.__wbg_versions_6164651e75405d4a = function(arg0) {
|
|
289
|
+
var ret = getObject(arg0).versions;
|
|
290
|
+
return addHeapObject(ret);
|
|
291
|
+
};
|
|
292
|
+
imports.wbg.__wbg_node_4b517d861cbcb3bc = function(arg0) {
|
|
293
|
+
var ret = getObject(arg0).node;
|
|
294
|
+
return addHeapObject(ret);
|
|
295
|
+
};
|
|
296
|
+
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
297
|
+
var ret = typeof(getObject(arg0)) === 'string';
|
|
298
|
+
return ret;
|
|
299
|
+
};
|
|
300
|
+
imports.wbg.__wbg_modulerequire_3440a4bcf44437db = function() { return handleError(function (arg0, arg1) {
|
|
301
|
+
var ret = module.require(getStringFromWasm0(arg0, arg1));
|
|
302
|
+
return addHeapObject(ret);
|
|
303
|
+
}, arguments) };
|
|
304
|
+
imports.wbg.__wbg_crypto_98fc271021c7d2ad = function(arg0) {
|
|
305
|
+
var ret = getObject(arg0).crypto;
|
|
306
|
+
return addHeapObject(ret);
|
|
307
|
+
};
|
|
308
|
+
imports.wbg.__wbg_msCrypto_a2cdb043d2bfe57f = function(arg0) {
|
|
309
|
+
var ret = getObject(arg0).msCrypto;
|
|
310
|
+
return addHeapObject(ret);
|
|
311
|
+
};
|
|
312
|
+
imports.wbg.__wbg_newnoargs_f579424187aa1717 = function(arg0, arg1) {
|
|
313
|
+
var ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
314
|
+
return addHeapObject(ret);
|
|
315
|
+
};
|
|
316
|
+
imports.wbg.__wbg_call_89558c3e96703ca1 = function() { return handleError(function (arg0, arg1) {
|
|
317
|
+
var ret = getObject(arg0).call(getObject(arg1));
|
|
318
|
+
return addHeapObject(ret);
|
|
319
|
+
}, arguments) };
|
|
320
|
+
imports.wbg.__wbg_call_94697a95cb7e239c = function() { return handleError(function (arg0, arg1, arg2) {
|
|
321
|
+
var ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
322
|
+
return addHeapObject(ret);
|
|
323
|
+
}, arguments) };
|
|
324
|
+
imports.wbg.__wbg_getTime_f8ce0ff902444efb = function(arg0) {
|
|
325
|
+
var ret = getObject(arg0).getTime();
|
|
326
|
+
return ret;
|
|
327
|
+
};
|
|
328
|
+
imports.wbg.__wbg_new0_57a6a2c2aaed3fc5 = function() {
|
|
329
|
+
var ret = new Date();
|
|
330
|
+
return addHeapObject(ret);
|
|
331
|
+
};
|
|
332
|
+
imports.wbg.__wbg_new_4beacc9c71572250 = function(arg0, arg1) {
|
|
333
|
+
try {
|
|
334
|
+
var state0 = {a: arg0, b: arg1};
|
|
335
|
+
var cb0 = (arg0, arg1) => {
|
|
336
|
+
const a = state0.a;
|
|
337
|
+
state0.a = 0;
|
|
338
|
+
try {
|
|
339
|
+
return __wbg_adapter_59(a, state0.b, arg0, arg1);
|
|
340
|
+
} finally {
|
|
341
|
+
state0.a = a;
|
|
342
|
+
}
|
|
343
|
+
};
|
|
344
|
+
var ret = new Promise(cb0);
|
|
345
|
+
return addHeapObject(ret);
|
|
346
|
+
} finally {
|
|
347
|
+
state0.a = state0.b = 0;
|
|
348
|
+
}
|
|
349
|
+
};
|
|
350
|
+
imports.wbg.__wbg_resolve_4f8f547f26b30b27 = function(arg0) {
|
|
351
|
+
var ret = Promise.resolve(getObject(arg0));
|
|
352
|
+
return addHeapObject(ret);
|
|
353
|
+
};
|
|
354
|
+
imports.wbg.__wbg_then_a6860c82b90816ca = function(arg0, arg1) {
|
|
355
|
+
var ret = getObject(arg0).then(getObject(arg1));
|
|
356
|
+
return addHeapObject(ret);
|
|
357
|
+
};
|
|
358
|
+
imports.wbg.__wbg_self_e23d74ae45fb17d1 = function() { return handleError(function () {
|
|
359
|
+
var ret = self.self;
|
|
360
|
+
return addHeapObject(ret);
|
|
361
|
+
}, arguments) };
|
|
362
|
+
imports.wbg.__wbg_window_b4be7f48b24ac56e = function() { return handleError(function () {
|
|
363
|
+
var ret = window.window;
|
|
364
|
+
return addHeapObject(ret);
|
|
365
|
+
}, arguments) };
|
|
366
|
+
imports.wbg.__wbg_globalThis_d61b1f48a57191ae = function() { return handleError(function () {
|
|
367
|
+
var ret = globalThis.globalThis;
|
|
368
|
+
return addHeapObject(ret);
|
|
369
|
+
}, arguments) };
|
|
370
|
+
imports.wbg.__wbg_global_e7669da72fd7f239 = function() { return handleError(function () {
|
|
371
|
+
var ret = global.global;
|
|
372
|
+
return addHeapObject(ret);
|
|
373
|
+
}, arguments) };
|
|
374
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
375
|
+
var ret = getObject(arg0) === undefined;
|
|
376
|
+
return ret;
|
|
377
|
+
};
|
|
378
|
+
imports.wbg.__wbg_buffer_5e74a88a1424a2e0 = function(arg0) {
|
|
379
|
+
var ret = getObject(arg0).buffer;
|
|
380
|
+
return addHeapObject(ret);
|
|
381
|
+
};
|
|
382
|
+
imports.wbg.__wbg_new_e3b800e570795b3c = function(arg0) {
|
|
383
|
+
var ret = new Uint8Array(getObject(arg0));
|
|
384
|
+
return addHeapObject(ret);
|
|
385
|
+
};
|
|
386
|
+
imports.wbg.__wbg_set_5b8081e9d002f0df = function(arg0, arg1, arg2) {
|
|
387
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
388
|
+
};
|
|
389
|
+
imports.wbg.__wbg_length_30803400a8f15c59 = function(arg0) {
|
|
390
|
+
var ret = getObject(arg0).length;
|
|
391
|
+
return ret;
|
|
392
|
+
};
|
|
393
|
+
imports.wbg.__wbg_newwithlength_5f4ce114a24dfe1e = function(arg0) {
|
|
394
|
+
var ret = new Uint8Array(arg0 >>> 0);
|
|
395
|
+
return addHeapObject(ret);
|
|
396
|
+
};
|
|
397
|
+
imports.wbg.__wbg_subarray_a68f835ca2af506f = function(arg0, arg1, arg2) {
|
|
398
|
+
var ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
399
|
+
return addHeapObject(ret);
|
|
400
|
+
};
|
|
401
|
+
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
402
|
+
var ret = getObject(arg0);
|
|
403
|
+
return addHeapObject(ret);
|
|
404
|
+
};
|
|
405
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
406
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
407
|
+
};
|
|
408
|
+
imports.wbg.__wbindgen_memory = function() {
|
|
409
|
+
var ret = wasm.memory;
|
|
410
|
+
return addHeapObject(ret);
|
|
411
|
+
};
|
|
412
|
+
imports.wbg.__wbindgen_closure_wrapper796 = function(arg0, arg1, arg2) {
|
|
413
|
+
var ret = makeMutClosure(arg0, arg1, 133, __wbg_adapter_22);
|
|
414
|
+
return addHeapObject(ret);
|
|
415
|
+
};
|
|
416
|
+
|
|
417
|
+
if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
|
|
418
|
+
input = fetch(input);
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
const { instance, module } = await load(await input, imports);
|
|
424
|
+
|
|
425
|
+
wasm = instance.exports;
|
|
426
|
+
init.__wbindgen_wasm_module = module;
|
|
427
|
+
|
|
428
|
+
return wasm;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
export default init;
|
|
432
|
+
|
|
Binary file
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "gluesql-js",
|
|
3
|
+
"collaborators": [
|
|
4
|
+
"Taehoon Moon <taehoon.moon@outlook.com>"
|
|
5
|
+
],
|
|
6
|
+
"description": "GlueSQL - Open source SQL database engine fully written in Rust with pure functional execution layer, easily swappable storage and web assembly support!",
|
|
7
|
+
"version": "0.10.2",
|
|
8
|
+
"license": "Apache-2.0",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/gluesql/gluesql"
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"gluesql_js_bg.wasm",
|
|
15
|
+
"gluesql_js.js"
|
|
16
|
+
],
|
|
17
|
+
"module": "gluesql_js.js",
|
|
18
|
+
"sideEffects": false
|
|
19
|
+
}
|
package/gluesql.js
CHANGED
|
@@ -1,2 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import init, { Glue } from './dist/web/gluesql_js.js';
|
|
2
|
+
|
|
3
|
+
let loaded = false;
|
|
4
|
+
|
|
5
|
+
async function load() {
|
|
6
|
+
await init();
|
|
7
|
+
|
|
8
|
+
loaded = true;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export async function gluesql() {
|
|
12
|
+
if (!loaded) {
|
|
13
|
+
await load();
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return new Glue();
|
|
17
|
+
}
|