@prisma/internals 6.20.0-integration-merge-release-workflows2.1 → 6.20.0-integration-next.5
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/dist/{chunk-GMW36QQF.js → chunk-22HIO2UL.js} +7 -7
- package/dist/{chunk-TBR6SNKL.js → chunk-2Z7PH5WX.js} +5 -5
- package/dist/{chunk-T4UGPDF4.js → chunk-37QUSVZU.js} +8 -10
- package/dist/{chunk-JYBUBKFO.js → chunk-3Q44BUMJ.js} +16 -38
- package/dist/{chunk-I6WLABB2.js → chunk-3WXUQZS7.js} +14 -5
- package/dist/{chunk-HFFWZTVM.js → chunk-4B7YT7EE.js} +8 -18
- package/dist/{chunk-RS2R7COT.js → chunk-5I4ERIIY.js} +3 -9
- package/dist/{chunk-F2OZV76L.js → chunk-5MHUYAV3.js} +9 -9
- package/dist/{chunk-FRE4ZWRR.js → chunk-6WBK35XU.js} +13 -13
- package/dist/{chunk-7QC5VORA.js → chunk-7SF6QSKE.js} +7 -8
- package/dist/{chunk-TH33KD3E.js → chunk-7VXI23OO.js} +5 -5
- package/dist/{chunk-WFNB7VRA.js → chunk-ARC7TW3L.js} +4 -14
- package/dist/{chunk-HHG4DGHC.js → chunk-CGLLQXZE.js} +11 -12
- package/dist/{chunk-AX5N26KG.js → chunk-CIGXHXCG.js} +18 -13
- package/dist/{chunk-DVRZSMZ2.js → chunk-D2VJ7AHY.js} +5 -5
- package/dist/{chunk-FHZ5QJLR.js → chunk-D4EKBLXK.js} +5 -5
- package/dist/{chunk-E4H6V3Z4.js → chunk-DAQEKDOT.js} +11 -11
- package/dist/chunk-DYV47NUW.js +796 -0
- package/dist/{chunk-E7DQNMQJ.js → chunk-ES4SWOUX.js} +5 -5
- package/dist/{chunk-IDINCQMN.js → chunk-FF7OLLBP.js} +12 -784
- package/dist/{chunk-4CGPN5SR.js → chunk-GJSFP4V4.js} +3 -9
- package/dist/{chunk-4JCVHBYR.js → chunk-GL7OANR6.js} +5 -5
- package/dist/{chunk-OAT7ZJED.js → chunk-H5STSTVK.js} +7 -20
- package/dist/{chunk-FYZCPL2Z.js → chunk-HNRMSI3R.js} +5 -8
- package/dist/{chunk-CCLAMTCA.js → chunk-HQDG2BBX.js} +7 -9
- package/dist/{chunk-2GUGGLPK.js → chunk-J757IEPK.js} +56 -129
- package/dist/{chunk-JTS4UPHJ.js → chunk-K255FKNG.js} +5 -5
- package/dist/{chunk-NVNI2SRU.js → chunk-KNNTV7IN.js} +687 -213
- package/dist/{chunk-UQUWZJVN.js → chunk-LHTJCI5U.js} +7 -7
- package/dist/{chunk-5AI4FIZ3.js → chunk-MEOOYUIZ.js} +10 -10
- package/dist/{chunk-TQFONRJP.js → chunk-MLFKBBDL.js} +5 -5
- package/dist/{chunk-EYVG6XQS.js → chunk-OKVM3CW4.js} +3 -39
- package/dist/{chunk-UQK76B5E.js → chunk-OV3PWX3C.js} +11 -11
- package/dist/{chunk-W26QS5OG.js → chunk-PQBHK5IY.js} +56 -129
- package/dist/{chunk-JOIIWB3U.js → chunk-QOZ7USPD.js} +193 -159
- package/dist/{chunk-BVJP43JS.js → chunk-QSVWJ2S2.js} +13 -784
- package/dist/{chunk-QJ3QPUM5.js → chunk-QWXKO4HW.js} +5 -5
- package/dist/{chunk-LV27YCGC.js → chunk-R4FAVDNZ.js} +12 -12
- package/dist/{chunk-J32M37NY.js → chunk-R7L5ID34.js} +12 -12
- package/dist/{chunk-75BIJ5PX.js → chunk-SMJRM3EM.js} +9 -9
- package/dist/{chunk-DYM2NTAG.js → chunk-STE4IPGC.js} +5 -5
- package/dist/{chunk-WYQJ4JWO.js → chunk-TOIO2VZW.js} +13 -13
- package/dist/{chunk-TQCLUNM2.js → chunk-VNIE2AZB.js} +4 -4
- package/dist/{chunk-TZJROXB3.js → chunk-WSZXPLJQ.js} +4 -4
- package/dist/{chunk-SOKSKSEX.js → chunk-XHZ4TZUD.js} +16 -38
- package/dist/{chunk-UHI6VYFX.js → chunk-XIYRAW5R.js} +15 -11
- package/dist/cli/checkUnsupportedDataProxy.d.ts +3 -4
- package/dist/cli/checkUnsupportedDataProxy.js +56 -65
- package/dist/cli/getGeneratorSuccessMessage.js +2 -3
- package/dist/cli/getSchema.d.ts +1 -15
- package/dist/cli/getSchema.js +4 -5
- package/dist/cli/hashes.js +4 -4
- package/dist/cli/schemaContext.d.ts +3 -12
- package/dist/cli/schemaContext.js +57 -65
- package/dist/engine-commands/errorHelpers.js +4 -4
- package/dist/engine-commands/formatSchema.js +55 -64
- package/dist/engine-commands/getConfig.d.ts +1 -5
- package/dist/engine-commands/getConfig.js +10 -13
- package/dist/engine-commands/getDmmf.js +10 -10
- package/dist/engine-commands/getEngineVersion.js +6 -9
- package/dist/engine-commands/getEnginesInfo.d.ts +0 -1
- package/dist/engine-commands/getEnginesInfo.js +7 -9
- package/dist/engine-commands/index.d.ts +1 -1
- package/dist/engine-commands/index.js +65 -76
- package/dist/engine-commands/lintSchema.js +9 -9
- package/dist/engine-commands/mergeSchemas.js +10 -10
- package/dist/engine-commands/queryEngineCommons.js +6 -6
- package/dist/engine-commands/validate.js +10 -10
- package/dist/errorReporting.js +6 -6
- package/dist/get-generators/getGenerators.d.ts +0 -2
- package/dist/get-generators/getGenerators.js +58 -67
- package/dist/get-generators/utils/binaryTypeToEngineType.js +2 -2
- package/dist/get-generators/utils/engineTypeToBinaryType.js +2 -2
- package/dist/get-generators/utils/getBinaryPathsByVersion.js +6 -5
- package/dist/getPackedPackage.js +4 -3
- package/dist/highlight/highlight.js +5 -5
- package/dist/index.d.ts +2 -14
- package/dist/index.js +98 -121
- package/dist/{multipart-parser-3AFJFP6K.js → multipart-parser-UV3WZSWW.js} +6 -6
- package/dist/resolveBinary.js +8 -7
- package/dist/schemaEngineCommands.js +9 -8
- package/dist/sendPanic.js +4 -5
- package/dist/utils/drawBox.js +2 -2
- package/dist/utils/fs-functional.js +10 -10
- package/dist/utils/fs-utils.js +8 -8
- package/dist/utils/getVersionFromPackageJson.js +3 -3
- package/dist/utils/handlePanic.js +6 -7
- package/dist/utils/link.js +2 -2
- package/dist/utils/missingDatasource.js +5 -5
- package/dist/utils/missingGeneratorMessage.js +7 -7
- package/dist/wasm.js +5 -5
- package/package.json +15 -17
- package/dist/chunk-3FP46GUV.js +0 -471
- package/dist/chunk-46ABODUM.js +0 -186
- package/dist/chunk-6TTRTZXU.js +0 -37
- package/dist/chunk-D4VDA2TZ.js +0 -66
- package/dist/chunk-DZYINYAA.js +0 -68
- package/dist/chunk-ERSH2BQA.js +0 -58
- package/dist/chunk-HO5HRHFZ.js +0 -30
- package/dist/chunk-KDHESRKE.js +0 -49
- package/dist/chunk-PZMRR772.js +0 -41
- package/dist/chunk-T2PM5TKT.js +0 -55
- package/dist/cli/checkUnsupportedSchemaEngineWasm.d.ts +0 -22
- package/dist/cli/checkUnsupportedSchemaEngineWasm.js +0 -135
- package/dist/client/getClientEngineType.d.ts +0 -7
- package/dist/client/getClientEngineType.js +0 -26
- package/dist/dotenvExpand.d.ts +0 -35
- package/dist/dotenvExpand.js +0 -25
- package/dist/utils/__tests__/maskSchema.test.js +0 -23
- package/dist/utils/cloudflareD1.d.ts +0 -5
- package/dist/utils/cloudflareD1.js +0 -27
- package/dist/utils/getEnvPaths.d.ts +0 -14
- package/dist/utils/getEnvPaths.js +0 -29
- package/dist/utils/handleEngineLoadingErrors.d.ts +0 -8
- package/dist/utils/handleEngineLoadingErrors.js +0 -27
- package/dist/utils/load.d.ts +0 -6
- package/dist/utils/load.js +0 -28
- package/dist/utils/loadEnvFile.d.ts +0 -10
- package/dist/utils/loadEnvFile.js +0 -30
- package/dist/utils/maskSchema.d.ts +0 -4
- package/dist/utils/maskSchema.js +0 -27
- package/dist/utils/serializeQueryEngineName.d.ts +0 -4
- package/dist/utils/serializeQueryEngineName.js +0 -25
- package/dist/utils/tryLoadEnvs.d.ts +0 -25
- package/dist/utils/tryLoadEnvs.js +0 -30
|
@@ -26,15 +26,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_LHTJCI5U_exports = {};
|
|
30
|
+
__export(chunk_LHTJCI5U_exports, {
|
|
31
31
|
handlePanic: () => handlePanic
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
34
|
-
var
|
|
33
|
+
module.exports = __toCommonJS(chunk_LHTJCI5U_exports);
|
|
34
|
+
var import_chunk_3WXUQZS7 = require("./chunk-3WXUQZS7.js");
|
|
35
35
|
var import_chunk_7IKUTPWQ = require("./chunk-7IKUTPWQ.js");
|
|
36
36
|
var import_chunk_FCYHZHVW = require("./chunk-FCYHZHVW.js");
|
|
37
|
-
var
|
|
37
|
+
var import_chunk_4B7YT7EE = require("./chunk-4B7YT7EE.js");
|
|
38
38
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
39
39
|
var import_prompts = __toESM(require("prompts"));
|
|
40
40
|
async function handlePanic(args) {
|
|
@@ -56,7 +56,7 @@ ${(0, import_chunk_PG5FDKSF.red)(errorMessage)}
|
|
|
56
56
|
|
|
57
57
|
${(0, import_chunk_PG5FDKSF.bold)("Please help us improve Prisma by submitting an error report.")}
|
|
58
58
|
${(0, import_chunk_PG5FDKSF.bold)("Error reports never contain personal or other sensitive information.")}
|
|
59
|
-
${(0, import_chunk_PG5FDKSF.dim)(`Learn more: ${(0,
|
|
59
|
+
${(0, import_chunk_PG5FDKSF.dim)(`Learn more: ${(0, import_chunk_3WXUQZS7.link)("https://pris.ly/d/telemetry")}`)}
|
|
60
60
|
`);
|
|
61
61
|
const { value: shouldSubmitReport } = await (0, import_prompts.default)({
|
|
62
62
|
type: "select",
|
|
@@ -79,7 +79,7 @@ ${(0, import_chunk_PG5FDKSF.dim)(`Learn more: ${(0, import_chunk_I6WLABB2.link)(
|
|
|
79
79
|
if (shouldSubmitReport) {
|
|
80
80
|
try {
|
|
81
81
|
console.log("Submitting...");
|
|
82
|
-
const reportId = await (0,
|
|
82
|
+
const reportId = await (0, import_chunk_4B7YT7EE.sendPanic)({ error, cliVersion, enginesVersion, getDatabaseVersionSafe });
|
|
83
83
|
console.log(`
|
|
84
84
|
${(0, import_chunk_PG5FDKSF.bold)(`We successfully received the error report id: ${reportId}`)}`);
|
|
85
85
|
console.log(`
|
|
@@ -26,15 +26,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_MEOOYUIZ_exports = {};
|
|
30
|
+
__export(chunk_MEOOYUIZ_exports, {
|
|
31
31
|
ErrorKind: () => ErrorKind,
|
|
32
32
|
createErrorReport: () => createErrorReport,
|
|
33
33
|
makeErrorReportCompleted: () => makeErrorReportCompleted,
|
|
34
34
|
uploadZip: () => uploadZip
|
|
35
35
|
});
|
|
36
|
-
module.exports = __toCommonJS(
|
|
37
|
-
var
|
|
36
|
+
module.exports = __toCommonJS(chunk_MEOOYUIZ_exports);
|
|
37
|
+
var import_chunk_KNNTV7IN = require("./chunk-KNNTV7IN.js");
|
|
38
38
|
var import_fetch_engine = require("@prisma/fetch-engine");
|
|
39
39
|
var import_node_http = __toESM(require("node:http"));
|
|
40
40
|
var import_node_https = __toESM(require("node:https"));
|
|
@@ -151,8 +151,8 @@ var Body = class {
|
|
|
151
151
|
} else if (ArrayBuffer.isView(body)) {
|
|
152
152
|
body = import_node_buffer2.Buffer.from(body.buffer, body.byteOffset, body.byteLength);
|
|
153
153
|
} else if (body instanceof import_node_stream2.default) {
|
|
154
|
-
} else if (body instanceof
|
|
155
|
-
body = (0,
|
|
154
|
+
} else if (body instanceof import_chunk_KNNTV7IN.FormData) {
|
|
155
|
+
body = (0, import_chunk_KNNTV7IN.formDataToBlob)(body);
|
|
156
156
|
boundary = body.type.split("=")[1];
|
|
157
157
|
} else {
|
|
158
158
|
body = import_node_buffer2.Buffer.from(String(body));
|
|
@@ -196,14 +196,14 @@ var Body = class {
|
|
|
196
196
|
async formData() {
|
|
197
197
|
const ct = this.headers.get("content-type");
|
|
198
198
|
if (ct.startsWith("application/x-www-form-urlencoded")) {
|
|
199
|
-
const formData = new
|
|
199
|
+
const formData = new import_chunk_KNNTV7IN.FormData();
|
|
200
200
|
const parameters = new URLSearchParams(await this.text());
|
|
201
201
|
for (const [name, value] of parameters) {
|
|
202
202
|
formData.append(name, value);
|
|
203
203
|
}
|
|
204
204
|
return formData;
|
|
205
205
|
}
|
|
206
|
-
const { toFormData } = await import("./multipart-parser-
|
|
206
|
+
const { toFormData } = await import("./multipart-parser-UV3WZSWW.js");
|
|
207
207
|
return toFormData(this.body, ct);
|
|
208
208
|
}
|
|
209
209
|
/**
|
|
@@ -214,7 +214,7 @@ var Body = class {
|
|
|
214
214
|
async blob() {
|
|
215
215
|
const ct = this.headers && this.headers.get("content-type") || this[INTERNALS].body && this[INTERNALS].body.type || "";
|
|
216
216
|
const buf = await this.arrayBuffer();
|
|
217
|
-
return new
|
|
217
|
+
return new import_chunk_KNNTV7IN.fetch_blob_default([buf], {
|
|
218
218
|
type: ct
|
|
219
219
|
});
|
|
220
220
|
}
|
|
@@ -342,7 +342,7 @@ var extractContentType = (body, request2) => {
|
|
|
342
342
|
if (import_node_buffer2.Buffer.isBuffer(body) || import_node_util.types.isAnyArrayBuffer(body) || ArrayBuffer.isView(body)) {
|
|
343
343
|
return null;
|
|
344
344
|
}
|
|
345
|
-
if (body instanceof
|
|
345
|
+
if (body instanceof import_chunk_KNNTV7IN.FormData) {
|
|
346
346
|
return `multipart/form-data; boundary=${request2[INTERNALS].boundary}`;
|
|
347
347
|
}
|
|
348
348
|
if (body && typeof body.getBoundary === "function") {
|
|
@@ -26,8 +26,8 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_MLFKBBDL_exports = {};
|
|
30
|
+
__export(chunk_MLFKBBDL_exports, {
|
|
31
31
|
createDirIfNotExists: () => createDirIfNotExists,
|
|
32
32
|
fs_utils_exports: () => fs_utils_exports,
|
|
33
33
|
getFilesInDir: () => getFilesInDir,
|
|
@@ -36,9 +36,9 @@ __export(chunk_TQFONRJP_exports, {
|
|
|
36
36
|
removeEmptyDirs: () => removeEmptyDirs,
|
|
37
37
|
writeFile: () => writeFile
|
|
38
38
|
});
|
|
39
|
-
module.exports = __toCommonJS(
|
|
39
|
+
module.exports = __toCommonJS(chunk_MLFKBBDL_exports);
|
|
40
40
|
var import_chunk_J77ZIDXB = require("./chunk-J77ZIDXB.js");
|
|
41
|
-
var
|
|
41
|
+
var import_chunk_QOZ7USPD = require("./chunk-QOZ7USPD.js");
|
|
42
42
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
|
43
43
|
var import_promises = __toESM(require("fs/promises"));
|
|
44
44
|
var import_path = __toESM(require("path"));
|
|
@@ -51,7 +51,7 @@ var fs_utils_exports = {};
|
|
|
51
51
|
removeEmptyDirs: () => removeEmptyDirs,
|
|
52
52
|
writeFile: () => writeFile
|
|
53
53
|
});
|
|
54
|
-
var import_globby = (0, import_chunk_4VNS5WPM.__toESM)((0,
|
|
54
|
+
var import_globby = (0, import_chunk_4VNS5WPM.__toESM)((0, import_chunk_QOZ7USPD.require_globby)());
|
|
55
55
|
function createDirIfNotExists(dir) {
|
|
56
56
|
return import_promises.default.mkdir(dir, { recursive: true });
|
|
57
57
|
}
|
|
@@ -26,16 +26,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
31
|
-
getSchemaFromPackageJson: () => getSchemaFromPackageJson,
|
|
29
|
+
var chunk_OKVM3CW4_exports = {};
|
|
30
|
+
__export(chunk_OKVM3CW4_exports, {
|
|
32
31
|
getSchemaWithPath: () => getSchemaWithPath,
|
|
33
32
|
getSchemaWithPathOptional: () => getSchemaWithPathOptional,
|
|
34
33
|
printSchemaLoadedMessage: () => printSchemaLoadedMessage
|
|
35
34
|
});
|
|
36
|
-
module.exports = __toCommonJS(
|
|
35
|
+
module.exports = __toCommonJS(chunk_OKVM3CW4_exports);
|
|
37
36
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
38
|
-
var import_config = require("@prisma/config");
|
|
39
37
|
var import_debug = require("@prisma/debug");
|
|
40
38
|
var import_schema_files_loader = require("@prisma/schema-files-loader");
|
|
41
39
|
var import_fs = __toESM(require("fs"));
|
|
@@ -119,10 +117,6 @@ async function getSchemaWithPathInternal(schemaPathFromArgs, schemaPathFromConfi
|
|
|
119
117
|
if (prismaConfigResult.ok) {
|
|
120
118
|
return prismaConfigResult;
|
|
121
119
|
}
|
|
122
|
-
const pkgJsonResult = await getSchemaFromPackageJson(cwd);
|
|
123
|
-
if (pkgJsonResult.ok) {
|
|
124
|
-
return pkgJsonResult;
|
|
125
|
-
}
|
|
126
120
|
const defaultResult = await getDefaultSchema(cwd);
|
|
127
121
|
if (defaultResult.ok) {
|
|
128
122
|
return defaultResult;
|
|
@@ -179,36 +173,6 @@ async function readSchemaFromPrismaConfigBasedLocation(schemaPathFromConfig) {
|
|
|
179
173
|
}
|
|
180
174
|
return schemaResult;
|
|
181
175
|
}
|
|
182
|
-
async function getSchemaFromPackageJson(cwd) {
|
|
183
|
-
const prismaConfig = await (0, import_config.loadConfigFromPackageJson)(cwd);
|
|
184
|
-
debug("prismaConfig", prismaConfig);
|
|
185
|
-
if (!prismaConfig || !prismaConfig.config?.schema) {
|
|
186
|
-
return { ok: false, error: { kind: "PackageJsonNotConfigured" } };
|
|
187
|
-
}
|
|
188
|
-
const schemaPathFromPkgJson = prismaConfig.config.schema;
|
|
189
|
-
if (typeof schemaPathFromPkgJson !== "string") {
|
|
190
|
-
throw new Error(
|
|
191
|
-
`Provided schema path \`${schemaPathFromPkgJson}\` from \`${import_path.default.relative(
|
|
192
|
-
cwd,
|
|
193
|
-
prismaConfig.loadedFromFile
|
|
194
|
-
)}\` must be of type string`
|
|
195
|
-
);
|
|
196
|
-
}
|
|
197
|
-
const absoluteSchemaPath = import_path.default.isAbsolute(schemaPathFromPkgJson) ? schemaPathFromPkgJson : import_path.default.resolve(import_path.default.dirname(prismaConfig.loadedFromFile), schemaPathFromPkgJson);
|
|
198
|
-
const lookupResult = await readSchemaFromFileOrDirectory(absoluteSchemaPath);
|
|
199
|
-
if (!lookupResult.ok) {
|
|
200
|
-
throw new Error(
|
|
201
|
-
`Could not load schema from \`${import_path.default.relative(
|
|
202
|
-
cwd,
|
|
203
|
-
absoluteSchemaPath
|
|
204
|
-
)}\` provided by "prisma.schema" config of \`${import_path.default.relative(
|
|
205
|
-
cwd,
|
|
206
|
-
prismaConfig.loadedFromFile
|
|
207
|
-
)}\`: ${renderLookupError(lookupResult.error)}`
|
|
208
|
-
);
|
|
209
|
-
}
|
|
210
|
-
return lookupResult;
|
|
211
|
-
}
|
|
212
176
|
async function getDefaultSchema(cwd, failures = []) {
|
|
213
177
|
const lookupPaths = [import_path.default.join(cwd, "schema.prisma"), import_path.default.join(cwd, "prisma", "schema.prisma")];
|
|
214
178
|
for (const path2 of lookupPaths) {
|
|
@@ -26,17 +26,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_OV3PWX3C_exports = {};
|
|
30
|
+
__export(chunk_OV3PWX3C_exports, {
|
|
31
31
|
MergeSchemasError: () => MergeSchemasError,
|
|
32
32
|
mergeSchemas: () => mergeSchemas
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
35
|
-
var
|
|
36
|
-
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
|
34
|
+
module.exports = __toCommonJS(chunk_OV3PWX3C_exports);
|
|
35
|
+
var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
|
|
37
36
|
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
|
38
|
-
var
|
|
39
|
-
var
|
|
37
|
+
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
|
38
|
+
var import_chunk_7VXI23OO = require("./chunk-7VXI23OO.js");
|
|
39
|
+
var import_chunk_D4EKBLXK = require("./chunk-D4EKBLXK.js");
|
|
40
40
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
|
41
41
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
|
42
42
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
@@ -59,12 +59,12 @@ ${detailsHeader} ${message}`;
|
|
|
59
59
|
}).exhaustive();
|
|
60
60
|
const errorMessageWithContext = `${constructedErrorMessage}
|
|
61
61
|
[Context: mergeSchemas]`;
|
|
62
|
-
super((0,
|
|
62
|
+
super((0, import_chunk_7VXI23OO.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
|
63
63
|
this.name = "MergeSchemasError";
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
66
|
function mergeSchemas(options) {
|
|
67
|
-
const debugErrorType = (0,
|
|
67
|
+
const debugErrorType = (0, import_chunk_WSZXPLJQ.createDebugErrorType)(debug, "mergeSchemasWasm");
|
|
68
68
|
debug(`Using mergeSchemas Wasm`);
|
|
69
69
|
const mergeSchemasEither = (0, import_function.pipe)(
|
|
70
70
|
(0, import_chunk_5DBOS77Y.tryCatch)(
|
|
@@ -72,7 +72,7 @@ function mergeSchemas(options) {
|
|
|
72
72
|
const params = JSON.stringify({
|
|
73
73
|
schema: options.schemas
|
|
74
74
|
});
|
|
75
|
-
return
|
|
75
|
+
return import_chunk_D4EKBLXK.prismaSchemaWasm.merge_schemas(params);
|
|
76
76
|
},
|
|
77
77
|
(e) => ({
|
|
78
78
|
type: "wasm-error",
|
|
@@ -104,7 +104,7 @@ function mergeSchemas(options) {
|
|
|
104
104
|
return panic;
|
|
105
105
|
}
|
|
106
106
|
const errorOutput = e.error.message;
|
|
107
|
-
return new MergeSchemasError((0,
|
|
107
|
+
return new MergeSchemasError((0, import_chunk_WSZXPLJQ.parseQueryEngineError)({ errorOutput, reason: e.reason }));
|
|
108
108
|
}).exhaustive();
|
|
109
109
|
throw error;
|
|
110
110
|
}
|
|
@@ -26,83 +26,58 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_PQBHK5IY_exports = {};
|
|
30
|
+
__export(chunk_PQBHK5IY_exports, {
|
|
31
31
|
checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
|
|
32
|
-
checkUnsupportedSchemaEngineWasm: () => checkUnsupportedSchemaEngineWasm,
|
|
33
|
-
forbiddenCmdFlagWithSchemaEngineWasm: () => forbiddenCmdFlagWithSchemaEngineWasm,
|
|
34
32
|
forbiddenCmdWithDataProxyFlagMessage: () => forbiddenCmdWithDataProxyFlagMessage,
|
|
35
33
|
formatSchema: () => formatSchema,
|
|
36
34
|
getBinaryTargetForCurrentPlatform: () => import_get_platform2.getBinaryTargetForCurrentPlatform,
|
|
37
35
|
getGenerator: () => getGenerator,
|
|
38
36
|
getGenerators: () => getGenerators,
|
|
39
|
-
|
|
37
|
+
getSchemaDatasourceProvider: () => getSchemaDatasourceProvider,
|
|
40
38
|
knownBinaryTargets: () => knownBinaryTargets,
|
|
41
39
|
loadSchemaContext: () => loadSchemaContext,
|
|
42
40
|
processSchemaResult: () => processSchemaResult,
|
|
43
41
|
skipIndex: () => skipIndex
|
|
44
42
|
});
|
|
45
|
-
module.exports = __toCommonJS(
|
|
43
|
+
module.exports = __toCommonJS(chunk_PQBHK5IY_exports);
|
|
44
|
+
var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
|
|
45
|
+
var import_chunk_5MHUYAV3 = require("./chunk-5MHUYAV3.js");
|
|
46
46
|
var import_chunk_X3P4J7WW = require("./chunk-X3P4J7WW.js");
|
|
47
47
|
var import_chunk_LRU47BGE = require("./chunk-LRU47BGE.js");
|
|
48
|
-
var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
|
|
49
|
-
var import_chunk_F2OZV76L = require("./chunk-F2OZV76L.js");
|
|
50
|
-
var import_chunk_RS2R7COT = require("./chunk-RS2R7COT.js");
|
|
51
48
|
var import_chunk_GXW4NTU2 = require("./chunk-GXW4NTU2.js");
|
|
52
49
|
var import_chunk_5FJ3MENK = require("./chunk-5FJ3MENK.js");
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var import_chunk_I6WLABB2 = require("./chunk-I6WLABB2.js");
|
|
50
|
+
var import_chunk_7SF6QSKE = require("./chunk-7SF6QSKE.js");
|
|
51
|
+
var import_chunk_CIGXHXCG = require("./chunk-CIGXHXCG.js");
|
|
52
|
+
var import_chunk_3WXUQZS7 = require("./chunk-3WXUQZS7.js");
|
|
57
53
|
var import_chunk_CRVLHWC5 = require("./chunk-CRVLHWC5.js");
|
|
58
|
-
var
|
|
59
|
-
var
|
|
60
|
-
var
|
|
61
|
-
var
|
|
62
|
-
var
|
|
63
|
-
var
|
|
64
|
-
var import_chunk_ZJWZK45Z = require("./chunk-ZJWZK45Z.js");
|
|
54
|
+
var import_chunk_D2VJ7AHY = require("./chunk-D2VJ7AHY.js");
|
|
55
|
+
var import_chunk_DAQEKDOT = require("./chunk-DAQEKDOT.js");
|
|
56
|
+
var import_chunk_3Q44BUMJ = require("./chunk-3Q44BUMJ.js");
|
|
57
|
+
var import_chunk_R4FAVDNZ = require("./chunk-R4FAVDNZ.js");
|
|
58
|
+
var import_chunk_STE4IPGC = require("./chunk-STE4IPGC.js");
|
|
59
|
+
var import_chunk_OKVM3CW4 = require("./chunk-OKVM3CW4.js");
|
|
65
60
|
var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
|
|
66
61
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
|
67
62
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
68
63
|
var import_chunk_BPDMLM32 = require("./chunk-BPDMLM32.js");
|
|
69
64
|
var import_chunk_IOIAK7V7 = require("./chunk-IOIAK7V7.js");
|
|
65
|
+
var import_chunk_QSVWJ2S2 = require("./chunk-QSVWJ2S2.js");
|
|
66
|
+
var import_chunk_ZJWZK45Z = require("./chunk-ZJWZK45Z.js");
|
|
70
67
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
71
|
-
var import_chunk_BVJP43JS = require("./chunk-BVJP43JS.js");
|
|
72
68
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
|
73
|
-
var
|
|
69
|
+
var import_node_path = __toESM(require("node:path"));
|
|
74
70
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
75
71
|
var import_debug2 = __toESM(require("@prisma/debug"));
|
|
76
72
|
var import_engines = require("@prisma/engines");
|
|
77
73
|
var import_get_platform = require("@prisma/get-platform");
|
|
78
|
-
var
|
|
74
|
+
var import_path = __toESM(require("path"));
|
|
79
75
|
var import_get_platform2 = require("@prisma/get-platform");
|
|
80
|
-
var forbiddenCmdFlagWithSchemaEngineWasm = ({ cmd, flag }) => `
|
|
81
|
-
Passing the ${(0, import_chunk_PG5FDKSF.green)(`${flag}`)} flag to the ${(0, import_chunk_PG5FDKSF.green)(`prisma ${cmd}`)} command is not supported when
|
|
82
|
-
defining an ${(0, import_chunk_PG5FDKSF.green)(`adapter`)} in Prisma config file (e.g., ${(0, import_chunk_PG5FDKSF.green)(`\`prisma.config.ts\``)}).
|
|
83
|
-
|
|
84
|
-
More information about this limitation: ${(0, import_chunk_I6WLABB2.link)("https://pris.ly/d/schema-engine-limitations")}
|
|
85
|
-
`;
|
|
86
|
-
function checkUnsupportedSchemaEngineWasm({
|
|
87
|
-
cmd,
|
|
88
|
-
config,
|
|
89
|
-
args,
|
|
90
|
-
flags
|
|
91
|
-
}) {
|
|
92
|
-
if (config.engine !== "js") {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
for (const flag of flags) {
|
|
96
|
-
if (args[flag] !== void 0) {
|
|
97
|
-
throw new Error(forbiddenCmdFlagWithSchemaEngineWasm({ cmd, flag }));
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
76
|
var debug = (0, import_debug.default)("prisma:format");
|
|
102
77
|
async function formatSchema({ schemas }, inputFormattingOptions) {
|
|
103
78
|
if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
|
|
104
79
|
handleFormatPanic(() => {
|
|
105
|
-
|
|
80
|
+
import_chunk_STE4IPGC.prismaSchemaWasm.debug_panic();
|
|
106
81
|
});
|
|
107
82
|
}
|
|
108
83
|
const defaultFormattingOptions = {
|
|
@@ -119,10 +94,10 @@ async function formatSchema({ schemas }, inputFormattingOptions) {
|
|
|
119
94
|
const { formattedMultipleSchemas, lintDiagnostics } = handleFormatPanic(() => {
|
|
120
95
|
const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas), documentFormattingParams);
|
|
121
96
|
const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
|
|
122
|
-
const lintDiagnostics2 = (0,
|
|
97
|
+
const lintDiagnostics2 = (0, import_chunk_D2VJ7AHY.lintSchema)({ schemas: formattedMultipleSchemas2 });
|
|
123
98
|
return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
|
|
124
99
|
});
|
|
125
|
-
const lintWarnings = (0,
|
|
100
|
+
const lintWarnings = (0, import_chunk_D2VJ7AHY.getLintWarningsAsText)(lintDiagnostics);
|
|
126
101
|
if (lintWarnings && import_chunk_ZJWZK45Z.logger_exports.should.warn()) {
|
|
127
102
|
console.warn(lintWarnings);
|
|
128
103
|
}
|
|
@@ -149,60 +124,45 @@ function handleFormatPanic(tryCb) {
|
|
|
149
124
|
}
|
|
150
125
|
}
|
|
151
126
|
function formatWasm(schema, documentFormattingParams) {
|
|
152
|
-
const formattedSchema =
|
|
127
|
+
const formattedSchema = import_chunk_STE4IPGC.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
|
|
153
128
|
return formattedSchema;
|
|
154
129
|
}
|
|
155
130
|
async function loadSchemaContext({
|
|
156
131
|
schemaPathFromArg,
|
|
157
132
|
schemaPathFromConfig,
|
|
158
|
-
schemaEngineConfig,
|
|
159
133
|
printLoadMessage = true,
|
|
160
|
-
ignoreEnvVarErrors = false,
|
|
161
134
|
allowNull = false,
|
|
162
135
|
schemaPathArgumentName = "--schema",
|
|
163
136
|
cwd = process.cwd()
|
|
164
137
|
} = {}) {
|
|
165
138
|
let schemaResult = null;
|
|
166
139
|
if (allowNull) {
|
|
167
|
-
schemaResult = await (0,
|
|
140
|
+
schemaResult = await (0, import_chunk_OKVM3CW4.getSchemaWithPathOptional)(schemaPathFromArg, schemaPathFromConfig, {
|
|
168
141
|
argumentName: schemaPathArgumentName,
|
|
169
142
|
cwd
|
|
170
143
|
});
|
|
171
144
|
if (!schemaResult) return null;
|
|
172
145
|
} else {
|
|
173
|
-
schemaResult = await (0,
|
|
146
|
+
schemaResult = await (0, import_chunk_OKVM3CW4.getSchemaWithPath)(schemaPathFromArg, schemaPathFromConfig, {
|
|
174
147
|
argumentName: schemaPathArgumentName,
|
|
175
148
|
cwd
|
|
176
149
|
});
|
|
177
150
|
}
|
|
178
|
-
return processSchemaResult({ schemaResult,
|
|
151
|
+
return processSchemaResult({ schemaResult, printLoadMessage, cwd });
|
|
179
152
|
}
|
|
180
153
|
async function processSchemaResult({
|
|
181
154
|
schemaResult,
|
|
182
|
-
schemaEngineConfig,
|
|
183
155
|
printLoadMessage = true,
|
|
184
|
-
ignoreEnvVarErrors = false,
|
|
185
156
|
cwd = process.cwd()
|
|
186
157
|
}) {
|
|
187
|
-
const loadedFromPathForLogMessages =
|
|
158
|
+
const loadedFromPathForLogMessages = import_node_path.default.relative(cwd, schemaResult.schemaPath);
|
|
188
159
|
const schemaRootDir = schemaResult.schemaRootDir || cwd;
|
|
189
160
|
if (printLoadMessage) {
|
|
190
|
-
(0,
|
|
161
|
+
(0, import_chunk_OKVM3CW4.printSchemaLoadedMessage)(loadedFromPathForLogMessages);
|
|
191
162
|
}
|
|
192
|
-
const configFromPsl = await (0,
|
|
193
|
-
const
|
|
194
|
-
const
|
|
195
|
-
const { url, directUrl, shadowDatabaseUrl } = datasource;
|
|
196
|
-
const primaryDatasource2 = {
|
|
197
|
-
...datasourceFromPsl,
|
|
198
|
-
url: { fromEnvVar: null, value: url },
|
|
199
|
-
directUrl: directUrl ? { fromEnvVar: null, value: directUrl } : void 0,
|
|
200
|
-
shadowDatabaseUrl: shadowDatabaseUrl ? { fromEnvVar: null, value: shadowDatabaseUrl } : void 0,
|
|
201
|
-
[Symbol.for("engine.classic")]: true
|
|
202
|
-
};
|
|
203
|
-
return primaryDatasource2;
|
|
204
|
-
}).otherwise(() => datasourceFromPsl);
|
|
205
|
-
const primaryDatasourceDirectory = getPrimaryDatasourceDirectory(datasourceFromPsl) || schemaRootDir;
|
|
163
|
+
const configFromPsl = await (0, import_chunk_3Q44BUMJ.getConfig)({ datamodel: schemaResult.schemas });
|
|
164
|
+
const primaryDatasource = configFromPsl.datasources.at(0);
|
|
165
|
+
const primaryDatasourceDirectory = getPrimaryDatasourceDirectory(primaryDatasource) || schemaRootDir;
|
|
206
166
|
return {
|
|
207
167
|
schemaFiles: schemaResult.schemas,
|
|
208
168
|
schemaPath: schemaResult.schemaPath,
|
|
@@ -218,11 +178,17 @@ async function processSchemaResult({
|
|
|
218
178
|
function getPrimaryDatasourceDirectory(primaryDatasource) {
|
|
219
179
|
const datasourcePath = primaryDatasource?.sourceFilePath;
|
|
220
180
|
if (datasourcePath) {
|
|
221
|
-
return
|
|
181
|
+
return import_node_path.default.dirname(datasourcePath);
|
|
222
182
|
}
|
|
223
183
|
return null;
|
|
224
184
|
}
|
|
225
|
-
|
|
185
|
+
function getSchemaDatasourceProvider(schemaContext) {
|
|
186
|
+
if (schemaContext.primaryDatasource === void 0) {
|
|
187
|
+
throw new Error("Schema must contain a datasource block");
|
|
188
|
+
}
|
|
189
|
+
return schemaContext.primaryDatasource.activeProvider;
|
|
190
|
+
}
|
|
191
|
+
var import_p_map = (0, import_chunk_4VNS5WPM.__toESM)((0, import_chunk_QSVWJ2S2.require_p_map)());
|
|
226
192
|
var debug2 = (0, import_debug2.default)("prisma:getGenerators");
|
|
227
193
|
async function getGenerators(options) {
|
|
228
194
|
if (options.registry === void 0 && options.providerAliases !== void 0) {
|
|
@@ -246,29 +212,27 @@ async function getGenerators(options) {
|
|
|
246
212
|
skipDownload,
|
|
247
213
|
binaryPathsOverride,
|
|
248
214
|
generatorNames = [],
|
|
249
|
-
postinstall,
|
|
250
|
-
noEngine,
|
|
251
215
|
allowNoModels = true,
|
|
252
216
|
typedSql
|
|
253
217
|
} = options;
|
|
254
|
-
const schemaContext = !options.schemaContext && schemaPath ? await loadSchemaContext({ schemaPathFromArg: schemaPath
|
|
218
|
+
const schemaContext = !options.schemaContext && schemaPath ? await loadSchemaContext({ schemaPathFromArg: schemaPath }) : options.schemaContext;
|
|
255
219
|
if (!schemaContext) {
|
|
256
220
|
throw new Error(`no schema provided for getGenerators`);
|
|
257
221
|
}
|
|
258
222
|
if (!schemaContext.primaryDatasource) {
|
|
259
|
-
throw new Error(
|
|
223
|
+
throw new Error(import_chunk_7SF6QSKE.missingDatasource);
|
|
260
224
|
}
|
|
261
225
|
(0, import_chunk_5FJ3MENK.printConfigWarnings)(schemaContext.warnings);
|
|
262
226
|
const previewFeatures = (0, import_chunk_CRVLHWC5.extractPreviewFeatures)(schemaContext.generators);
|
|
263
|
-
const dmmf = await (0,
|
|
227
|
+
const dmmf = await (0, import_chunk_R4FAVDNZ.getDMMF)({
|
|
264
228
|
datamodel: schemaContext.schemaFiles,
|
|
265
229
|
previewFeatures
|
|
266
230
|
});
|
|
267
231
|
if (dmmf.datamodel.models.length === 0 && !allowNoModels) {
|
|
268
232
|
if (schemaContext.primaryDatasource.provider === "mongodb") {
|
|
269
|
-
throw new Error(
|
|
233
|
+
throw new Error(import_chunk_CIGXHXCG.missingModelMessageMongoDB);
|
|
270
234
|
}
|
|
271
|
-
throw new Error(
|
|
235
|
+
throw new Error(import_chunk_CIGXHXCG.missingModelMessage);
|
|
272
236
|
}
|
|
273
237
|
const generatorConfigs = filterGenerators(overrideGenerators || schemaContext.generators, generatorNames);
|
|
274
238
|
await validateGenerators(generatorConfigs);
|
|
@@ -277,7 +241,7 @@ async function getGenerators(options) {
|
|
|
277
241
|
const generators = await (0, import_p_map.default)(
|
|
278
242
|
generatorConfigs,
|
|
279
243
|
async (generatorConfig, index) => {
|
|
280
|
-
const baseDir =
|
|
244
|
+
const baseDir = import_path.default.dirname(generatorConfig.sourceFilePath ?? schemaContext.schemaRootDir);
|
|
281
245
|
const providerValue = (0, import_chunk_IOIAK7V7.parseEnvValue)(generatorConfig.provider);
|
|
282
246
|
const generatorDefinition = registry[providerValue] ?? {
|
|
283
247
|
type: "rpc",
|
|
@@ -290,7 +254,7 @@ async function getGenerators(options) {
|
|
|
290
254
|
await generatorInstance.init();
|
|
291
255
|
if (generatorConfig.output) {
|
|
292
256
|
generatorConfig.output = {
|
|
293
|
-
value:
|
|
257
|
+
value: import_path.default.resolve(baseDir, (0, import_chunk_IOIAK7V7.parseEnvValue)(generatorConfig.output)),
|
|
294
258
|
fromEnvVar: null
|
|
295
259
|
};
|
|
296
260
|
generatorConfig.isCustomOutput = true;
|
|
@@ -311,8 +275,7 @@ You need to define \`output\` in the generator block in the schema file.`
|
|
|
311
275
|
fromEnvVar: null
|
|
312
276
|
};
|
|
313
277
|
}
|
|
314
|
-
const datamodel = (0,
|
|
315
|
-
const envPaths = await (0, import_chunk_46ABODUM.getEnvPaths)(schemaContext.schemaPath, { cwd: generatorConfig.output.value });
|
|
278
|
+
const datamodel = (0, import_chunk_DAQEKDOT.mergeSchemas)({ schemas: schemaContext.schemaFiles });
|
|
316
279
|
const options2 = {
|
|
317
280
|
datamodel,
|
|
318
281
|
datasources: schemaContext.datasources,
|
|
@@ -323,10 +286,7 @@ You need to define \`output\` in the generator block in the schema file.`
|
|
|
323
286
|
// TODO:(schemaPath) can we get rid of schema path passing here?
|
|
324
287
|
version: version2 || import_engines.enginesVersion,
|
|
325
288
|
// this version makes no sense anymore and should be ignored
|
|
326
|
-
postinstall,
|
|
327
|
-
noEngine,
|
|
328
289
|
allowNoModels,
|
|
329
|
-
envPaths,
|
|
330
290
|
typedSql
|
|
331
291
|
};
|
|
332
292
|
generatorInstance.setOptions(options2);
|
|
@@ -370,18 +330,16 @@ generator gen {
|
|
|
370
330
|
}
|
|
371
331
|
const generatorBinaryTargets = g.options?.generator?.binaryTargets;
|
|
372
332
|
if (generatorBinaryTargets && generatorBinaryTargets.length > 0) {
|
|
373
|
-
for (const
|
|
374
|
-
if (!neededVersions[neededVersion].binaryTargets.find((object) => object.value ===
|
|
375
|
-
neededVersions[neededVersion].binaryTargets.push(
|
|
333
|
+
for (const binaryTarget of generatorBinaryTargets) {
|
|
334
|
+
if (!neededVersions[neededVersion].binaryTargets.find((object) => object.value === binaryTarget.value)) {
|
|
335
|
+
neededVersions[neededVersion].binaryTargets.push(binaryTarget);
|
|
376
336
|
}
|
|
377
337
|
}
|
|
378
338
|
}
|
|
379
339
|
}
|
|
380
340
|
}
|
|
381
|
-
const queryEngineBinaryType = (0, import_engines.getCliQueryEngineBinaryType)();
|
|
382
|
-
const queryEngineType = (0, import_chunk_RS2R7COT.binaryTypeToEngineType)(queryEngineBinaryType);
|
|
383
341
|
debug2("neededVersions", JSON.stringify(neededVersions, null, 2));
|
|
384
|
-
const { binaryPathsByVersion
|
|
342
|
+
const { binaryPathsByVersion } = await (0, import_chunk_5MHUYAV3.getBinaryPathsByVersion)({
|
|
385
343
|
neededVersions,
|
|
386
344
|
// We're lazily computing the binary target here, to avoid printing the
|
|
387
345
|
// `Prisma failed to detect the libssl/openssl version to use` warning
|
|
@@ -402,17 +360,6 @@ generator gen {
|
|
|
402
360
|
const generatorBinaryPaths = (0, import_chunk_GXW4NTU2.pick)(binaryPaths ?? {}, generator.manifest.requiresEngines);
|
|
403
361
|
debug2({ generatorBinaryPaths });
|
|
404
362
|
generator.setBinaryPaths(generatorBinaryPaths);
|
|
405
|
-
if (engineVersion !== version2 && generator.options && generator.manifest.requiresEngines.includes(queryEngineType) && generatorBinaryPaths[queryEngineType] && generatorBinaryPaths[queryEngineType]?.[binaryTarget]) {
|
|
406
|
-
const customDmmf = await (0, import_chunk_J32M37NY.getDMMF)({
|
|
407
|
-
datamodel: schemaContext.schemaFiles,
|
|
408
|
-
previewFeatures
|
|
409
|
-
});
|
|
410
|
-
const options2 = { ...generator.options, dmmf: customDmmf };
|
|
411
|
-
debug2("generator.manifest.prettyName", generator.manifest.prettyName);
|
|
412
|
-
debug2("options", options2);
|
|
413
|
-
debug2("options.generator.binaryTargets", options2.generator.binaryTargets);
|
|
414
|
-
generator.setOptions(options2);
|
|
415
|
-
}
|
|
416
363
|
}
|
|
417
364
|
}
|
|
418
365
|
return generators;
|
|
@@ -437,17 +384,6 @@ var oldToNewBinaryTargetsMapping = {
|
|
|
437
384
|
async function validateGenerators(generators) {
|
|
438
385
|
const binaryTarget = await (0, import_get_platform.getBinaryTargetForCurrentPlatform)();
|
|
439
386
|
for (const generator of generators) {
|
|
440
|
-
if (generator.config.platforms) {
|
|
441
|
-
throw new Error(
|
|
442
|
-
`The \`platforms\` field on the generator definition is deprecated. Please rename it to \`binaryTargets\`.`
|
|
443
|
-
);
|
|
444
|
-
}
|
|
445
|
-
if (generator.config.pinnedBinaryTargets) {
|
|
446
|
-
throw new Error(
|
|
447
|
-
`The \`pinnedBinaryTargets\` field on the generator definition is deprecated.
|
|
448
|
-
Please use the PRISMA_QUERY_ENGINE_BINARY env var instead to pin the binary target.`
|
|
449
|
-
);
|
|
450
|
-
}
|
|
451
387
|
if (generator.binaryTargets) {
|
|
452
388
|
const binaryTargets2 = generator.binaryTargets && generator.binaryTargets.length > 0 ? generator.binaryTargets : [{ fromEnvVar: null, value: "native" }];
|
|
453
389
|
const resolvedBinaryTargets = binaryTargets2.flatMap((object) => (0, import_chunk_IOIAK7V7.parseBinaryTargetsEnvValue)(object)).map((p) => p === "native" ? binaryTarget : p);
|
|
@@ -509,23 +445,14 @@ function filterGenerators(generators, generatorNames) {
|
|
|
509
445
|
}
|
|
510
446
|
var forbiddenCmdWithDataProxyFlagMessage = (command) => `
|
|
511
447
|
Using an Accelerate URL is not supported for this CLI command ${(0, import_chunk_PG5FDKSF.green)(`prisma ${command}`)} yet.
|
|
512
|
-
Please use a direct connection to your database
|
|
448
|
+
Please use a direct connection to your database in \`prisma.config.ts\`.
|
|
513
449
|
|
|
514
|
-
More information about this limitation: ${(0,
|
|
450
|
+
More information about this limitation: ${(0, import_chunk_3WXUQZS7.link)("https://pris.ly/d/accelerate-limitations")}
|
|
515
451
|
`;
|
|
516
|
-
function checkUnsupportedDataProxy({
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
urls = []
|
|
520
|
-
}) {
|
|
521
|
-
for (const url2 of urls) {
|
|
522
|
-
if (url2 && url2.includes("prisma://")) {
|
|
452
|
+
function checkUnsupportedDataProxy({ cmd, config }) {
|
|
453
|
+
if (config?.engine === "classic") {
|
|
454
|
+
if (config.datasource.url.startsWith("prisma://")) {
|
|
523
455
|
throw new Error(forbiddenCmdWithDataProxyFlagMessage(cmd));
|
|
524
456
|
}
|
|
525
457
|
}
|
|
526
|
-
if (!schemaContext?.primaryDatasource) return;
|
|
527
|
-
const url = (0, import_chunk_JYBUBKFO.resolveUrl)((0, import_chunk_JYBUBKFO.getEffectiveUrl)(schemaContext.primaryDatasource));
|
|
528
|
-
if (url?.startsWith("prisma://")) {
|
|
529
|
-
throw new Error(forbiddenCmdWithDataProxyFlagMessage(cmd));
|
|
530
|
-
}
|
|
531
458
|
}
|