jsql-neo 5.4.2 → 5.5.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.
Files changed (72) hide show
  1. package/LICENSE +202 -202
  2. package/README.md +8097 -7971
  3. package/bin/jsql +320 -320
  4. package/bin/jsql-server +90 -90
  5. package/bin/jsql-server-control.js +177 -177
  6. package/index.d.ts +385 -357
  7. package/index.js +124 -118
  8. package/lib/ast.js +214 -0
  9. package/lib/btree.js +413 -413
  10. package/lib/cache.js +328 -328
  11. package/lib/client.js +125 -125
  12. package/lib/database.js +1744 -1744
  13. package/lib/date-types.js +182 -182
  14. package/lib/errors.js +89 -89
  15. package/lib/jsql_format.js +497 -497
  16. package/lib/migrate.js +254 -254
  17. package/lib/mod.js +292 -292
  18. package/lib/mongo_server.js +607 -607
  19. package/lib/multiserver.js +140 -140
  20. package/lib/mysql_compat.js +413 -413
  21. package/lib/mysql_server.js +1237 -1237
  22. package/lib/native_client.js +732 -732
  23. package/lib/nedb_compat.js +506 -506
  24. package/lib/pg_server.js +864 -864
  25. package/lib/plugin.js +34 -34
  26. package/lib/query.js +815 -815
  27. package/lib/redis_server.js +571 -571
  28. package/lib/sql.js +3460 -2925
  29. package/lib/sqlite_compat.js +323 -323
  30. package/lib/sqlite_worker.js +264 -264
  31. package/lib/table.js +1304 -1304
  32. package/lib/tui.js +502 -502
  33. package/lib/wasm.js +1 -1
  34. package/lib/wasm_client.js +718 -718
  35. package/lib/web_ui.js +257 -257
  36. package/native/jsql-neo-native.node +0 -0
  37. package/nativesrc/jsql-neo-core/Cargo.lock +455 -455
  38. package/nativesrc/jsql-neo-core/Cargo.toml +24 -24
  39. package/nativesrc/jsql-neo-core/src/engine/hybrid.rs +455 -455
  40. package/nativesrc/jsql-neo-core/src/engine/memory.rs +168 -168
  41. package/nativesrc/jsql-neo-core/src/engine/mod.rs +62 -62
  42. package/nativesrc/jsql-neo-core/src/engine/table.rs +700 -700
  43. package/nativesrc/jsql-neo-core/src/lib.rs +2 -2
  44. package/nativesrc/jsql-neo-core/src/storage/mod.rs +2 -2
  45. package/nativesrc/jsql-neo-core/src/storage/persistent.rs +1 -1
  46. package/nativesrc/jsql-neo-core/src/storage/wal.rs +85 -85
  47. package/nativesrc/jsql-neo-core/src/types.rs +93 -93
  48. package/nativesrc/jsql-neo-native/Cargo.lock +606 -606
  49. package/nativesrc/jsql-neo-native/Cargo.toml +16 -16
  50. package/nativesrc/jsql-neo-native/build.rs +3 -3
  51. package/nativesrc/jsql-neo-native/package.json +7 -7
  52. package/nativesrc/jsql-neo-native/src/lib.rs +269 -269
  53. package/nativesrc/jsql-neo-wasm/Cargo.lock +465 -465
  54. package/nativesrc/jsql-neo-wasm/Cargo.toml +15 -15
  55. package/nativesrc/jsql-neo-wasm/src/lib.rs +447 -447
  56. package/package.json +87 -86
  57. package/postinstall.js +158 -158
  58. package/test/btree.test.js +128 -128
  59. package/test/coverage.js +187 -187
  60. package/test/join.test.js +110 -110
  61. package/test/native.test.js +158 -158
  62. package/test/regress-5.1.0.js +271 -271
  63. package/test/smoke.js +58 -58
  64. package/test/sql-parser.test.js +273 -0
  65. package/test/wasm.test.js +110 -110
  66. package/wasm/browser.d.ts +89 -89
  67. package/wasm/browser.mjs +569 -569
  68. package/wasm/browser_bg.mjs +597 -597
  69. package/wasm/jsql_neo_wasm.d.ts +38 -38
  70. package/wasm/jsql_neo_wasm.js +520 -520
  71. package/wasm/jsql_neo_wasm_bg.wasm.d.ts +26 -26
  72. package/wasm/package.json +11 -11
@@ -1,597 +1,597 @@
1
- /* @ts-self-types="./jsql_neo_wasm.d.ts" */
2
-
3
- /**
4
- * @returns {string}
5
- */
6
- export function jsql_begin_tx() {
7
- let deferred1_0;
8
- let deferred1_1;
9
- try {
10
- const ret = wasm.jsql_begin_tx();
11
- deferred1_0 = ret[0];
12
- deferred1_1 = ret[1];
13
- return getStringFromWasm0(ret[0], ret[1]);
14
- } finally {
15
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
16
- }
17
- }
18
-
19
- /**
20
- * @param {string} tx_id
21
- * @returns {string}
22
- */
23
- export function jsql_commit_tx(tx_id) {
24
- let deferred2_0;
25
- let deferred2_1;
26
- try {
27
- const ptr0 = passStringToWasm0(tx_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
28
- const len0 = WASM_VECTOR_LEN;
29
- const ret = wasm.jsql_commit_tx(ptr0, len0);
30
- deferred2_0 = ret[0];
31
- deferred2_1 = ret[1];
32
- return getStringFromWasm0(ret[0], ret[1]);
33
- } finally {
34
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
35
- }
36
- }
37
-
38
- /**
39
- * @param {string} table
40
- * @returns {string}
41
- */
42
- export function jsql_count(table) {
43
- let deferred2_0;
44
- let deferred2_1;
45
- try {
46
- const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
47
- const len0 = WASM_VECTOR_LEN;
48
- const ret = wasm.jsql_count(ptr0, len0);
49
- deferred2_0 = ret[0];
50
- deferred2_1 = ret[1];
51
- return getStringFromWasm0(ret[0], ret[1]);
52
- } finally {
53
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
54
- }
55
- }
56
-
57
- /**
58
- * @param {string} name
59
- * @param {string} schema_json
60
- * @returns {string}
61
- */
62
- export function jsql_create_table(name, schema_json) {
63
- let deferred3_0;
64
- let deferred3_1;
65
- try {
66
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
67
- const len0 = WASM_VECTOR_LEN;
68
- const ptr1 = passStringToWasm0(schema_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
69
- const len1 = WASM_VECTOR_LEN;
70
- const ret = wasm.jsql_create_table(ptr0, len0, ptr1, len1);
71
- deferred3_0 = ret[0];
72
- deferred3_1 = ret[1];
73
- return getStringFromWasm0(ret[0], ret[1]);
74
- } finally {
75
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
76
- }
77
- }
78
-
79
- /**
80
- * @param {string} name
81
- * @returns {string}
82
- */
83
- export function jsql_drop_table(name) {
84
- let deferred2_0;
85
- let deferred2_1;
86
- try {
87
- const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
88
- const len0 = WASM_VECTOR_LEN;
89
- const ret = wasm.jsql_drop_table(ptr0, len0);
90
- deferred2_0 = ret[0];
91
- deferred2_1 = ret[1];
92
- return getStringFromWasm0(ret[0], ret[1]);
93
- } finally {
94
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
95
- }
96
- }
97
-
98
- /**
99
- * @param {string} table
100
- * @param {string} filter_json
101
- * @param {number} limit
102
- * @param {number} offset
103
- * @returns {string}
104
- */
105
- export function jsql_find(table, filter_json, limit, offset) {
106
- let deferred3_0;
107
- let deferred3_1;
108
- try {
109
- const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
110
- const len0 = WASM_VECTOR_LEN;
111
- const ptr1 = passStringToWasm0(filter_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
112
- const len1 = WASM_VECTOR_LEN;
113
- const ret = wasm.jsql_find(ptr0, len0, ptr1, len1, limit, offset);
114
- deferred3_0 = ret[0];
115
- deferred3_1 = ret[1];
116
- return getStringFromWasm0(ret[0], ret[1]);
117
- } finally {
118
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
119
- }
120
- }
121
-
122
- /**
123
- * @param {string} table
124
- * @param {bigint} id
125
- * @returns {string}
126
- */
127
- export function jsql_find_by_id(table, id) {
128
- let deferred2_0;
129
- let deferred2_1;
130
- try {
131
- const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
132
- const len0 = WASM_VECTOR_LEN;
133
- const ret = wasm.jsql_find_by_id(ptr0, len0, id);
134
- deferred2_0 = ret[0];
135
- deferred2_1 = ret[1];
136
- return getStringFromWasm0(ret[0], ret[1]);
137
- } finally {
138
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
139
- }
140
- }
141
-
142
- /**
143
- * @param {string} table
144
- * @param {string} ids_json
145
- * @returns {string}
146
- */
147
- export function jsql_find_by_ids(table, ids_json) {
148
- let deferred3_0;
149
- let deferred3_1;
150
- try {
151
- const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
152
- const len0 = WASM_VECTOR_LEN;
153
- const ptr1 = passStringToWasm0(ids_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
154
- const len1 = WASM_VECTOR_LEN;
155
- const ret = wasm.jsql_find_by_ids(ptr0, len0, ptr1, len1);
156
- deferred3_0 = ret[0];
157
- deferred3_1 = ret[1];
158
- return getStringFromWasm0(ret[0], ret[1]);
159
- } finally {
160
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
161
- }
162
- }
163
-
164
- /**
165
- * @param {string} table
166
- * @param {string} data_json
167
- * @returns {string}
168
- */
169
- export function jsql_insert(table, data_json) {
170
- let deferred3_0;
171
- let deferred3_1;
172
- try {
173
- const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
174
- const len0 = WASM_VECTOR_LEN;
175
- const ptr1 = passStringToWasm0(data_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
176
- const len1 = WASM_VECTOR_LEN;
177
- const ret = wasm.jsql_insert(ptr0, len0, ptr1, len1);
178
- deferred3_0 = ret[0];
179
- deferred3_1 = ret[1];
180
- return getStringFromWasm0(ret[0], ret[1]);
181
- } finally {
182
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
183
- }
184
- }
185
-
186
- /**
187
- * @param {string} table
188
- * @param {Uint8Array} data
189
- * @returns {string}
190
- */
191
- export function jsql_insert_buf(table, data) {
192
- let deferred3_0;
193
- let deferred3_1;
194
- try {
195
- const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
196
- const len0 = WASM_VECTOR_LEN;
197
- const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
198
- const len1 = WASM_VECTOR_LEN;
199
- const ret = wasm.jsql_insert_buf(ptr0, len0, ptr1, len1);
200
- deferred3_0 = ret[0];
201
- deferred3_1 = ret[1];
202
- return getStringFromWasm0(ret[0], ret[1]);
203
- } finally {
204
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
205
- }
206
- }
207
-
208
- /**
209
- * @param {string} table
210
- * @param {Uint8Array} data
211
- * @returns {string}
212
- */
213
- export function jsql_insert_buf_count(table, data) {
214
- let deferred3_0;
215
- let deferred3_1;
216
- try {
217
- const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
218
- const len0 = WASM_VECTOR_LEN;
219
- const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
220
- const len1 = WASM_VECTOR_LEN;
221
- const ret = wasm.jsql_insert_buf_count(ptr0, len0, ptr1, len1);
222
- deferred3_0 = ret[0];
223
- deferred3_1 = ret[1];
224
- return getStringFromWasm0(ret[0], ret[1]);
225
- } finally {
226
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
227
- }
228
- }
229
-
230
- /**
231
- * @param {string} table
232
- * @param {string} json
233
- * @returns {string}
234
- */
235
- export function jsql_insert_json(table, json) {
236
- let deferred3_0;
237
- let deferred3_1;
238
- try {
239
- const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
240
- const len0 = WASM_VECTOR_LEN;
241
- const ptr1 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
242
- const len1 = WASM_VECTOR_LEN;
243
- const ret = wasm.jsql_insert_json(ptr0, len0, ptr1, len1);
244
- deferred3_0 = ret[0];
245
- deferred3_1 = ret[1];
246
- return getStringFromWasm0(ret[0], ret[1]);
247
- } finally {
248
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
249
- }
250
- }
251
-
252
- /**
253
- * @param {string} table
254
- * @param {bigint} id
255
- * @returns {string}
256
- */
257
- export function jsql_remove_by_id(table, id) {
258
- let deferred2_0;
259
- let deferred2_1;
260
- try {
261
- const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
262
- const len0 = WASM_VECTOR_LEN;
263
- const ret = wasm.jsql_remove_by_id(ptr0, len0, id);
264
- deferred2_0 = ret[0];
265
- deferred2_1 = ret[1];
266
- return getStringFromWasm0(ret[0], ret[1]);
267
- } finally {
268
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
269
- }
270
- }
271
-
272
- /**
273
- * @param {string} table
274
- * @param {string} ids_json
275
- * @returns {string}
276
- */
277
- export function jsql_remove_by_ids(table, ids_json) {
278
- let deferred3_0;
279
- let deferred3_1;
280
- try {
281
- const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
282
- const len0 = WASM_VECTOR_LEN;
283
- const ptr1 = passStringToWasm0(ids_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
284
- const len1 = WASM_VECTOR_LEN;
285
- const ret = wasm.jsql_remove_by_ids(ptr0, len0, ptr1, len1);
286
- deferred3_0 = ret[0];
287
- deferred3_1 = ret[1];
288
- return getStringFromWasm0(ret[0], ret[1]);
289
- } finally {
290
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
291
- }
292
- }
293
-
294
- export function jsql_reset() {
295
- wasm.jsql_reset();
296
- }
297
-
298
- /**
299
- * @param {string} tx_id
300
- * @returns {string}
301
- */
302
- export function jsql_rollback_tx(tx_id) {
303
- let deferred2_0;
304
- let deferred2_1;
305
- try {
306
- const ptr0 = passStringToWasm0(tx_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
307
- const len0 = WASM_VECTOR_LEN;
308
- const ret = wasm.jsql_rollback_tx(ptr0, len0);
309
- deferred2_0 = ret[0];
310
- deferred2_1 = ret[1];
311
- return getStringFromWasm0(ret[0], ret[1]);
312
- } finally {
313
- wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
314
- }
315
- }
316
-
317
- /**
318
- * @param {string} table
319
- * @param {bigint} id
320
- * @param {string} data_json
321
- * @returns {string}
322
- */
323
- export function jsql_update_by_id(table, id, data_json) {
324
- let deferred3_0;
325
- let deferred3_1;
326
- try {
327
- const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
328
- const len0 = WASM_VECTOR_LEN;
329
- const ptr1 = passStringToWasm0(data_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
330
- const len1 = WASM_VECTOR_LEN;
331
- const ret = wasm.jsql_update_by_id(ptr0, len0, id, ptr1, len1);
332
- deferred3_0 = ret[0];
333
- deferred3_1 = ret[1];
334
- return getStringFromWasm0(ret[0], ret[1]);
335
- } finally {
336
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
337
- }
338
- }
339
-
340
- /**
341
- * @param {string} table
342
- * @param {string} batch_json
343
- * @returns {string}
344
- */
345
- export function jsql_update_by_ids(table, batch_json) {
346
- let deferred3_0;
347
- let deferred3_1;
348
- try {
349
- const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
350
- const len0 = WASM_VECTOR_LEN;
351
- const ptr1 = passStringToWasm0(batch_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
352
- const len1 = WASM_VECTOR_LEN;
353
- const ret = wasm.jsql_update_by_ids(ptr0, len0, ptr1, len1);
354
- deferred3_0 = ret[0];
355
- deferred3_1 = ret[1];
356
- return getStringFromWasm0(ret[0], ret[1]);
357
- } finally {
358
- wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
359
- }
360
- }
361
- function __wbg_get_imports() {
362
- const import0 = {
363
- __proto__: null,
364
- __wbg___wbindgen_string_get_b0ca35b86a603356: function(arg0, arg1) {
365
- const obj = arg1;
366
- const ret = typeof(obj) === 'string' ? obj : undefined;
367
- var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
368
- var len1 = WASM_VECTOR_LEN;
369
- getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
370
- getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
371
- },
372
- __wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
373
- throw new Error(getStringFromWasm0(arg0, arg1));
374
- },
375
- __wbg_new_cc984128914cfc6f: function(arg0) {
376
- const ret = new Date(arg0);
377
- return ret;
378
- },
379
- __wbg_now_86c0d4ba3fa605b8: function() {
380
- const ret = Date.now();
381
- return ret;
382
- },
383
- __wbg_toISOString_706fbe321055ee58: function(arg0) {
384
- const ret = arg0.toISOString();
385
- return ret;
386
- },
387
- __wbindgen_cast_0000000000000001: function(arg0) {
388
- // Cast intrinsic for `F64 -> Externref`.
389
- const ret = arg0;
390
- return ret;
391
- },
392
- __wbindgen_init_externref_table: function() {
393
- const table = wasm.__wbindgen_externrefs;
394
- const offset = table.grow(4);
395
- table.set(0, undefined);
396
- table.set(offset + 0, undefined);
397
- table.set(offset + 1, null);
398
- table.set(offset + 2, true);
399
- table.set(offset + 3, false);
400
- },
401
- };
402
- return {
403
- __proto__: null,
404
- "./jsql_neo_wasm_bg.js": import0,
405
- };
406
- }
407
-
408
- let cachedDataViewMemory0 = null;
409
- function getDataViewMemory0() {
410
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
411
- cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
412
- }
413
- return cachedDataViewMemory0;
414
- }
415
-
416
- function getStringFromWasm0(ptr, len) {
417
- return decodeText(ptr >>> 0, len);
418
- }
419
-
420
- let cachedUint8ArrayMemory0 = null;
421
- function getUint8ArrayMemory0() {
422
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
423
- cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
424
- }
425
- return cachedUint8ArrayMemory0;
426
- }
427
-
428
- function isLikeNone(x) {
429
- return x === undefined || x === null;
430
- }
431
-
432
- function passArray8ToWasm0(arg, malloc) {
433
- const ptr = malloc(arg.length * 1, 1) >>> 0;
434
- getUint8ArrayMemory0().set(arg, ptr / 1);
435
- WASM_VECTOR_LEN = arg.length;
436
- return ptr;
437
- }
438
-
439
- function passStringToWasm0(arg, malloc, realloc) {
440
- if (realloc === undefined) {
441
- const buf = cachedTextEncoder.encode(arg);
442
- const ptr = malloc(buf.length, 1) >>> 0;
443
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
444
- WASM_VECTOR_LEN = buf.length;
445
- return ptr;
446
- }
447
-
448
- let len = arg.length;
449
- let ptr = malloc(len, 1) >>> 0;
450
-
451
- const mem = getUint8ArrayMemory0();
452
-
453
- let offset = 0;
454
-
455
- for (; offset < len; offset++) {
456
- const code = arg.charCodeAt(offset);
457
- if (code > 0x7F) break;
458
- mem[ptr + offset] = code;
459
- }
460
- if (offset !== len) {
461
- if (offset !== 0) {
462
- arg = arg.slice(offset);
463
- }
464
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
465
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
466
- const ret = cachedTextEncoder.encodeInto(arg, view);
467
-
468
- offset += ret.written;
469
- ptr = realloc(ptr, len, offset, 1) >>> 0;
470
- }
471
-
472
- WASM_VECTOR_LEN = offset;
473
- return ptr;
474
- }
475
-
476
- let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
477
- cachedTextDecoder.decode();
478
- const MAX_SAFARI_DECODE_BYTES = 2146435072;
479
- let numBytesDecoded = 0;
480
- function decodeText(ptr, len) {
481
- numBytesDecoded += len;
482
- if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
483
- cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
484
- cachedTextDecoder.decode();
485
- numBytesDecoded = len;
486
- }
487
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
488
- }
489
-
490
- const cachedTextEncoder = new TextEncoder();
491
-
492
- if (!('encodeInto' in cachedTextEncoder)) {
493
- cachedTextEncoder.encodeInto = function (arg, view) {
494
- const buf = cachedTextEncoder.encode(arg);
495
- view.set(buf);
496
- return {
497
- read: arg.length,
498
- written: buf.length
499
- };
500
- };
501
- }
502
-
503
- let WASM_VECTOR_LEN = 0;
504
-
505
- let wasmModule, wasmInstance, wasm;
506
- function __wbg_finalize_init(instance, module) {
507
- wasmInstance = instance;
508
- wasm = instance.exports;
509
- wasmModule = module;
510
- cachedDataViewMemory0 = null;
511
- cachedUint8ArrayMemory0 = null;
512
- wasm.__wbindgen_start();
513
- return wasm;
514
- }
515
-
516
- async function __wbg_load(module, imports) {
517
- if (typeof Response === 'function' && module instanceof Response) {
518
- if (typeof WebAssembly.instantiateStreaming === 'function') {
519
- try {
520
- return await WebAssembly.instantiateStreaming(module, imports);
521
- } catch (e) {
522
- const validResponse = module.ok && expectedResponseType(module.type);
523
-
524
- if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
525
- 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);
526
-
527
- } else { throw e; }
528
- }
529
- }
530
-
531
- const bytes = await module.arrayBuffer();
532
- return await WebAssembly.instantiate(bytes, imports);
533
- } else {
534
- const instance = await WebAssembly.instantiate(module, imports);
535
-
536
- if (instance instanceof WebAssembly.Instance) {
537
- return { instance, module };
538
- } else {
539
- return instance;
540
- }
541
- }
542
-
543
- function expectedResponseType(type) {
544
- switch (type) {
545
- case 'basic': case 'cors': case 'default': return true;
546
- }
547
- return false;
548
- }
549
- }
550
-
551
- function initSync(module) {
552
- if (wasm !== undefined) return wasm;
553
-
554
-
555
- if (module !== undefined) {
556
- if (Object.getPrototypeOf(module) === Object.prototype) {
557
- ({module} = module)
558
- } else {
559
- console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
560
- }
561
- }
562
-
563
- const imports = __wbg_get_imports();
564
- if (!(module instanceof WebAssembly.Module)) {
565
- module = new WebAssembly.Module(module);
566
- }
567
- const instance = new WebAssembly.Instance(module, imports);
568
- return __wbg_finalize_init(instance, module);
569
- }
570
-
571
- async function __wbg_init(module_or_path) {
572
- if (wasm !== undefined) return wasm;
573
-
574
-
575
- if (module_or_path !== undefined) {
576
- if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
577
- ({module_or_path} = module_or_path)
578
- } else {
579
- console.warn('using deprecated parameters for the initialization function; pass a single object instead')
580
- }
581
- }
582
-
583
- if (module_or_path === undefined) {
584
- module_or_path = new URL('jsql_neo_wasm_bg.wasm', import.meta.url);
585
- }
586
- const imports = __wbg_get_imports();
587
-
588
- if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
589
- module_or_path = fetch(module_or_path);
590
- }
591
-
592
- const { instance, module } = await __wbg_load(await module_or_path, imports);
593
-
594
- return __wbg_finalize_init(instance, module);
595
- }
596
-
597
- export { initSync, __wbg_init as default };
1
+ /* @ts-self-types="./jsql_neo_wasm.d.ts" */
2
+
3
+ /**
4
+ * @returns {string}
5
+ */
6
+ export function jsql_begin_tx() {
7
+ let deferred1_0;
8
+ let deferred1_1;
9
+ try {
10
+ const ret = wasm.jsql_begin_tx();
11
+ deferred1_0 = ret[0];
12
+ deferred1_1 = ret[1];
13
+ return getStringFromWasm0(ret[0], ret[1]);
14
+ } finally {
15
+ wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
16
+ }
17
+ }
18
+
19
+ /**
20
+ * @param {string} tx_id
21
+ * @returns {string}
22
+ */
23
+ export function jsql_commit_tx(tx_id) {
24
+ let deferred2_0;
25
+ let deferred2_1;
26
+ try {
27
+ const ptr0 = passStringToWasm0(tx_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
28
+ const len0 = WASM_VECTOR_LEN;
29
+ const ret = wasm.jsql_commit_tx(ptr0, len0);
30
+ deferred2_0 = ret[0];
31
+ deferred2_1 = ret[1];
32
+ return getStringFromWasm0(ret[0], ret[1]);
33
+ } finally {
34
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
35
+ }
36
+ }
37
+
38
+ /**
39
+ * @param {string} table
40
+ * @returns {string}
41
+ */
42
+ export function jsql_count(table) {
43
+ let deferred2_0;
44
+ let deferred2_1;
45
+ try {
46
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
47
+ const len0 = WASM_VECTOR_LEN;
48
+ const ret = wasm.jsql_count(ptr0, len0);
49
+ deferred2_0 = ret[0];
50
+ deferred2_1 = ret[1];
51
+ return getStringFromWasm0(ret[0], ret[1]);
52
+ } finally {
53
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
54
+ }
55
+ }
56
+
57
+ /**
58
+ * @param {string} name
59
+ * @param {string} schema_json
60
+ * @returns {string}
61
+ */
62
+ export function jsql_create_table(name, schema_json) {
63
+ let deferred3_0;
64
+ let deferred3_1;
65
+ try {
66
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
67
+ const len0 = WASM_VECTOR_LEN;
68
+ const ptr1 = passStringToWasm0(schema_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
69
+ const len1 = WASM_VECTOR_LEN;
70
+ const ret = wasm.jsql_create_table(ptr0, len0, ptr1, len1);
71
+ deferred3_0 = ret[0];
72
+ deferred3_1 = ret[1];
73
+ return getStringFromWasm0(ret[0], ret[1]);
74
+ } finally {
75
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
76
+ }
77
+ }
78
+
79
+ /**
80
+ * @param {string} name
81
+ * @returns {string}
82
+ */
83
+ export function jsql_drop_table(name) {
84
+ let deferred2_0;
85
+ let deferred2_1;
86
+ try {
87
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
88
+ const len0 = WASM_VECTOR_LEN;
89
+ const ret = wasm.jsql_drop_table(ptr0, len0);
90
+ deferred2_0 = ret[0];
91
+ deferred2_1 = ret[1];
92
+ return getStringFromWasm0(ret[0], ret[1]);
93
+ } finally {
94
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
95
+ }
96
+ }
97
+
98
+ /**
99
+ * @param {string} table
100
+ * @param {string} filter_json
101
+ * @param {number} limit
102
+ * @param {number} offset
103
+ * @returns {string}
104
+ */
105
+ export function jsql_find(table, filter_json, limit, offset) {
106
+ let deferred3_0;
107
+ let deferred3_1;
108
+ try {
109
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
110
+ const len0 = WASM_VECTOR_LEN;
111
+ const ptr1 = passStringToWasm0(filter_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
112
+ const len1 = WASM_VECTOR_LEN;
113
+ const ret = wasm.jsql_find(ptr0, len0, ptr1, len1, limit, offset);
114
+ deferred3_0 = ret[0];
115
+ deferred3_1 = ret[1];
116
+ return getStringFromWasm0(ret[0], ret[1]);
117
+ } finally {
118
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
119
+ }
120
+ }
121
+
122
+ /**
123
+ * @param {string} table
124
+ * @param {bigint} id
125
+ * @returns {string}
126
+ */
127
+ export function jsql_find_by_id(table, id) {
128
+ let deferred2_0;
129
+ let deferred2_1;
130
+ try {
131
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
132
+ const len0 = WASM_VECTOR_LEN;
133
+ const ret = wasm.jsql_find_by_id(ptr0, len0, id);
134
+ deferred2_0 = ret[0];
135
+ deferred2_1 = ret[1];
136
+ return getStringFromWasm0(ret[0], ret[1]);
137
+ } finally {
138
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
139
+ }
140
+ }
141
+
142
+ /**
143
+ * @param {string} table
144
+ * @param {string} ids_json
145
+ * @returns {string}
146
+ */
147
+ export function jsql_find_by_ids(table, ids_json) {
148
+ let deferred3_0;
149
+ let deferred3_1;
150
+ try {
151
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
152
+ const len0 = WASM_VECTOR_LEN;
153
+ const ptr1 = passStringToWasm0(ids_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
154
+ const len1 = WASM_VECTOR_LEN;
155
+ const ret = wasm.jsql_find_by_ids(ptr0, len0, ptr1, len1);
156
+ deferred3_0 = ret[0];
157
+ deferred3_1 = ret[1];
158
+ return getStringFromWasm0(ret[0], ret[1]);
159
+ } finally {
160
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
161
+ }
162
+ }
163
+
164
+ /**
165
+ * @param {string} table
166
+ * @param {string} data_json
167
+ * @returns {string}
168
+ */
169
+ export function jsql_insert(table, data_json) {
170
+ let deferred3_0;
171
+ let deferred3_1;
172
+ try {
173
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
174
+ const len0 = WASM_VECTOR_LEN;
175
+ const ptr1 = passStringToWasm0(data_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
176
+ const len1 = WASM_VECTOR_LEN;
177
+ const ret = wasm.jsql_insert(ptr0, len0, ptr1, len1);
178
+ deferred3_0 = ret[0];
179
+ deferred3_1 = ret[1];
180
+ return getStringFromWasm0(ret[0], ret[1]);
181
+ } finally {
182
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
183
+ }
184
+ }
185
+
186
+ /**
187
+ * @param {string} table
188
+ * @param {Uint8Array} data
189
+ * @returns {string}
190
+ */
191
+ export function jsql_insert_buf(table, data) {
192
+ let deferred3_0;
193
+ let deferred3_1;
194
+ try {
195
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
196
+ const len0 = WASM_VECTOR_LEN;
197
+ const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
198
+ const len1 = WASM_VECTOR_LEN;
199
+ const ret = wasm.jsql_insert_buf(ptr0, len0, ptr1, len1);
200
+ deferred3_0 = ret[0];
201
+ deferred3_1 = ret[1];
202
+ return getStringFromWasm0(ret[0], ret[1]);
203
+ } finally {
204
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
205
+ }
206
+ }
207
+
208
+ /**
209
+ * @param {string} table
210
+ * @param {Uint8Array} data
211
+ * @returns {string}
212
+ */
213
+ export function jsql_insert_buf_count(table, data) {
214
+ let deferred3_0;
215
+ let deferred3_1;
216
+ try {
217
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
218
+ const len0 = WASM_VECTOR_LEN;
219
+ const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
220
+ const len1 = WASM_VECTOR_LEN;
221
+ const ret = wasm.jsql_insert_buf_count(ptr0, len0, ptr1, len1);
222
+ deferred3_0 = ret[0];
223
+ deferred3_1 = ret[1];
224
+ return getStringFromWasm0(ret[0], ret[1]);
225
+ } finally {
226
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
227
+ }
228
+ }
229
+
230
+ /**
231
+ * @param {string} table
232
+ * @param {string} json
233
+ * @returns {string}
234
+ */
235
+ export function jsql_insert_json(table, json) {
236
+ let deferred3_0;
237
+ let deferred3_1;
238
+ try {
239
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
240
+ const len0 = WASM_VECTOR_LEN;
241
+ const ptr1 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
242
+ const len1 = WASM_VECTOR_LEN;
243
+ const ret = wasm.jsql_insert_json(ptr0, len0, ptr1, len1);
244
+ deferred3_0 = ret[0];
245
+ deferred3_1 = ret[1];
246
+ return getStringFromWasm0(ret[0], ret[1]);
247
+ } finally {
248
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
249
+ }
250
+ }
251
+
252
+ /**
253
+ * @param {string} table
254
+ * @param {bigint} id
255
+ * @returns {string}
256
+ */
257
+ export function jsql_remove_by_id(table, id) {
258
+ let deferred2_0;
259
+ let deferred2_1;
260
+ try {
261
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
262
+ const len0 = WASM_VECTOR_LEN;
263
+ const ret = wasm.jsql_remove_by_id(ptr0, len0, id);
264
+ deferred2_0 = ret[0];
265
+ deferred2_1 = ret[1];
266
+ return getStringFromWasm0(ret[0], ret[1]);
267
+ } finally {
268
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
269
+ }
270
+ }
271
+
272
+ /**
273
+ * @param {string} table
274
+ * @param {string} ids_json
275
+ * @returns {string}
276
+ */
277
+ export function jsql_remove_by_ids(table, ids_json) {
278
+ let deferred3_0;
279
+ let deferred3_1;
280
+ try {
281
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
282
+ const len0 = WASM_VECTOR_LEN;
283
+ const ptr1 = passStringToWasm0(ids_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
284
+ const len1 = WASM_VECTOR_LEN;
285
+ const ret = wasm.jsql_remove_by_ids(ptr0, len0, ptr1, len1);
286
+ deferred3_0 = ret[0];
287
+ deferred3_1 = ret[1];
288
+ return getStringFromWasm0(ret[0], ret[1]);
289
+ } finally {
290
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
291
+ }
292
+ }
293
+
294
+ export function jsql_reset() {
295
+ wasm.jsql_reset();
296
+ }
297
+
298
+ /**
299
+ * @param {string} tx_id
300
+ * @returns {string}
301
+ */
302
+ export function jsql_rollback_tx(tx_id) {
303
+ let deferred2_0;
304
+ let deferred2_1;
305
+ try {
306
+ const ptr0 = passStringToWasm0(tx_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
307
+ const len0 = WASM_VECTOR_LEN;
308
+ const ret = wasm.jsql_rollback_tx(ptr0, len0);
309
+ deferred2_0 = ret[0];
310
+ deferred2_1 = ret[1];
311
+ return getStringFromWasm0(ret[0], ret[1]);
312
+ } finally {
313
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
314
+ }
315
+ }
316
+
317
+ /**
318
+ * @param {string} table
319
+ * @param {bigint} id
320
+ * @param {string} data_json
321
+ * @returns {string}
322
+ */
323
+ export function jsql_update_by_id(table, id, data_json) {
324
+ let deferred3_0;
325
+ let deferred3_1;
326
+ try {
327
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
328
+ const len0 = WASM_VECTOR_LEN;
329
+ const ptr1 = passStringToWasm0(data_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
330
+ const len1 = WASM_VECTOR_LEN;
331
+ const ret = wasm.jsql_update_by_id(ptr0, len0, id, ptr1, len1);
332
+ deferred3_0 = ret[0];
333
+ deferred3_1 = ret[1];
334
+ return getStringFromWasm0(ret[0], ret[1]);
335
+ } finally {
336
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
337
+ }
338
+ }
339
+
340
+ /**
341
+ * @param {string} table
342
+ * @param {string} batch_json
343
+ * @returns {string}
344
+ */
345
+ export function jsql_update_by_ids(table, batch_json) {
346
+ let deferred3_0;
347
+ let deferred3_1;
348
+ try {
349
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
350
+ const len0 = WASM_VECTOR_LEN;
351
+ const ptr1 = passStringToWasm0(batch_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
352
+ const len1 = WASM_VECTOR_LEN;
353
+ const ret = wasm.jsql_update_by_ids(ptr0, len0, ptr1, len1);
354
+ deferred3_0 = ret[0];
355
+ deferred3_1 = ret[1];
356
+ return getStringFromWasm0(ret[0], ret[1]);
357
+ } finally {
358
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
359
+ }
360
+ }
361
+ function __wbg_get_imports() {
362
+ const import0 = {
363
+ __proto__: null,
364
+ __wbg___wbindgen_string_get_b0ca35b86a603356: function(arg0, arg1) {
365
+ const obj = arg1;
366
+ const ret = typeof(obj) === 'string' ? obj : undefined;
367
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
368
+ var len1 = WASM_VECTOR_LEN;
369
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
370
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
371
+ },
372
+ __wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
373
+ throw new Error(getStringFromWasm0(arg0, arg1));
374
+ },
375
+ __wbg_new_cc984128914cfc6f: function(arg0) {
376
+ const ret = new Date(arg0);
377
+ return ret;
378
+ },
379
+ __wbg_now_86c0d4ba3fa605b8: function() {
380
+ const ret = Date.now();
381
+ return ret;
382
+ },
383
+ __wbg_toISOString_706fbe321055ee58: function(arg0) {
384
+ const ret = arg0.toISOString();
385
+ return ret;
386
+ },
387
+ __wbindgen_cast_0000000000000001: function(arg0) {
388
+ // Cast intrinsic for `F64 -> Externref`.
389
+ const ret = arg0;
390
+ return ret;
391
+ },
392
+ __wbindgen_init_externref_table: function() {
393
+ const table = wasm.__wbindgen_externrefs;
394
+ const offset = table.grow(4);
395
+ table.set(0, undefined);
396
+ table.set(offset + 0, undefined);
397
+ table.set(offset + 1, null);
398
+ table.set(offset + 2, true);
399
+ table.set(offset + 3, false);
400
+ },
401
+ };
402
+ return {
403
+ __proto__: null,
404
+ "./jsql_neo_wasm_bg.js": import0,
405
+ };
406
+ }
407
+
408
+ let cachedDataViewMemory0 = null;
409
+ function getDataViewMemory0() {
410
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
411
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
412
+ }
413
+ return cachedDataViewMemory0;
414
+ }
415
+
416
+ function getStringFromWasm0(ptr, len) {
417
+ return decodeText(ptr >>> 0, len);
418
+ }
419
+
420
+ let cachedUint8ArrayMemory0 = null;
421
+ function getUint8ArrayMemory0() {
422
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
423
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
424
+ }
425
+ return cachedUint8ArrayMemory0;
426
+ }
427
+
428
+ function isLikeNone(x) {
429
+ return x === undefined || x === null;
430
+ }
431
+
432
+ function passArray8ToWasm0(arg, malloc) {
433
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
434
+ getUint8ArrayMemory0().set(arg, ptr / 1);
435
+ WASM_VECTOR_LEN = arg.length;
436
+ return ptr;
437
+ }
438
+
439
+ function passStringToWasm0(arg, malloc, realloc) {
440
+ if (realloc === undefined) {
441
+ const buf = cachedTextEncoder.encode(arg);
442
+ const ptr = malloc(buf.length, 1) >>> 0;
443
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
444
+ WASM_VECTOR_LEN = buf.length;
445
+ return ptr;
446
+ }
447
+
448
+ let len = arg.length;
449
+ let ptr = malloc(len, 1) >>> 0;
450
+
451
+ const mem = getUint8ArrayMemory0();
452
+
453
+ let offset = 0;
454
+
455
+ for (; offset < len; offset++) {
456
+ const code = arg.charCodeAt(offset);
457
+ if (code > 0x7F) break;
458
+ mem[ptr + offset] = code;
459
+ }
460
+ if (offset !== len) {
461
+ if (offset !== 0) {
462
+ arg = arg.slice(offset);
463
+ }
464
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
465
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
466
+ const ret = cachedTextEncoder.encodeInto(arg, view);
467
+
468
+ offset += ret.written;
469
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
470
+ }
471
+
472
+ WASM_VECTOR_LEN = offset;
473
+ return ptr;
474
+ }
475
+
476
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
477
+ cachedTextDecoder.decode();
478
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
479
+ let numBytesDecoded = 0;
480
+ function decodeText(ptr, len) {
481
+ numBytesDecoded += len;
482
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
483
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
484
+ cachedTextDecoder.decode();
485
+ numBytesDecoded = len;
486
+ }
487
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
488
+ }
489
+
490
+ const cachedTextEncoder = new TextEncoder();
491
+
492
+ if (!('encodeInto' in cachedTextEncoder)) {
493
+ cachedTextEncoder.encodeInto = function (arg, view) {
494
+ const buf = cachedTextEncoder.encode(arg);
495
+ view.set(buf);
496
+ return {
497
+ read: arg.length,
498
+ written: buf.length
499
+ };
500
+ };
501
+ }
502
+
503
+ let WASM_VECTOR_LEN = 0;
504
+
505
+ let wasmModule, wasmInstance, wasm;
506
+ function __wbg_finalize_init(instance, module) {
507
+ wasmInstance = instance;
508
+ wasm = instance.exports;
509
+ wasmModule = module;
510
+ cachedDataViewMemory0 = null;
511
+ cachedUint8ArrayMemory0 = null;
512
+ wasm.__wbindgen_start();
513
+ return wasm;
514
+ }
515
+
516
+ async function __wbg_load(module, imports) {
517
+ if (typeof Response === 'function' && module instanceof Response) {
518
+ if (typeof WebAssembly.instantiateStreaming === 'function') {
519
+ try {
520
+ return await WebAssembly.instantiateStreaming(module, imports);
521
+ } catch (e) {
522
+ const validResponse = module.ok && expectedResponseType(module.type);
523
+
524
+ if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
525
+ 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);
526
+
527
+ } else { throw e; }
528
+ }
529
+ }
530
+
531
+ const bytes = await module.arrayBuffer();
532
+ return await WebAssembly.instantiate(bytes, imports);
533
+ } else {
534
+ const instance = await WebAssembly.instantiate(module, imports);
535
+
536
+ if (instance instanceof WebAssembly.Instance) {
537
+ return { instance, module };
538
+ } else {
539
+ return instance;
540
+ }
541
+ }
542
+
543
+ function expectedResponseType(type) {
544
+ switch (type) {
545
+ case 'basic': case 'cors': case 'default': return true;
546
+ }
547
+ return false;
548
+ }
549
+ }
550
+
551
+ function initSync(module) {
552
+ if (wasm !== undefined) return wasm;
553
+
554
+
555
+ if (module !== undefined) {
556
+ if (Object.getPrototypeOf(module) === Object.prototype) {
557
+ ({module} = module)
558
+ } else {
559
+ console.warn('using deprecated parameters for `initSync()`; pass a single object instead')
560
+ }
561
+ }
562
+
563
+ const imports = __wbg_get_imports();
564
+ if (!(module instanceof WebAssembly.Module)) {
565
+ module = new WebAssembly.Module(module);
566
+ }
567
+ const instance = new WebAssembly.Instance(module, imports);
568
+ return __wbg_finalize_init(instance, module);
569
+ }
570
+
571
+ async function __wbg_init(module_or_path) {
572
+ if (wasm !== undefined) return wasm;
573
+
574
+
575
+ if (module_or_path !== undefined) {
576
+ if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
577
+ ({module_or_path} = module_or_path)
578
+ } else {
579
+ console.warn('using deprecated parameters for the initialization function; pass a single object instead')
580
+ }
581
+ }
582
+
583
+ if (module_or_path === undefined) {
584
+ module_or_path = new URL('jsql_neo_wasm_bg.wasm', import.meta.url);
585
+ }
586
+ const imports = __wbg_get_imports();
587
+
588
+ if (typeof module_or_path === 'string' || (typeof Request === 'function' && module_or_path instanceof Request) || (typeof URL === 'function' && module_or_path instanceof URL)) {
589
+ module_or_path = fetch(module_or_path);
590
+ }
591
+
592
+ const { instance, module } = await __wbg_load(await module_or_path, imports);
593
+
594
+ return __wbg_finalize_init(instance, module);
595
+ }
596
+
597
+ export { initSync, __wbg_init as default };