jsql-neo 4.2.0 → 4.3.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.
@@ -0,0 +1,462 @@
1
+ let wasm;
2
+
3
+ /* @ts-self-types="./jsql_neo_wasm.d.ts" */
4
+
5
+ /**
6
+ * @param {string} table
7
+ * @returns {string}
8
+ */
9
+ function jsql_count(table) {
10
+ let deferred2_0;
11
+ let deferred2_1;
12
+ try {
13
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
14
+ const len0 = WASM_VECTOR_LEN;
15
+ const ret = wasm.jsql_count(ptr0, len0);
16
+ deferred2_0 = ret[0];
17
+ deferred2_1 = ret[1];
18
+ return getStringFromWasm0(ret[0], ret[1]);
19
+ } finally {
20
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
21
+ }
22
+ }
23
+
24
+ /**
25
+ * @param {string} name
26
+ * @param {string} schema_json
27
+ * @returns {string}
28
+ */
29
+ function jsql_create_table(name, schema_json) {
30
+ let deferred3_0;
31
+ let deferred3_1;
32
+ try {
33
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
34
+ const len0 = WASM_VECTOR_LEN;
35
+ const ptr1 = passStringToWasm0(schema_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
36
+ const len1 = WASM_VECTOR_LEN;
37
+ const ret = wasm.jsql_create_table(ptr0, len0, ptr1, len1);
38
+ deferred3_0 = ret[0];
39
+ deferred3_1 = ret[1];
40
+ return getStringFromWasm0(ret[0], ret[1]);
41
+ } finally {
42
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
43
+ }
44
+ }
45
+
46
+ /**
47
+ * @param {string} name
48
+ * @returns {string}
49
+ */
50
+ function jsql_drop_table(name) {
51
+ let deferred2_0;
52
+ let deferred2_1;
53
+ try {
54
+ const ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
55
+ const len0 = WASM_VECTOR_LEN;
56
+ const ret = wasm.jsql_drop_table(ptr0, len0);
57
+ deferred2_0 = ret[0];
58
+ deferred2_1 = ret[1];
59
+ return getStringFromWasm0(ret[0], ret[1]);
60
+ } finally {
61
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
62
+ }
63
+ }
64
+
65
+ /**
66
+ * @param {string} table
67
+ * @param {string} filter_json
68
+ * @param {number} limit
69
+ * @param {number} offset
70
+ * @returns {string}
71
+ */
72
+ function jsql_find(table, filter_json, limit, offset) {
73
+ let deferred3_0;
74
+ let deferred3_1;
75
+ try {
76
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
77
+ const len0 = WASM_VECTOR_LEN;
78
+ const ptr1 = passStringToWasm0(filter_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
79
+ const len1 = WASM_VECTOR_LEN;
80
+ const ret = wasm.jsql_find(ptr0, len0, ptr1, len1, limit, offset);
81
+ deferred3_0 = ret[0];
82
+ deferred3_1 = ret[1];
83
+ return getStringFromWasm0(ret[0], ret[1]);
84
+ } finally {
85
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
86
+ }
87
+ }
88
+
89
+ /**
90
+ * @param {string} table
91
+ * @param {bigint} id
92
+ * @returns {string}
93
+ */
94
+ function jsql_find_by_id(table, id) {
95
+ let deferred2_0;
96
+ let deferred2_1;
97
+ try {
98
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
99
+ const len0 = WASM_VECTOR_LEN;
100
+ const ret = wasm.jsql_find_by_id(ptr0, len0, id);
101
+ deferred2_0 = ret[0];
102
+ deferred2_1 = ret[1];
103
+ return getStringFromWasm0(ret[0], ret[1]);
104
+ } finally {
105
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
106
+ }
107
+ }
108
+
109
+ /**
110
+ * @param {string} table
111
+ * @param {string} ids_json
112
+ * @returns {string}
113
+ */
114
+ function jsql_find_by_ids(table, ids_json) {
115
+ let deferred3_0;
116
+ let deferred3_1;
117
+ try {
118
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
119
+ const len0 = WASM_VECTOR_LEN;
120
+ const ptr1 = passStringToWasm0(ids_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
121
+ const len1 = WASM_VECTOR_LEN;
122
+ const ret = wasm.jsql_find_by_ids(ptr0, len0, ptr1, len1);
123
+ deferred3_0 = ret[0];
124
+ deferred3_1 = ret[1];
125
+ return getStringFromWasm0(ret[0], ret[1]);
126
+ } finally {
127
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
128
+ }
129
+ }
130
+
131
+ /**
132
+ * @param {string} table
133
+ * @param {string} data_json
134
+ * @returns {string}
135
+ */
136
+ function jsql_insert(table, data_json) {
137
+ let deferred3_0;
138
+ let deferred3_1;
139
+ try {
140
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
141
+ const len0 = WASM_VECTOR_LEN;
142
+ const ptr1 = passStringToWasm0(data_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
143
+ const len1 = WASM_VECTOR_LEN;
144
+ const ret = wasm.jsql_insert(ptr0, len0, ptr1, len1);
145
+ deferred3_0 = ret[0];
146
+ deferred3_1 = ret[1];
147
+ return getStringFromWasm0(ret[0], ret[1]);
148
+ } finally {
149
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
150
+ }
151
+ }
152
+
153
+ /**
154
+ * @param {string} table
155
+ * @param {Uint8Array} data
156
+ * @returns {string}
157
+ */
158
+ function jsql_insert_buf(table, data) {
159
+ let deferred3_0;
160
+ let deferred3_1;
161
+ try {
162
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
163
+ const len0 = WASM_VECTOR_LEN;
164
+ const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
165
+ const len1 = WASM_VECTOR_LEN;
166
+ const ret = wasm.jsql_insert_buf(ptr0, len0, ptr1, len1);
167
+ deferred3_0 = ret[0];
168
+ deferred3_1 = ret[1];
169
+ return getStringFromWasm0(ret[0], ret[1]);
170
+ } finally {
171
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
172
+ }
173
+ }
174
+
175
+ /**
176
+ * @param {string} table
177
+ * @param {Uint8Array} data
178
+ * @returns {string}
179
+ */
180
+ function jsql_insert_buf_count(table, data) {
181
+ let deferred3_0;
182
+ let deferred3_1;
183
+ try {
184
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
185
+ const len0 = WASM_VECTOR_LEN;
186
+ const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
187
+ const len1 = WASM_VECTOR_LEN;
188
+ const ret = wasm.jsql_insert_buf_count(ptr0, len0, ptr1, len1);
189
+ deferred3_0 = ret[0];
190
+ deferred3_1 = ret[1];
191
+ return getStringFromWasm0(ret[0], ret[1]);
192
+ } finally {
193
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
194
+ }
195
+ }
196
+
197
+ /**
198
+ * @param {string} table
199
+ * @param {string} json
200
+ * @returns {string}
201
+ */
202
+ function jsql_insert_json(table, json) {
203
+ let deferred3_0;
204
+ let deferred3_1;
205
+ try {
206
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
207
+ const len0 = WASM_VECTOR_LEN;
208
+ const ptr1 = passStringToWasm0(json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
209
+ const len1 = WASM_VECTOR_LEN;
210
+ const ret = wasm.jsql_insert_json(ptr0, len0, ptr1, len1);
211
+ deferred3_0 = ret[0];
212
+ deferred3_1 = ret[1];
213
+ return getStringFromWasm0(ret[0], ret[1]);
214
+ } finally {
215
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
216
+ }
217
+ }
218
+
219
+ /**
220
+ * @param {string} table
221
+ * @param {bigint} id
222
+ * @returns {string}
223
+ */
224
+ function jsql_remove_by_id(table, id) {
225
+ let deferred2_0;
226
+ let deferred2_1;
227
+ try {
228
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
229
+ const len0 = WASM_VECTOR_LEN;
230
+ const ret = wasm.jsql_remove_by_id(ptr0, len0, id);
231
+ deferred2_0 = ret[0];
232
+ deferred2_1 = ret[1];
233
+ return getStringFromWasm0(ret[0], ret[1]);
234
+ } finally {
235
+ wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
236
+ }
237
+ }
238
+
239
+ /**
240
+ * @param {string} table
241
+ * @param {string} ids_json
242
+ * @returns {string}
243
+ */
244
+ function jsql_remove_by_ids(table, ids_json) {
245
+ let deferred3_0;
246
+ let deferred3_1;
247
+ try {
248
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
249
+ const len0 = WASM_VECTOR_LEN;
250
+ const ptr1 = passStringToWasm0(ids_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
251
+ const len1 = WASM_VECTOR_LEN;
252
+ const ret = wasm.jsql_remove_by_ids(ptr0, len0, ptr1, len1);
253
+ deferred3_0 = ret[0];
254
+ deferred3_1 = ret[1];
255
+ return getStringFromWasm0(ret[0], ret[1]);
256
+ } finally {
257
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
258
+ }
259
+ }
260
+
261
+ function jsql_reset() {
262
+ wasm.jsql_reset();
263
+ }
264
+
265
+ /**
266
+ * @param {string} table
267
+ * @param {bigint} id
268
+ * @param {string} data_json
269
+ * @returns {string}
270
+ */
271
+ function jsql_update_by_id(table, id, data_json) {
272
+ let deferred3_0;
273
+ let deferred3_1;
274
+ try {
275
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
276
+ const len0 = WASM_VECTOR_LEN;
277
+ const ptr1 = passStringToWasm0(data_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
278
+ const len1 = WASM_VECTOR_LEN;
279
+ const ret = wasm.jsql_update_by_id(ptr0, len0, id, ptr1, len1);
280
+ deferred3_0 = ret[0];
281
+ deferred3_1 = ret[1];
282
+ return getStringFromWasm0(ret[0], ret[1]);
283
+ } finally {
284
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
285
+ }
286
+ }
287
+
288
+ /**
289
+ * @param {string} table
290
+ * @param {string} batch_json
291
+ * @returns {string}
292
+ */
293
+ function jsql_update_by_ids(table, batch_json) {
294
+ let deferred3_0;
295
+ let deferred3_1;
296
+ try {
297
+ const ptr0 = passStringToWasm0(table, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
298
+ const len0 = WASM_VECTOR_LEN;
299
+ const ptr1 = passStringToWasm0(batch_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
300
+ const len1 = WASM_VECTOR_LEN;
301
+ const ret = wasm.jsql_update_by_ids(ptr0, len0, ptr1, len1);
302
+ deferred3_0 = ret[0];
303
+ deferred3_1 = ret[1];
304
+ return getStringFromWasm0(ret[0], ret[1]);
305
+ } finally {
306
+ wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
307
+ }
308
+ }
309
+ function __wbg_get_imports() {
310
+ const import0 = {
311
+ __proto__: null,
312
+ __wbg___wbindgen_string_get_b0ca35b86a603356: function(arg0, arg1) {
313
+ const obj = arg1;
314
+ const ret = typeof(obj) === 'string' ? obj : undefined;
315
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
316
+ var len1 = WASM_VECTOR_LEN;
317
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
318
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
319
+ },
320
+ __wbg___wbindgen_throw_344f42d3211c4765: function(arg0, arg1) {
321
+ throw new Error(getStringFromWasm0(arg0, arg1));
322
+ },
323
+ __wbg_new_cc984128914cfc6f: function(arg0) {
324
+ const ret = new Date(arg0);
325
+ return ret;
326
+ },
327
+ __wbg_now_86c0d4ba3fa605b8: function() {
328
+ const ret = Date.now();
329
+ return ret;
330
+ },
331
+ __wbg_toISOString_706fbe321055ee58: function(arg0) {
332
+ const ret = arg0.toISOString();
333
+ return ret;
334
+ },
335
+ __wbindgen_cast_0000000000000001: function(arg0) {
336
+ // Cast intrinsic for `F64 -> Externref`.
337
+ const ret = arg0;
338
+ return ret;
339
+ },
340
+ __wbindgen_init_externref_table: function() {
341
+ const table = wasm.__wbindgen_externrefs;
342
+ const offset = table.grow(4);
343
+ table.set(0, undefined);
344
+ table.set(offset + 0, undefined);
345
+ table.set(offset + 1, null);
346
+ table.set(offset + 2, true);
347
+ table.set(offset + 3, false);
348
+ },
349
+ };
350
+ return {
351
+ __proto__: null,
352
+ "./jsql_neo_wasm_bg.js": import0,
353
+ };
354
+ }
355
+
356
+ let cachedDataViewMemory0 = null;
357
+ function getDataViewMemory0() {
358
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
359
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
360
+ }
361
+ return cachedDataViewMemory0;
362
+ }
363
+
364
+ function getStringFromWasm0(ptr, len) {
365
+ return decodeText(ptr >>> 0, len);
366
+ }
367
+
368
+ let cachedUint8ArrayMemory0 = null;
369
+ function getUint8ArrayMemory0() {
370
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
371
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
372
+ }
373
+ return cachedUint8ArrayMemory0;
374
+ }
375
+
376
+ function isLikeNone(x) {
377
+ return x === undefined || x === null;
378
+ }
379
+
380
+ function passArray8ToWasm0(arg, malloc) {
381
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
382
+ getUint8ArrayMemory0().set(arg, ptr / 1);
383
+ WASM_VECTOR_LEN = arg.length;
384
+ return ptr;
385
+ }
386
+
387
+ function passStringToWasm0(arg, malloc, realloc) {
388
+ if (realloc === undefined) {
389
+ const buf = cachedTextEncoder.encode(arg);
390
+ const ptr = malloc(buf.length, 1) >>> 0;
391
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
392
+ WASM_VECTOR_LEN = buf.length;
393
+ return ptr;
394
+ }
395
+
396
+ let len = arg.length;
397
+ let ptr = malloc(len, 1) >>> 0;
398
+
399
+ const mem = getUint8ArrayMemory0();
400
+
401
+ let offset = 0;
402
+
403
+ for (; offset < len; offset++) {
404
+ const code = arg.charCodeAt(offset);
405
+ if (code > 0x7F) break;
406
+ mem[ptr + offset] = code;
407
+ }
408
+ if (offset !== len) {
409
+ if (offset !== 0) {
410
+ arg = arg.slice(offset);
411
+ }
412
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
413
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
414
+ const ret = cachedTextEncoder.encodeInto(arg, view);
415
+
416
+ offset += ret.written;
417
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
418
+ }
419
+
420
+ WASM_VECTOR_LEN = offset;
421
+ return ptr;
422
+ }
423
+
424
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
425
+ cachedTextDecoder.decode();
426
+ function decodeText(ptr, len) {
427
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
428
+ }
429
+
430
+ const cachedTextEncoder = new TextEncoder();
431
+
432
+ if (!('encodeInto' in cachedTextEncoder)) {
433
+ cachedTextEncoder.encodeInto = function (arg, view) {
434
+ const buf = cachedTextEncoder.encode(arg);
435
+ view.set(buf);
436
+ return {
437
+ read: arg.length,
438
+ written: buf.length
439
+ };
440
+ };
441
+ }
442
+
443
+ let WASM_VECTOR_LEN = 0;
444
+
445
+
446
+
447
+ export async function init(input) {
448
+ cachedDataViewMemory0 = null;
449
+ cachedUint8ArrayMemory0 = null;
450
+ let bytes;
451
+ if (input instanceof Uint8Array) bytes = input;
452
+ else if (input instanceof ArrayBuffer) bytes = new Uint8Array(input);
453
+ else if (input instanceof Response) bytes = new Uint8Array(await input.arrayBuffer());
454
+ else if (input instanceof WebAssembly.Module) { wasm = new WebAssembly.Instance(input, __wbg_get_imports()).exports; wasm.__wbindgen_start(); return wasm; }
455
+ else bytes = new Uint8Array(await (await fetch(input || new URL('./jsql_neo_wasm_bg.wasm', import.meta.url))).arrayBuffer());
456
+ const result = await WebAssembly.instantiate(bytes, __wbg_get_imports());
457
+ wasm = result.instance.exports;
458
+ wasm.__wbindgen_start();
459
+ return wasm;
460
+ }
461
+
462
+ export { jsql_count, jsql_create_table, jsql_drop_table, jsql_find, jsql_find_by_id, jsql_find_by_ids, jsql_insert, jsql_insert_buf, jsql_insert_buf_count, jsql_insert_json, jsql_remove_by_id, jsql_remove_by_ids, jsql_reset, jsql_update_by_id, jsql_update_by_ids, __wbg_get_imports };