@bockit/sequel 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +191 -2
- package/THIRD_PARTY_NOTICES.md +268 -0
- package/binaries.json +106 -0
- package/dist/binaries/cache.d.ts +6 -0
- package/dist/binaries/cache.js +36 -0
- package/dist/binaries/ensure-binary.d.ts +10 -0
- package/dist/binaries/ensure-binary.js +85 -0
- package/dist/binaries/manifest.d.ts +30 -0
- package/dist/binaries/manifest.js +112 -0
- package/dist/binaries/platform.d.ts +3 -0
- package/dist/binaries/platform.js +10 -0
- package/dist/binaries/unpack.d.ts +2 -0
- package/dist/binaries/unpack.js +35 -0
- package/dist/binaries/verify.d.ts +2 -0
- package/dist/binaries/verify.js +16 -0
- package/dist/check.d.ts +9 -0
- package/dist/check.js +166 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +324 -0
- package/dist/config/define-config.d.ts +23 -0
- package/dist/config/define-config.js +4 -0
- package/dist/config/load-config.d.ts +6 -0
- package/dist/config/load-config.js +34 -0
- package/dist/config/resolve-config.d.ts +34 -0
- package/dist/config/resolve-config.js +144 -0
- package/dist/db/connection.d.ts +6 -0
- package/dist/db/connection.js +38 -0
- package/dist/db/shadow.d.ts +11 -0
- package/dist/db/shadow.js +68 -0
- package/dist/engine/client.d.ts +24 -0
- package/dist/engine/client.js +123 -0
- package/dist/engine/diff.d.ts +12 -0
- package/dist/engine/diff.js +51 -0
- package/dist/errors.d.ts +3 -0
- package/dist/errors.js +5 -0
- package/dist/extras/snapshot.d.ts +3 -0
- package/dist/extras/snapshot.js +99 -0
- package/dist/files.d.ts +1 -0
- package/dist/files.js +15 -0
- package/dist/generate/generate-modules.d.ts +17 -0
- package/dist/generate/generate-modules.js +97 -0
- package/dist/generate/modules.d.ts +16 -0
- package/dist/generate/modules.js +118 -0
- package/dist/generate/pg-dump.d.ts +8 -0
- package/dist/generate/pg-dump.js +66 -0
- package/dist/generate/plugin-wrapper.d.ts +3 -0
- package/dist/generate/plugin-wrapper.js +20 -0
- package/dist/generate/sqlc.d.ts +27 -0
- package/dist/generate/sqlc.js +113 -0
- package/dist/generate/watch.d.ts +16 -0
- package/dist/generate/watch.js +73 -0
- package/dist/generator/generate.d.ts +21 -0
- package/dist/generator/generate.js +440 -0
- package/dist/generator/keys.d.ts +4 -0
- package/dist/generator/keys.js +24 -0
- package/dist/generator/lexer.d.ts +12 -0
- package/dist/generator/lexer.js +210 -0
- package/dist/generator/main.d.ts +1 -0
- package/dist/generator/main.js +12 -0
- package/dist/generator/pg-array-helper.d.ts +2 -0
- package/dist/generator/pg-array-helper.js +53 -0
- package/dist/generator/plugin.d.ts +6 -0
- package/dist/generator/plugin.js +26 -0
- package/dist/generator/request.d.ts +57 -0
- package/dist/generator/request.js +96 -0
- package/dist/generator/select-list.d.ts +27 -0
- package/dist/generator/select-list.js +580 -0
- package/dist/generator/strings.d.ts +2 -0
- package/dist/generator/strings.js +34 -0
- package/dist/generator/types.d.ts +23 -0
- package/dist/generator/types.js +216 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/migrate/adopt-prisma.d.ts +23 -0
- package/dist/migrate/adopt-prisma.js +119 -0
- package/dist/migrate/deploy.d.ts +7 -0
- package/dist/migrate/deploy.js +23 -0
- package/dist/migrate/drift.d.ts +10 -0
- package/dist/migrate/drift.js +36 -0
- package/dist/migrate/files.d.ts +19 -0
- package/dist/migrate/files.js +97 -0
- package/dist/migrate/history.d.ts +20 -0
- package/dist/migrate/history.js +54 -0
- package/dist/migrate/lint.d.ts +21 -0
- package/dist/migrate/lint.js +153 -0
- package/dist/migrate/new.d.ts +13 -0
- package/dist/migrate/new.js +41 -0
- package/dist/migrate/runner.d.ts +28 -0
- package/dist/migrate/runner.js +124 -0
- package/dist/migrate/sql-text.d.ts +33 -0
- package/dist/migrate/sql-text.js +233 -0
- package/dist/schema/schema.d.ts +16 -0
- package/dist/schema/schema.js +111 -0
- package/dist/schema/unsupported.d.ts +3 -0
- package/dist/schema/unsupported.js +36 -0
- package/dist/schema/wasm.d.ts +8 -0
- package/dist/schema/wasm.js +32 -0
- package/package.json +50 -4
- package/vendor/prisma-schema-wasm/LICENSE +201 -0
- package/vendor/prisma-schema-wasm/README.md +32 -0
- package/vendor/prisma-schema-wasm/package.json +3 -0
- package/vendor/prisma-schema-wasm/prisma_schema_build.js +539 -0
- package/vendor/prisma-schema-wasm/prisma_schema_build_bg.wasm +0 -0
|
@@ -0,0 +1,539 @@
|
|
|
1
|
+
|
|
2
|
+
let imports = {};
|
|
3
|
+
imports['__wbindgen_placeholder__'] = module.exports;
|
|
4
|
+
|
|
5
|
+
let cachedUint8ArrayMemory0 = null;
|
|
6
|
+
|
|
7
|
+
function getUint8ArrayMemory0() {
|
|
8
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
9
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
10
|
+
}
|
|
11
|
+
return cachedUint8ArrayMemory0;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
15
|
+
|
|
16
|
+
cachedTextDecoder.decode();
|
|
17
|
+
|
|
18
|
+
function decodeText(ptr, len) {
|
|
19
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function getStringFromWasm0(ptr, len) {
|
|
23
|
+
ptr = ptr >>> 0;
|
|
24
|
+
return decodeText(ptr, len);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
let WASM_VECTOR_LEN = 0;
|
|
28
|
+
|
|
29
|
+
const cachedTextEncoder = new TextEncoder();
|
|
30
|
+
|
|
31
|
+
if (!('encodeInto' in cachedTextEncoder)) {
|
|
32
|
+
cachedTextEncoder.encodeInto = function (arg, view) {
|
|
33
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
34
|
+
view.set(buf);
|
|
35
|
+
return {
|
|
36
|
+
read: arg.length,
|
|
37
|
+
written: buf.length
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
43
|
+
|
|
44
|
+
if (realloc === undefined) {
|
|
45
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
46
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
47
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
48
|
+
WASM_VECTOR_LEN = buf.length;
|
|
49
|
+
return ptr;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
let len = arg.length;
|
|
53
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
54
|
+
|
|
55
|
+
const mem = getUint8ArrayMemory0();
|
|
56
|
+
|
|
57
|
+
let offset = 0;
|
|
58
|
+
|
|
59
|
+
for (; offset < len; offset++) {
|
|
60
|
+
const code = arg.charCodeAt(offset);
|
|
61
|
+
if (code > 0x7F) break;
|
|
62
|
+
mem[ptr + offset] = code;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
if (offset !== len) {
|
|
66
|
+
if (offset !== 0) {
|
|
67
|
+
arg = arg.slice(offset);
|
|
68
|
+
}
|
|
69
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
70
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
71
|
+
const ret = cachedTextEncoder.encodeInto(arg, view);
|
|
72
|
+
|
|
73
|
+
offset += ret.written;
|
|
74
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
WASM_VECTOR_LEN = offset;
|
|
78
|
+
return ptr;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* @param {string} schema
|
|
82
|
+
* @param {string} params
|
|
83
|
+
* @returns {string}
|
|
84
|
+
*/
|
|
85
|
+
exports.format = function(schema, params) {
|
|
86
|
+
let deferred3_0;
|
|
87
|
+
let deferred3_1;
|
|
88
|
+
try {
|
|
89
|
+
const ptr0 = passStringToWasm0(schema, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
90
|
+
const len0 = WASM_VECTOR_LEN;
|
|
91
|
+
const ptr1 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
92
|
+
const len1 = WASM_VECTOR_LEN;
|
|
93
|
+
const ret = wasm.format(ptr0, len0, ptr1, len1);
|
|
94
|
+
deferred3_0 = ret[0];
|
|
95
|
+
deferred3_1 = ret[1];
|
|
96
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
97
|
+
} finally {
|
|
98
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Docs: https://prisma.github.io/prisma-engines/doc/prisma_fmt/fn.get_config.html
|
|
104
|
+
* @param {string} params
|
|
105
|
+
* @returns {string}
|
|
106
|
+
*/
|
|
107
|
+
exports.get_config = function(params) {
|
|
108
|
+
let deferred2_0;
|
|
109
|
+
let deferred2_1;
|
|
110
|
+
try {
|
|
111
|
+
const ptr0 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
112
|
+
const len0 = WASM_VECTOR_LEN;
|
|
113
|
+
const ret = wasm.get_config(ptr0, len0);
|
|
114
|
+
deferred2_0 = ret[0];
|
|
115
|
+
deferred2_1 = ret[1];
|
|
116
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
117
|
+
} finally {
|
|
118
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
function takeFromExternrefTable0(idx) {
|
|
123
|
+
const value = wasm.__wbindgen_externrefs.get(idx);
|
|
124
|
+
wasm.__externref_table_dealloc(idx);
|
|
125
|
+
return value;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Docs: https://prisma.github.io/prisma-engines/doc/prisma_fmt/fn.get_dmmf.html
|
|
129
|
+
* @param {string} params
|
|
130
|
+
* @returns {string}
|
|
131
|
+
*/
|
|
132
|
+
exports.get_dmmf = function(params) {
|
|
133
|
+
let deferred3_0;
|
|
134
|
+
let deferred3_1;
|
|
135
|
+
try {
|
|
136
|
+
const ptr0 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
137
|
+
const len0 = WASM_VECTOR_LEN;
|
|
138
|
+
const ret = wasm.get_dmmf(ptr0, len0);
|
|
139
|
+
var ptr2 = ret[0];
|
|
140
|
+
var len2 = ret[1];
|
|
141
|
+
if (ret[3]) {
|
|
142
|
+
ptr2 = 0; len2 = 0;
|
|
143
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
144
|
+
}
|
|
145
|
+
deferred3_0 = ptr2;
|
|
146
|
+
deferred3_1 = len2;
|
|
147
|
+
return getStringFromWasm0(ptr2, len2);
|
|
148
|
+
} finally {
|
|
149
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* This API is modelled on an LSP [references
|
|
155
|
+
* request](https://github.com/microsoft/language-server-protocol/blob/gh-pages/_specifications/specification-3-16.md#find-references-request-leftwards_arrow_with_hook).
|
|
156
|
+
* Input and output are both JSON, the request being a
|
|
157
|
+
* `CodeActionParams` object and the response being a list of
|
|
158
|
+
* `CodeActionOrCommand` objects.
|
|
159
|
+
* @param {string} schema
|
|
160
|
+
* @param {string} params
|
|
161
|
+
* @returns {string}
|
|
162
|
+
*/
|
|
163
|
+
exports.references = function(schema, params) {
|
|
164
|
+
let deferred3_0;
|
|
165
|
+
let deferred3_1;
|
|
166
|
+
try {
|
|
167
|
+
const ptr0 = passStringToWasm0(schema, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
168
|
+
const len0 = WASM_VECTOR_LEN;
|
|
169
|
+
const ptr1 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
170
|
+
const len1 = WASM_VECTOR_LEN;
|
|
171
|
+
const ret = wasm.references(ptr0, len0, ptr1, len1);
|
|
172
|
+
deferred3_0 = ret[0];
|
|
173
|
+
deferred3_1 = ret[1];
|
|
174
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
175
|
+
} finally {
|
|
176
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* This api is modelled on an LSP [hover request](https://github.com/microsoft/language-server-protocol/blob/gh-pages/_specifications/specification-3-16.md#hover-request-leftwards_arrow_with_hook).
|
|
182
|
+
* Input and output are both JSON, the request being a `HoverParams` object
|
|
183
|
+
* and the response being a `Hover` object.
|
|
184
|
+
* @param {string} schema_files
|
|
185
|
+
* @param {string} params
|
|
186
|
+
* @returns {string}
|
|
187
|
+
*/
|
|
188
|
+
exports.hover = function(schema_files, params) {
|
|
189
|
+
let deferred3_0;
|
|
190
|
+
let deferred3_1;
|
|
191
|
+
try {
|
|
192
|
+
const ptr0 = passStringToWasm0(schema_files, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
193
|
+
const len0 = WASM_VECTOR_LEN;
|
|
194
|
+
const ptr1 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
195
|
+
const len1 = WASM_VECTOR_LEN;
|
|
196
|
+
const ret = wasm.hover(ptr0, len0, ptr1, len1);
|
|
197
|
+
deferred3_0 = ret[0];
|
|
198
|
+
deferred3_1 = ret[1];
|
|
199
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
200
|
+
} finally {
|
|
201
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
202
|
+
}
|
|
203
|
+
};
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Serialize DMMF to a caller-owned buffer and return it as a handle.
|
|
207
|
+
* Use `DmmfBuffer.read_chunk()` to read portions as `Uint8Array`, then
|
|
208
|
+
* `DmmfBuffer.free()` (auto-provided by wasm-bindgen) to release WASM memory.
|
|
209
|
+
*
|
|
210
|
+
* This avoids implicit global state — each call returns an independent buffer.
|
|
211
|
+
*
|
|
212
|
+
* See: https://github.com/prisma/prisma/issues/29111
|
|
213
|
+
* @param {string} params
|
|
214
|
+
* @returns {DmmfBuffer}
|
|
215
|
+
*/
|
|
216
|
+
exports.get_dmmf_buffered = function(params) {
|
|
217
|
+
const ptr0 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
218
|
+
const len0 = WASM_VECTOR_LEN;
|
|
219
|
+
const ret = wasm.get_dmmf_buffered(ptr0, len0);
|
|
220
|
+
if (ret[2]) {
|
|
221
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
222
|
+
}
|
|
223
|
+
return DmmfBuffer.__wrap(ret[0]);
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
/**
|
|
227
|
+
* Trigger a panic inside the wasm module. This is only useful in development for testing panic
|
|
228
|
+
* handling.
|
|
229
|
+
*/
|
|
230
|
+
exports.debug_panic = function() {
|
|
231
|
+
wasm.debug_panic();
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
/**
|
|
235
|
+
* @param {string} params
|
|
236
|
+
* @returns {string}
|
|
237
|
+
*/
|
|
238
|
+
exports.get_datamodel = function(params) {
|
|
239
|
+
let deferred3_0;
|
|
240
|
+
let deferred3_1;
|
|
241
|
+
try {
|
|
242
|
+
const ptr0 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
243
|
+
const len0 = WASM_VECTOR_LEN;
|
|
244
|
+
const ret = wasm.get_datamodel(ptr0, len0);
|
|
245
|
+
var ptr2 = ret[0];
|
|
246
|
+
var len2 = ret[1];
|
|
247
|
+
if (ret[3]) {
|
|
248
|
+
ptr2 = 0; len2 = 0;
|
|
249
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
250
|
+
}
|
|
251
|
+
deferred3_0 = ptr2;
|
|
252
|
+
deferred3_1 = len2;
|
|
253
|
+
return getStringFromWasm0(ptr2, len2);
|
|
254
|
+
} finally {
|
|
255
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
256
|
+
}
|
|
257
|
+
};
|
|
258
|
+
|
|
259
|
+
/**
|
|
260
|
+
* @param {string} input
|
|
261
|
+
* @returns {string}
|
|
262
|
+
*/
|
|
263
|
+
exports.lint = function(input) {
|
|
264
|
+
let deferred2_0;
|
|
265
|
+
let deferred2_1;
|
|
266
|
+
try {
|
|
267
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
268
|
+
const len0 = WASM_VECTOR_LEN;
|
|
269
|
+
const ret = wasm.lint(ptr0, len0);
|
|
270
|
+
deferred2_0 = ret[0];
|
|
271
|
+
deferred2_1 = ret[1];
|
|
272
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
273
|
+
} finally {
|
|
274
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
275
|
+
}
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
/**
|
|
279
|
+
* @param {string} params
|
|
280
|
+
*/
|
|
281
|
+
exports.validate = function(params) {
|
|
282
|
+
const ptr0 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
283
|
+
const len0 = WASM_VECTOR_LEN;
|
|
284
|
+
const ret = wasm.validate(ptr0, len0);
|
|
285
|
+
if (ret[1]) {
|
|
286
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
/**
|
|
291
|
+
* @param {string} input
|
|
292
|
+
* @returns {string}
|
|
293
|
+
*/
|
|
294
|
+
exports.merge_schemas = function(input) {
|
|
295
|
+
let deferred3_0;
|
|
296
|
+
let deferred3_1;
|
|
297
|
+
try {
|
|
298
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
299
|
+
const len0 = WASM_VECTOR_LEN;
|
|
300
|
+
const ret = wasm.merge_schemas(ptr0, len0);
|
|
301
|
+
var ptr2 = ret[0];
|
|
302
|
+
var len2 = ret[1];
|
|
303
|
+
if (ret[3]) {
|
|
304
|
+
ptr2 = 0; len2 = 0;
|
|
305
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
306
|
+
}
|
|
307
|
+
deferred3_0 = ptr2;
|
|
308
|
+
deferred3_1 = len2;
|
|
309
|
+
return getStringFromWasm0(ptr2, len2);
|
|
310
|
+
} finally {
|
|
311
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* @param {string} input
|
|
317
|
+
* @returns {string}
|
|
318
|
+
*/
|
|
319
|
+
exports.native_types = function(input) {
|
|
320
|
+
let deferred2_0;
|
|
321
|
+
let deferred2_1;
|
|
322
|
+
try {
|
|
323
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
324
|
+
const len0 = WASM_VECTOR_LEN;
|
|
325
|
+
const ret = wasm.native_types(ptr0, len0);
|
|
326
|
+
deferred2_0 = ret[0];
|
|
327
|
+
deferred2_1 = ret[1];
|
|
328
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
329
|
+
} finally {
|
|
330
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
331
|
+
}
|
|
332
|
+
};
|
|
333
|
+
|
|
334
|
+
/**
|
|
335
|
+
* @param {string} input
|
|
336
|
+
* @returns {string}
|
|
337
|
+
*/
|
|
338
|
+
exports.referential_actions = function(input) {
|
|
339
|
+
let deferred2_0;
|
|
340
|
+
let deferred2_1;
|
|
341
|
+
try {
|
|
342
|
+
const ptr0 = passStringToWasm0(input, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
343
|
+
const len0 = WASM_VECTOR_LEN;
|
|
344
|
+
const ret = wasm.referential_actions(ptr0, len0);
|
|
345
|
+
deferred2_0 = ret[0];
|
|
346
|
+
deferred2_1 = ret[1];
|
|
347
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
348
|
+
} finally {
|
|
349
|
+
wasm.__wbindgen_free(deferred2_0, deferred2_1, 1);
|
|
350
|
+
}
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* @returns {string}
|
|
355
|
+
*/
|
|
356
|
+
exports.preview_features = function() {
|
|
357
|
+
let deferred1_0;
|
|
358
|
+
let deferred1_1;
|
|
359
|
+
try {
|
|
360
|
+
const ret = wasm.preview_features();
|
|
361
|
+
deferred1_0 = ret[0];
|
|
362
|
+
deferred1_1 = ret[1];
|
|
363
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
364
|
+
} finally {
|
|
365
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
366
|
+
}
|
|
367
|
+
};
|
|
368
|
+
|
|
369
|
+
/**
|
|
370
|
+
* The API is modelled on an LSP [completion
|
|
371
|
+
* request](https://github.com/microsoft/language-server-protocol/blob/gh-pages/_specifications/specification-3-16.md#completion-request-leftwards_arrow_with_hook).
|
|
372
|
+
* Input and output are both JSON, the request being a `CompletionParams` object and the response
|
|
373
|
+
* being a `CompletionList` object.
|
|
374
|
+
* @param {string} schema_files
|
|
375
|
+
* @param {string} params
|
|
376
|
+
* @returns {string}
|
|
377
|
+
*/
|
|
378
|
+
exports.text_document_completion = function(schema_files, params) {
|
|
379
|
+
let deferred3_0;
|
|
380
|
+
let deferred3_1;
|
|
381
|
+
try {
|
|
382
|
+
const ptr0 = passStringToWasm0(schema_files, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
383
|
+
const len0 = WASM_VECTOR_LEN;
|
|
384
|
+
const ptr1 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
385
|
+
const len1 = WASM_VECTOR_LEN;
|
|
386
|
+
const ret = wasm.text_document_completion(ptr0, len0, ptr1, len1);
|
|
387
|
+
deferred3_0 = ret[0];
|
|
388
|
+
deferred3_1 = ret[1];
|
|
389
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
390
|
+
} finally {
|
|
391
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
392
|
+
}
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
/**
|
|
396
|
+
* This API is modelled on an LSP [code action
|
|
397
|
+
* request](https://github.com/microsoft/language-server-protocol/blob/gh-pages/_specifications/specification-3-16.md#code-action-request-leftwards_arrow_with_hook).
|
|
398
|
+
* Input and output are both JSON, the request being a
|
|
399
|
+
* `CodeActionParams` object and the response being a list of
|
|
400
|
+
* `CodeActionOrCommand` objects.
|
|
401
|
+
* @param {string} schema
|
|
402
|
+
* @param {string} params
|
|
403
|
+
* @returns {string}
|
|
404
|
+
*/
|
|
405
|
+
exports.code_actions = function(schema, params) {
|
|
406
|
+
let deferred3_0;
|
|
407
|
+
let deferred3_1;
|
|
408
|
+
try {
|
|
409
|
+
const ptr0 = passStringToWasm0(schema, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
410
|
+
const len0 = WASM_VECTOR_LEN;
|
|
411
|
+
const ptr1 = passStringToWasm0(params, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
412
|
+
const len1 = WASM_VECTOR_LEN;
|
|
413
|
+
const ret = wasm.code_actions(ptr0, len0, ptr1, len1);
|
|
414
|
+
deferred3_0 = ret[0];
|
|
415
|
+
deferred3_1 = ret[1];
|
|
416
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
417
|
+
} finally {
|
|
418
|
+
wasm.__wbindgen_free(deferred3_0, deferred3_1, 1);
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
|
|
422
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
423
|
+
ptr = ptr >>> 0;
|
|
424
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
const DmmfBufferFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
428
|
+
? { register: () => {}, unregister: () => {} }
|
|
429
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_dmmfbuffer_free(ptr >>> 0, 1));
|
|
430
|
+
/**
|
|
431
|
+
* Handle-based DMMF buffer that holds serialized DMMF JSON as bytes.
|
|
432
|
+
*
|
|
433
|
+
* This bypasses V8's string length limit (~536MB / 0x1fffffe8 chars) by keeping the
|
|
434
|
+
* serialized JSON as bytes in WASM linear memory. The JS side reads chunks as `Uint8Array`
|
|
435
|
+
* (which has no V8 string limit) and can reassemble them with a streaming JSON parser.
|
|
436
|
+
*
|
|
437
|
+
* Usage from JS:
|
|
438
|
+
* ```js
|
|
439
|
+
* const buffer = get_dmmf_buffered(params);
|
|
440
|
+
* const totalLen = buffer.len();
|
|
441
|
+
* const chunks = [];
|
|
442
|
+
* for (let offset = 0; offset < totalLen; offset += CHUNK_SIZE) {
|
|
443
|
+
* chunks.push(buffer.read_chunk(offset, CHUNK_SIZE));
|
|
444
|
+
* }
|
|
445
|
+
* buffer.free(); // release WASM memory
|
|
446
|
+
* ```
|
|
447
|
+
*
|
|
448
|
+
* See: https://github.com/prisma/prisma/issues/29111
|
|
449
|
+
*/
|
|
450
|
+
class DmmfBuffer {
|
|
451
|
+
|
|
452
|
+
static __wrap(ptr) {
|
|
453
|
+
ptr = ptr >>> 0;
|
|
454
|
+
const obj = Object.create(DmmfBuffer.prototype);
|
|
455
|
+
obj.__wbg_ptr = ptr;
|
|
456
|
+
DmmfBufferFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
457
|
+
return obj;
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
__destroy_into_raw() {
|
|
461
|
+
const ptr = this.__wbg_ptr;
|
|
462
|
+
this.__wbg_ptr = 0;
|
|
463
|
+
DmmfBufferFinalization.unregister(this);
|
|
464
|
+
return ptr;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
free() {
|
|
468
|
+
const ptr = this.__destroy_into_raw();
|
|
469
|
+
wasm.__wbg_dmmfbuffer_free(ptr, 0);
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Read a chunk of the buffer as `Uint8Array`.
|
|
473
|
+
* `offset` is the byte offset, `length` is the max number of bytes to read.
|
|
474
|
+
* Returns a `Vec<u8>` which wasm-bindgen converts to `Uint8Array` on the JS side.
|
|
475
|
+
* @param {number} offset
|
|
476
|
+
* @param {number} length
|
|
477
|
+
* @returns {Uint8Array}
|
|
478
|
+
*/
|
|
479
|
+
read_chunk(offset, length) {
|
|
480
|
+
const ret = wasm.dmmfbuffer_read_chunk(this.__wbg_ptr, offset, length);
|
|
481
|
+
if (ret[3]) {
|
|
482
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
483
|
+
}
|
|
484
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
485
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
486
|
+
return v1;
|
|
487
|
+
}
|
|
488
|
+
/**
|
|
489
|
+
* Returns the total byte length of the serialized DMMF JSON.
|
|
490
|
+
* @returns {number}
|
|
491
|
+
*/
|
|
492
|
+
len() {
|
|
493
|
+
const ret = wasm.dmmfbuffer_len(this.__wbg_ptr);
|
|
494
|
+
return ret >>> 0;
|
|
495
|
+
}
|
|
496
|
+
/**
|
|
497
|
+
* Returns `true` if the buffer is empty.
|
|
498
|
+
* @returns {boolean}
|
|
499
|
+
*/
|
|
500
|
+
is_empty() {
|
|
501
|
+
const ret = wasm.dmmfbuffer_is_empty(this.__wbg_ptr);
|
|
502
|
+
return ret !== 0;
|
|
503
|
+
}
|
|
504
|
+
}
|
|
505
|
+
if (Symbol.dispose) DmmfBuffer.prototype[Symbol.dispose] = DmmfBuffer.prototype.free;
|
|
506
|
+
|
|
507
|
+
exports.DmmfBuffer = DmmfBuffer;
|
|
508
|
+
|
|
509
|
+
exports.__wbg_Error_e83987f665cf5504 = function(arg0, arg1) {
|
|
510
|
+
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
511
|
+
return ret;
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
exports.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
|
|
515
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
516
|
+
};
|
|
517
|
+
|
|
518
|
+
exports.__wbg_set_message_f22ac4a6869ee695 = function(arg0, arg1) {
|
|
519
|
+
global.PRISMA_WASM_PANIC_REGISTRY.set_message(getStringFromWasm0(arg0, arg1));
|
|
520
|
+
};
|
|
521
|
+
|
|
522
|
+
exports.__wbindgen_init_externref_table = function() {
|
|
523
|
+
const table = wasm.__wbindgen_externrefs;
|
|
524
|
+
const offset = table.grow(4);
|
|
525
|
+
table.set(0, undefined);
|
|
526
|
+
table.set(offset + 0, undefined);
|
|
527
|
+
table.set(offset + 1, null);
|
|
528
|
+
table.set(offset + 2, true);
|
|
529
|
+
table.set(offset + 3, false);
|
|
530
|
+
;
|
|
531
|
+
};
|
|
532
|
+
|
|
533
|
+
const wasmPath = `${__dirname}/prisma_schema_build_bg.wasm`;
|
|
534
|
+
const wasmBytes = require('fs').readFileSync(wasmPath);
|
|
535
|
+
const wasmModule = new WebAssembly.Module(wasmBytes);
|
|
536
|
+
const wasm = exports.__wasm = new WebAssembly.Instance(wasmModule, imports).exports;
|
|
537
|
+
|
|
538
|
+
wasm.__wbindgen_start();
|
|
539
|
+
|
|
Binary file
|