@prisma/query-compiler-wasm 7.3.0-2.feat-fast-and-small-builds-db36bef8bdd7cc913dc1ed662d6523beef129326 → 7.3.0-4.feat-fast-and-small-builds-798a197ae0dab3401261a557152b682e6ebac6cb

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 (31) hide show
  1. package/cockroachdb/query_compiler_fast_bg.wasm +0 -0
  2. package/cockroachdb/query_compiler_small.d.ts +23 -0
  3. package/cockroachdb/query_compiler_small.js +5 -0
  4. package/cockroachdb/query_compiler_small_bg.js +453 -0
  5. package/cockroachdb/query_compiler_small_bg.wasm +0 -0
  6. package/cockroachdb/query_compiler_small_bg.wasm.d.ts +12 -0
  7. package/mysql/query_compiler_fast_bg.wasm +0 -0
  8. package/mysql/query_compiler_small.d.ts +23 -0
  9. package/mysql/query_compiler_small.js +5 -0
  10. package/mysql/query_compiler_small_bg.js +453 -0
  11. package/mysql/query_compiler_small_bg.wasm +0 -0
  12. package/mysql/query_compiler_small_bg.wasm.d.ts +12 -0
  13. package/package.json +1 -1
  14. package/postgresql/query_compiler_fast_bg.wasm +0 -0
  15. package/postgresql/query_compiler_small.d.ts +23 -0
  16. package/postgresql/query_compiler_small.js +5 -0
  17. package/postgresql/query_compiler_small_bg.js +453 -0
  18. package/postgresql/query_compiler_small_bg.wasm +0 -0
  19. package/postgresql/query_compiler_small_bg.wasm.d.ts +12 -0
  20. package/sqlite/query_compiler_fast_bg.wasm +0 -0
  21. package/sqlite/query_compiler_small.d.ts +23 -0
  22. package/sqlite/query_compiler_small.js +5 -0
  23. package/sqlite/query_compiler_small_bg.js +453 -0
  24. package/sqlite/query_compiler_small_bg.wasm +0 -0
  25. package/sqlite/query_compiler_small_bg.wasm.d.ts +12 -0
  26. package/sqlserver/query_compiler_fast_bg.wasm +0 -0
  27. package/sqlserver/query_compiler_small.d.ts +23 -0
  28. package/sqlserver/query_compiler_small.js +5 -0
  29. package/sqlserver/query_compiler_small_bg.js +453 -0
  30. package/sqlserver/query_compiler_small_bg.wasm +0 -0
  31. package/sqlserver/query_compiler_small_bg.wasm.d.ts +12 -0
@@ -0,0 +1,453 @@
1
+ let wasm;
2
+ export function __wbg_set_wasm(val) {
3
+ wasm = val;
4
+ }
5
+
6
+
7
+ let cachedUint8ArrayMemory0 = null;
8
+
9
+ function getUint8ArrayMemory0() {
10
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
11
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
12
+ }
13
+ return cachedUint8ArrayMemory0;
14
+ }
15
+
16
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
17
+
18
+ cachedTextDecoder.decode();
19
+
20
+ const MAX_SAFARI_DECODE_BYTES = 2146435072;
21
+ let numBytesDecoded = 0;
22
+ function decodeText(ptr, len) {
23
+ numBytesDecoded += len;
24
+ if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
25
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
26
+ cachedTextDecoder.decode();
27
+ numBytesDecoded = len;
28
+ }
29
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
30
+ }
31
+
32
+ function getStringFromWasm0(ptr, len) {
33
+ ptr = ptr >>> 0;
34
+ return decodeText(ptr, len);
35
+ }
36
+
37
+ let WASM_VECTOR_LEN = 0;
38
+
39
+ const cachedTextEncoder = new TextEncoder();
40
+
41
+ if (!('encodeInto' in cachedTextEncoder)) {
42
+ cachedTextEncoder.encodeInto = function (arg, view) {
43
+ const buf = cachedTextEncoder.encode(arg);
44
+ view.set(buf);
45
+ return {
46
+ read: arg.length,
47
+ written: buf.length
48
+ };
49
+ }
50
+ }
51
+
52
+ function passStringToWasm0(arg, malloc, realloc) {
53
+
54
+ if (realloc === undefined) {
55
+ const buf = cachedTextEncoder.encode(arg);
56
+ const ptr = malloc(buf.length, 1) >>> 0;
57
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
58
+ WASM_VECTOR_LEN = buf.length;
59
+ return ptr;
60
+ }
61
+
62
+ let len = arg.length;
63
+ let ptr = malloc(len, 1) >>> 0;
64
+
65
+ const mem = getUint8ArrayMemory0();
66
+
67
+ let offset = 0;
68
+
69
+ for (; offset < len; offset++) {
70
+ const code = arg.charCodeAt(offset);
71
+ if (code > 0x7F) break;
72
+ mem[ptr + offset] = code;
73
+ }
74
+
75
+ if (offset !== len) {
76
+ if (offset !== 0) {
77
+ arg = arg.slice(offset);
78
+ }
79
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
80
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
81
+ const ret = cachedTextEncoder.encodeInto(arg, view);
82
+
83
+ offset += ret.written;
84
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
85
+ }
86
+
87
+ WASM_VECTOR_LEN = offset;
88
+ return ptr;
89
+ }
90
+
91
+ let cachedDataViewMemory0 = null;
92
+
93
+ function getDataViewMemory0() {
94
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
95
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
96
+ }
97
+ return cachedDataViewMemory0;
98
+ }
99
+
100
+ function isLikeNone(x) {
101
+ return x === undefined || x === null;
102
+ }
103
+
104
+ function debugString(val) {
105
+ // primitive types
106
+ const type = typeof val;
107
+ if (type == 'number' || type == 'boolean' || val == null) {
108
+ return `${val}`;
109
+ }
110
+ if (type == 'string') {
111
+ return `"${val}"`;
112
+ }
113
+ if (type == 'symbol') {
114
+ const description = val.description;
115
+ if (description == null) {
116
+ return 'Symbol';
117
+ } else {
118
+ return `Symbol(${description})`;
119
+ }
120
+ }
121
+ if (type == 'function') {
122
+ const name = val.name;
123
+ if (typeof name == 'string' && name.length > 0) {
124
+ return `Function(${name})`;
125
+ } else {
126
+ return 'Function';
127
+ }
128
+ }
129
+ // objects
130
+ if (Array.isArray(val)) {
131
+ const length = val.length;
132
+ let debug = '[';
133
+ if (length > 0) {
134
+ debug += debugString(val[0]);
135
+ }
136
+ for(let i = 1; i < length; i++) {
137
+ debug += ', ' + debugString(val[i]);
138
+ }
139
+ debug += ']';
140
+ return debug;
141
+ }
142
+ // Test for built-in
143
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
144
+ let className;
145
+ if (builtInMatches && builtInMatches.length > 1) {
146
+ className = builtInMatches[1];
147
+ } else {
148
+ // Failed to match the standard '[object ClassName]'
149
+ return toString.call(val);
150
+ }
151
+ if (className == 'Object') {
152
+ // we're a user defined class or Object
153
+ // JSON.stringify avoids problems with cycles, and is generally much
154
+ // easier than looping through ownProperties of `val`.
155
+ try {
156
+ return 'Object(' + JSON.stringify(val) + ')';
157
+ } catch (_) {
158
+ return 'Object';
159
+ }
160
+ }
161
+ // errors
162
+ if (val instanceof Error) {
163
+ return `${val.name}: ${val.message}\n${val.stack}`;
164
+ }
165
+ // TODO we could test for more things here, like `Set`s and `Map`s.
166
+ return className;
167
+ }
168
+
169
+ function getArrayU8FromWasm0(ptr, len) {
170
+ ptr = ptr >>> 0;
171
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
172
+ }
173
+
174
+ function takeFromExternrefTable0(idx) {
175
+ const value = wasm.__wbindgen_externrefs.get(idx);
176
+ wasm.__externref_table_dealloc(idx);
177
+ return value;
178
+ }
179
+
180
+ const QueryCompilerFinalization = (typeof FinalizationRegistry === 'undefined')
181
+ ? { register: () => {}, unregister: () => {} }
182
+ : new FinalizationRegistry(ptr => wasm.__wbg_querycompiler_free(ptr >>> 0, 1));
183
+
184
+ export class QueryCompiler {
185
+
186
+ __destroy_into_raw() {
187
+ const ptr = this.__wbg_ptr;
188
+ this.__wbg_ptr = 0;
189
+ QueryCompilerFinalization.unregister(this);
190
+ return ptr;
191
+ }
192
+
193
+ free() {
194
+ const ptr = this.__destroy_into_raw();
195
+ wasm.__wbg_querycompiler_free(ptr, 0);
196
+ }
197
+ /**
198
+ * @param {string} request
199
+ * @returns {any}
200
+ */
201
+ compileBatch(request) {
202
+ const ptr0 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
203
+ const len0 = WASM_VECTOR_LEN;
204
+ const ret = wasm.querycompiler_compileBatch(this.__wbg_ptr, ptr0, len0);
205
+ if (ret[2]) {
206
+ throw takeFromExternrefTable0(ret[1]);
207
+ }
208
+ return takeFromExternrefTable0(ret[0]);
209
+ }
210
+ /**
211
+ * @param {QueryCompilerParams} params
212
+ */
213
+ constructor(params) {
214
+ const ret = wasm.querycompiler_new(params);
215
+ if (ret[2]) {
216
+ throw takeFromExternrefTable0(ret[1]);
217
+ }
218
+ this.__wbg_ptr = ret[0] >>> 0;
219
+ QueryCompilerFinalization.register(this, this.__wbg_ptr, this);
220
+ return this;
221
+ }
222
+ /**
223
+ * @param {string} request
224
+ * @returns {any}
225
+ */
226
+ compile(request) {
227
+ const ptr0 = passStringToWasm0(request, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
228
+ const len0 = WASM_VECTOR_LEN;
229
+ const ret = wasm.querycompiler_compile(this.__wbg_ptr, ptr0, len0);
230
+ if (ret[2]) {
231
+ throw takeFromExternrefTable0(ret[1]);
232
+ }
233
+ return takeFromExternrefTable0(ret[0]);
234
+ }
235
+ }
236
+ if (Symbol.dispose) QueryCompiler.prototype[Symbol.dispose] = QueryCompiler.prototype.free;
237
+
238
+ export function __wbg_Error_e83987f665cf5504(arg0, arg1) {
239
+ const ret = Error(getStringFromWasm0(arg0, arg1));
240
+ return ret;
241
+ };
242
+
243
+ export function __wbg_Number_bb48ca12f395cd08(arg0) {
244
+ const ret = Number(arg0);
245
+ return ret;
246
+ };
247
+
248
+ export function __wbg_String_8f0eb39a4a4c2f66(arg0, arg1) {
249
+ const ret = String(arg1);
250
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
251
+ const len1 = WASM_VECTOR_LEN;
252
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
253
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
254
+ };
255
+
256
+ export function __wbg___wbindgen_boolean_get_6d5a1ee65bab5f68(arg0) {
257
+ const v = arg0;
258
+ const ret = typeof(v) === 'boolean' ? v : undefined;
259
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
260
+ };
261
+
262
+ export function __wbg___wbindgen_debug_string_df47ffb5e35e6763(arg0, arg1) {
263
+ const ret = debugString(arg1);
264
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
265
+ const len1 = WASM_VECTOR_LEN;
266
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
267
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
268
+ };
269
+
270
+ export function __wbg___wbindgen_in_bb933bd9e1b3bc0f(arg0, arg1) {
271
+ const ret = arg0 in arg1;
272
+ return ret;
273
+ };
274
+
275
+ export function __wbg___wbindgen_is_object_c818261d21f283a4(arg0) {
276
+ const val = arg0;
277
+ const ret = typeof(val) === 'object' && val !== null;
278
+ return ret;
279
+ };
280
+
281
+ export function __wbg___wbindgen_is_string_fbb76cb2940daafd(arg0) {
282
+ const ret = typeof(arg0) === 'string';
283
+ return ret;
284
+ };
285
+
286
+ export function __wbg___wbindgen_is_undefined_2d472862bd29a478(arg0) {
287
+ const ret = arg0 === undefined;
288
+ return ret;
289
+ };
290
+
291
+ export function __wbg___wbindgen_jsval_loose_eq_b664b38a2f582147(arg0, arg1) {
292
+ const ret = arg0 == arg1;
293
+ return ret;
294
+ };
295
+
296
+ export function __wbg___wbindgen_number_get_a20bf9b85341449d(arg0, arg1) {
297
+ const obj = arg1;
298
+ const ret = typeof(obj) === 'number' ? obj : undefined;
299
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
300
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
301
+ };
302
+
303
+ export function __wbg___wbindgen_string_get_e4f06c90489ad01b(arg0, arg1) {
304
+ const obj = arg1;
305
+ const ret = typeof(obj) === 'string' ? obj : undefined;
306
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
307
+ var len1 = WASM_VECTOR_LEN;
308
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
309
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
310
+ };
311
+
312
+ export function __wbg___wbindgen_throw_b855445ff6a94295(arg0, arg1) {
313
+ throw new Error(getStringFromWasm0(arg0, arg1));
314
+ };
315
+
316
+ export function __wbg_entries_e171b586f8f6bdbf(arg0) {
317
+ const ret = Object.entries(arg0);
318
+ return ret;
319
+ };
320
+
321
+ export function __wbg_getTime_14776bfb48a1bff9(arg0) {
322
+ const ret = arg0.getTime();
323
+ return ret;
324
+ };
325
+
326
+ export function __wbg_get_7bed016f185add81(arg0, arg1) {
327
+ const ret = arg0[arg1 >>> 0];
328
+ return ret;
329
+ };
330
+
331
+ export function __wbg_get_with_ref_key_1dc361bd10053bfe(arg0, arg1) {
332
+ const ret = arg0[arg1];
333
+ return ret;
334
+ };
335
+
336
+ export function __wbg_instanceof_ArrayBuffer_70beb1189ca63b38(arg0) {
337
+ let result;
338
+ try {
339
+ result = arg0 instanceof ArrayBuffer;
340
+ } catch (_) {
341
+ result = false;
342
+ }
343
+ const ret = result;
344
+ return ret;
345
+ };
346
+
347
+ export function __wbg_instanceof_Uint8Array_20c8e73002f7af98(arg0) {
348
+ let result;
349
+ try {
350
+ result = arg0 instanceof Uint8Array;
351
+ } catch (_) {
352
+ result = false;
353
+ }
354
+ const ret = result;
355
+ return ret;
356
+ };
357
+
358
+ export function __wbg_isSafeInteger_d216eda7911dde36(arg0) {
359
+ const ret = Number.isSafeInteger(arg0);
360
+ return ret;
361
+ };
362
+
363
+ export function __wbg_length_69bca3cb64fc8748(arg0) {
364
+ const ret = arg0.length;
365
+ return ret;
366
+ };
367
+
368
+ export function __wbg_length_cdd215e10d9dd507(arg0) {
369
+ const ret = arg0.length;
370
+ return ret;
371
+ };
372
+
373
+ export function __wbg_new_0_f9740686d739025c() {
374
+ const ret = new Date();
375
+ return ret;
376
+ };
377
+
378
+ export function __wbg_new_1acc0b6eea89d040() {
379
+ const ret = new Object();
380
+ return ret;
381
+ };
382
+
383
+ export function __wbg_new_5a79be3ab53b8aa5(arg0) {
384
+ const ret = new Uint8Array(arg0);
385
+ return ret;
386
+ };
387
+
388
+ export function __wbg_new_68651c719dcda04e() {
389
+ const ret = new Map();
390
+ return ret;
391
+ };
392
+
393
+ export function __wbg_new_e17d9f43105b08be() {
394
+ const ret = new Array();
395
+ return ret;
396
+ };
397
+
398
+ export function __wbg_prototypesetcall_2a6620b6922694b2(arg0, arg1, arg2) {
399
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
400
+ };
401
+
402
+ export function __wbg_set_3f1d0b984ed272ed(arg0, arg1, arg2) {
403
+ arg0[arg1] = arg2;
404
+ };
405
+
406
+ export function __wbg_set_907fb406c34a251d(arg0, arg1, arg2) {
407
+ const ret = arg0.set(arg1, arg2);
408
+ return ret;
409
+ };
410
+
411
+ export function __wbg_set_c213c871859d6500(arg0, arg1, arg2) {
412
+ arg0[arg1 >>> 0] = arg2;
413
+ };
414
+
415
+ export function __wbg_set_message_82ae475bb413aa5c(arg0, arg1) {
416
+ global.PRISMA_WASM_PANIC_REGISTRY.set_message(getStringFromWasm0(arg0, arg1));
417
+ };
418
+
419
+ export function __wbindgen_cast_2241b6af4c4b2941(arg0, arg1) {
420
+ // Cast intrinsic for `Ref(String) -> Externref`.
421
+ const ret = getStringFromWasm0(arg0, arg1);
422
+ return ret;
423
+ };
424
+
425
+ export function __wbindgen_cast_4625c577ab2ec9ee(arg0) {
426
+ // Cast intrinsic for `U64 -> Externref`.
427
+ const ret = BigInt.asUintN(64, arg0);
428
+ return ret;
429
+ };
430
+
431
+ export function __wbindgen_cast_9ae0607507abb057(arg0) {
432
+ // Cast intrinsic for `I64 -> Externref`.
433
+ const ret = arg0;
434
+ return ret;
435
+ };
436
+
437
+ export function __wbindgen_cast_d6cd19b81560fd6e(arg0) {
438
+ // Cast intrinsic for `F64 -> Externref`.
439
+ const ret = arg0;
440
+ return ret;
441
+ };
442
+
443
+ export function __wbindgen_init_externref_table() {
444
+ const table = wasm.__wbindgen_externrefs;
445
+ const offset = table.grow(4);
446
+ table.set(0, undefined);
447
+ table.set(offset + 0, undefined);
448
+ table.set(offset + 1, null);
449
+ table.set(offset + 2, true);
450
+ table.set(offset + 3, false);
451
+ ;
452
+ };
453
+
@@ -0,0 +1,12 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export const memory: WebAssembly.Memory;
4
+ export const __wbg_querycompiler_free: (a: number, b: number) => void;
5
+ export const querycompiler_compile: (a: number, b: number, c: number) => [number, number, number];
6
+ export const querycompiler_compileBatch: (a: number, b: number, c: number) => [number, number, number];
7
+ export const querycompiler_new: (a: any) => [number, number, number];
8
+ export const __wbindgen_malloc: (a: number, b: number) => number;
9
+ export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
10
+ export const __wbindgen_externrefs: WebAssembly.Table;
11
+ export const __externref_table_dealloc: (a: number) => void;
12
+ export const __wbindgen_start: () => void;
Binary file
@@ -0,0 +1,23 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ export interface JsCompileError {
4
+ message: string;
5
+ code: string | undefined;
6
+ meta: Value | undefined;
7
+ }
8
+
9
+ export type BatchResponse = { type: "multi"; plans: Expression[] } | { type: "compacted"; plan: Expression; arguments: Record<string, ArgumentValue>[]; nestedSelection: string[]; keys: string[]; expectNonEmpty: boolean };
10
+
11
+ export interface QueryCompilerParams {
12
+ datamodel: string;
13
+ provider: AdapterProvider;
14
+ connectionInfo: JsConnectionInfo;
15
+ }
16
+
17
+ export class QueryCompiler {
18
+ free(): void;
19
+ [Symbol.dispose](): void;
20
+ compileBatch(request: string): any;
21
+ constructor(params: QueryCompilerParams);
22
+ compile(request: string): any;
23
+ }
@@ -0,0 +1,5 @@
1
+ import * as wasm from "./query_compiler_small_bg.wasm";
2
+ export * from "./query_compiler_small_bg.js";
3
+ import { __wbg_set_wasm } from "./query_compiler_small_bg.js";
4
+ __wbg_set_wasm(wasm);
5
+ wasm.__wbindgen_start();