@prisma/internals 6.20.0-integration-feat-prisma-7-config.1 → 6.20.0-integration-merge-release-workflows.2
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-5ZSVGCMS.js → chunk-2GUGGLPK.js} +96 -40
- package/dist/chunk-3FP46GUV.js +471 -0
- package/dist/chunk-46ABODUM.js +186 -0
- package/dist/{chunk-GJSFP4V4.js → chunk-4CGPN5SR.js} +9 -3
- package/dist/{chunk-GL7OANR6.js → chunk-4JCVHBYR.js} +5 -5
- package/dist/{chunk-MEOOYUIZ.js → chunk-5AI4FIZ3.js} +10 -10
- package/dist/{chunk-WITEP52Z.js → chunk-6K6FK4UW.js} +5 -5
- package/dist/chunk-6TTRTZXU.js +37 -0
- package/dist/{chunk-ANOE4NZ5.js → chunk-6ZGNGCXO.js} +9 -8
- package/dist/{chunk-SMJRM3EM.js → chunk-75BIJ5PX.js} +9 -9
- package/dist/{chunk-MYLPCGTT.js → chunk-7QC5VORA.js} +5 -5
- package/dist/{chunk-TGA7DC5A.js → chunk-AX5N26KG.js} +9 -14
- package/dist/{chunk-C5YUUOQW.js → chunk-BSTUWVHD.js} +12 -12
- package/dist/{chunk-QSVWJ2S2.js → chunk-BVJP43JS.js} +784 -13
- package/dist/{chunk-B2BNIZB2.js → chunk-CCLAMTCA.js} +8 -7
- package/dist/chunk-D4VDA2TZ.js +66 -0
- package/dist/chunk-DZYINYAA.js +68 -0
- package/dist/{chunk-VHE2A7YV.js → chunk-E4H6V3Z4.js} +11 -11
- package/dist/{chunk-WKOGDEF4.js → chunk-E5VGO6SU.js} +11 -11
- package/dist/chunk-ERSH2BQA.js +58 -0
- package/dist/{chunk-3ZWEK4N6.js → chunk-EWDCQQHP.js} +5 -5
- package/dist/{chunk-OKVM3CW4.js → chunk-EYVG6XQS.js} +39 -3
- package/dist/{chunk-5MHUYAV3.js → chunk-F2OZV76L.js} +9 -9
- package/dist/{chunk-VITPVRRI.js → chunk-FHZ5QJLR.js} +5 -5
- package/dist/{chunk-HNRMSI3R.js → chunk-FYZCPL2Z.js} +8 -5
- package/dist/{chunk-22HIO2UL.js → chunk-GMW36QQF.js} +7 -7
- package/dist/{chunk-BUQN4WLU.js → chunk-HFFWZTVM.js} +9 -7
- package/dist/{chunk-CGLLQXZE.js → chunk-HHG4DGHC.js} +12 -11
- package/dist/{chunk-5W3BSMTH.js → chunk-HO5HRHFZ.js} +6 -3
- package/dist/{chunk-3WXUQZS7.js → chunk-I6WLABB2.js} +5 -14
- package/dist/{chunk-FF7OLLBP.js → chunk-IDINCQMN.js} +784 -12
- package/dist/{chunk-QOZ7USPD.js → chunk-JOIIWB3U.js} +159 -193
- package/dist/{chunk-QJDVKII7.js → chunk-JTS4UPHJ.js} +5 -5
- package/dist/{chunk-RVTU2FIM.js → chunk-LV27YCGC.js} +11 -11
- package/dist/{chunk-KNNTV7IN.js → chunk-NVNI2SRU.js} +213 -687
- package/dist/{chunk-2Q43C56O.js → chunk-O2AHE2LQ.js} +5 -5
- package/dist/{chunk-H5STSTVK.js → chunk-OAT7ZJED.js} +20 -7
- package/dist/{chunk-DOY5PWV6.js → chunk-PXYIFYEC.js} +96 -40
- package/dist/chunk-PZMRR772.js +41 -0
- package/dist/{chunk-VFZCLI5X.js → chunk-QJ3QPUM5.js} +5 -5
- package/dist/{chunk-5I4ERIIY.js → chunk-RS2R7COT.js} +9 -3
- package/dist/{chunk-24ZPBDBI.js → chunk-S4PA7OZ7.js} +11 -11
- package/dist/{chunk-LA5QBRTU.js → chunk-SOKSKSEX.js} +20 -14
- package/dist/chunk-T2PM5TKT.js +55 -0
- package/dist/{chunk-QGQTFZOZ.js → chunk-T2UCYUSA.js} +20 -14
- package/dist/{chunk-5SJXW6MS.js → chunk-TBR6SNKL.js} +5 -5
- package/dist/{chunk-MLFKBBDL.js → chunk-TQFONRJP.js} +5 -5
- package/dist/{chunk-WSZXPLJQ.js → chunk-TZJROXB3.js} +4 -4
- package/dist/{chunk-WJKBKH3Y.js → chunk-UHI6VYFX.js} +5 -5
- package/dist/{chunk-BM3JIFQT.js → chunk-UQUWZJVN.js} +7 -7
- package/dist/{chunk-ARC7TW3L.js → chunk-WFNB7VRA.js} +14 -4
- package/dist/{chunk-COA7HD3T.js → chunk-WYQJ4JWO.js} +12 -12
- package/dist/{chunk-73HXEN2A.js → chunk-ZI7MNI3W.js} +5 -5
- package/dist/cli/checkUnsupportedDataProxy.js +60 -53
- package/dist/cli/checkUnsupportedSchemaEngineWasm.d.ts +22 -0
- package/dist/cli/checkUnsupportedSchemaEngineWasm.js +135 -0
- package/dist/cli/getGeneratorSuccessMessage.js +3 -2
- package/dist/cli/getSchema.d.ts +15 -1
- package/dist/cli/getSchema.js +5 -4
- package/dist/cli/hashes.js +4 -4
- package/dist/cli/schemaContext.d.ts +11 -2
- package/dist/cli/schemaContext.js +60 -53
- package/dist/client/getClientEngineType.d.ts +7 -0
- package/dist/client/getClientEngineType.js +26 -0
- package/dist/dotenvExpand.d.ts +35 -0
- package/dist/dotenvExpand.js +25 -0
- package/dist/engine-commands/errorHelpers.js +4 -4
- package/dist/engine-commands/formatSchema.js +59 -52
- package/dist/engine-commands/getConfig.d.ts +1 -0
- package/dist/engine-commands/getConfig.js +13 -13
- package/dist/engine-commands/getDmmf.js +10 -10
- package/dist/engine-commands/getEngineVersion.js +9 -6
- package/dist/engine-commands/getEnginesInfo.d.ts +1 -0
- package/dist/engine-commands/getEnginesInfo.js +9 -7
- package/dist/engine-commands/index.js +71 -64
- 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 +1 -0
- package/dist/get-generators/getGenerators.js +62 -55
- 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 +5 -6
- package/dist/getPackedPackage.js +3 -4
- package/dist/index.d.ts +10 -1
- package/dist/index.js +112 -95
- package/dist/{multipart-parser-UV3WZSWW.js → multipart-parser-3AFJFP6K.js} +6 -6
- package/dist/resolveBinary.js +7 -8
- package/dist/schemaEngineCommands.js +8 -9
- package/dist/sendPanic.js +4 -4
- package/dist/utils/cloudflareD1.d.ts +5 -0
- package/dist/utils/cloudflareD1.js +27 -0
- 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/getEnvPaths.d.ts +14 -0
- package/dist/utils/getEnvPaths.js +29 -0
- package/dist/utils/getVersionFromPackageJson.js +3 -3
- package/dist/utils/handleEngineLoadingErrors.d.ts +8 -0
- package/dist/utils/handleEngineLoadingErrors.js +27 -0
- package/dist/utils/handlePanic.js +6 -6
- package/dist/utils/link.js +2 -2
- package/dist/utils/load.d.ts +6 -0
- package/dist/utils/load.js +28 -0
- package/dist/utils/loadEnvFile.d.ts +10 -0
- package/dist/utils/loadEnvFile.js +30 -0
- package/dist/utils/missingDatasource.js +3 -3
- package/dist/utils/missingGeneratorMessage.js +5 -5
- package/dist/utils/serializeQueryEngineName.js +2 -2
- package/dist/utils/tryLoadEnvs.d.ts +25 -0
- package/dist/utils/tryLoadEnvs.js +30 -0
- package/dist/wasm.js +5 -5
- package/package.json +16 -15
- package/dist/chunk-DYV47NUW.js +0 -796
|
@@ -16,15 +16,15 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_O2AHE2LQ_exports = {};
|
|
20
|
+
__export(chunk_O2AHE2LQ_exports, {
|
|
21
21
|
addVersionDetailsToErrorMessage: () => addVersionDetailsToErrorMessage
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_O2AHE2LQ_exports);
|
|
24
|
+
var import_chunk_6K6FK4UW = require("./chunk-6K6FK4UW.js");
|
|
24
25
|
var import_chunk_QN6PSQY7 = require("./chunk-QN6PSQY7.js");
|
|
25
|
-
var import_chunk_VFZCLI5X = require("./chunk-VFZCLI5X.js");
|
|
26
26
|
function addVersionDetailsToErrorMessage(message) {
|
|
27
|
-
const rows = [["Prisma CLI Version",
|
|
27
|
+
const rows = [["Prisma CLI Version", import_chunk_6K6FK4UW.version]];
|
|
28
28
|
return `${message}
|
|
29
29
|
|
|
30
30
|
${(0, import_chunk_QN6PSQY7.formatTable)(rows)}`;
|
|
@@ -16,20 +16,33 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_OAT7ZJED_exports = {};
|
|
20
|
+
__export(chunk_OAT7ZJED_exports, {
|
|
21
21
|
getEngineVersion: () => getEngineVersion,
|
|
22
22
|
safeGetEngineVersion: () => safeGetEngineVersion
|
|
23
23
|
});
|
|
24
|
-
module.exports = __toCommonJS(
|
|
24
|
+
module.exports = __toCommonJS(chunk_OAT7ZJED_exports);
|
|
25
|
+
var import_chunk_6TTRTZXU = require("./chunk-6TTRTZXU.js");
|
|
25
26
|
var import_chunk_JOIHHXR6 = require("./chunk-JOIHHXR6.js");
|
|
26
|
-
var
|
|
27
|
+
var import_chunk_FYZCPL2Z = require("./chunk-FYZCPL2Z.js");
|
|
27
28
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
|
29
|
+
var import_engines = require("@prisma/engines");
|
|
28
30
|
var import_fetch_engine = require("@prisma/fetch-engine");
|
|
31
|
+
var import_get_platform = require("@prisma/get-platform");
|
|
29
32
|
async function getEngineVersion(enginePath, binaryName) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
+
if (!binaryName) {
|
|
34
|
+
binaryName = (0, import_engines.getCliQueryEngineBinaryType)();
|
|
35
|
+
}
|
|
36
|
+
enginePath = await (0, import_chunk_FYZCPL2Z.resolveBinary)(binaryName, enginePath);
|
|
37
|
+
const platformInfo = await (0, import_get_platform.getPlatformInfo)();
|
|
38
|
+
if (binaryName === import_fetch_engine.BinaryType.QueryEngineLibrary) {
|
|
39
|
+
(0, import_get_platform.assertNodeAPISupported)();
|
|
40
|
+
const QE = (0, import_chunk_6TTRTZXU.loadLibrary)(enginePath, platformInfo);
|
|
41
|
+
return `${import_fetch_engine.BinaryType.QueryEngineLibrary} ${QE.version().commit}`;
|
|
42
|
+
} else {
|
|
43
|
+
const { stdout } = await (0, import_chunk_JOIHHXR6.execa)(enginePath, ["--version"]);
|
|
44
|
+
return stdout;
|
|
45
|
+
}
|
|
33
46
|
}
|
|
34
47
|
function safeGetEngineVersion(enginePath, binaryName) {
|
|
35
48
|
return (0, import_chunk_5DBOS77Y.tryCatch2)(
|
|
@@ -26,44 +26,49 @@ 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_PXYIFYEC_exports = {};
|
|
30
|
+
__export(chunk_PXYIFYEC_exports, {
|
|
31
31
|
checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
|
|
32
|
+
checkUnsupportedSchemaEngineWasm: () => checkUnsupportedSchemaEngineWasm,
|
|
33
|
+
forbiddenCmdFlagWithSchemaEngineWasm: () => forbiddenCmdFlagWithSchemaEngineWasm,
|
|
32
34
|
forbiddenCmdWithDataProxyFlagMessage: () => forbiddenCmdWithDataProxyFlagMessage,
|
|
33
35
|
formatSchema: () => formatSchema,
|
|
34
36
|
getBinaryTargetForCurrentPlatform: () => import_get_platform2.getBinaryTargetForCurrentPlatform,
|
|
35
37
|
getGenerator: () => getGenerator,
|
|
36
38
|
getGenerators: () => getGenerators,
|
|
39
|
+
getNodeAPIName: () => import_get_platform2.getNodeAPIName,
|
|
37
40
|
knownBinaryTargets: () => knownBinaryTargets,
|
|
38
41
|
loadSchemaContext: () => loadSchemaContext,
|
|
39
42
|
processSchemaResult: () => processSchemaResult,
|
|
40
43
|
skipIndex: () => skipIndex
|
|
41
44
|
});
|
|
42
|
-
module.exports = __toCommonJS(
|
|
45
|
+
module.exports = __toCommonJS(chunk_PXYIFYEC_exports);
|
|
46
|
+
var import_chunk_X3P4J7WW = require("./chunk-X3P4J7WW.js");
|
|
43
47
|
var import_chunk_LRU47BGE = require("./chunk-LRU47BGE.js");
|
|
44
48
|
var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
|
|
45
|
-
var
|
|
46
|
-
var
|
|
49
|
+
var import_chunk_F2OZV76L = require("./chunk-F2OZV76L.js");
|
|
50
|
+
var import_chunk_RS2R7COT = require("./chunk-RS2R7COT.js");
|
|
47
51
|
var import_chunk_GXW4NTU2 = require("./chunk-GXW4NTU2.js");
|
|
48
52
|
var import_chunk_5FJ3MENK = require("./chunk-5FJ3MENK.js");
|
|
49
|
-
var
|
|
50
|
-
var
|
|
51
|
-
var
|
|
53
|
+
var import_chunk_7QC5VORA = require("./chunk-7QC5VORA.js");
|
|
54
|
+
var import_chunk_AX5N26KG = require("./chunk-AX5N26KG.js");
|
|
55
|
+
var import_chunk_46ABODUM = require("./chunk-46ABODUM.js");
|
|
56
|
+
var import_chunk_I6WLABB2 = require("./chunk-I6WLABB2.js");
|
|
52
57
|
var import_chunk_CRVLHWC5 = require("./chunk-CRVLHWC5.js");
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var
|
|
57
|
-
var
|
|
58
|
-
var
|
|
58
|
+
var import_chunk_T2UCYUSA = require("./chunk-T2UCYUSA.js");
|
|
59
|
+
var import_chunk_S4PA7OZ7 = require("./chunk-S4PA7OZ7.js");
|
|
60
|
+
var import_chunk_ZI7MNI3W = require("./chunk-ZI7MNI3W.js");
|
|
61
|
+
var import_chunk_E5VGO6SU = require("./chunk-E5VGO6SU.js");
|
|
62
|
+
var import_chunk_EYVG6XQS = require("./chunk-EYVG6XQS.js");
|
|
63
|
+
var import_chunk_EWDCQQHP = require("./chunk-EWDCQQHP.js");
|
|
64
|
+
var import_chunk_ZJWZK45Z = require("./chunk-ZJWZK45Z.js");
|
|
59
65
|
var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
|
|
60
66
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
|
61
67
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
62
68
|
var import_chunk_BPDMLM32 = require("./chunk-BPDMLM32.js");
|
|
63
69
|
var import_chunk_IOIAK7V7 = require("./chunk-IOIAK7V7.js");
|
|
64
|
-
var import_chunk_QSVWJ2S2 = require("./chunk-QSVWJ2S2.js");
|
|
65
|
-
var import_chunk_ZJWZK45Z = require("./chunk-ZJWZK45Z.js");
|
|
66
70
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
71
|
+
var import_chunk_BVJP43JS = require("./chunk-BVJP43JS.js");
|
|
67
72
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
|
68
73
|
var import_path = __toESM(require("path"));
|
|
69
74
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
@@ -72,11 +77,32 @@ var import_engines = require("@prisma/engines");
|
|
|
72
77
|
var import_get_platform = require("@prisma/get-platform");
|
|
73
78
|
var import_path2 = __toESM(require("path"));
|
|
74
79
|
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
|
+
}
|
|
75
101
|
var debug = (0, import_debug.default)("prisma:format");
|
|
76
102
|
async function formatSchema({ schemas }, inputFormattingOptions) {
|
|
77
103
|
if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
|
|
78
104
|
handleFormatPanic(() => {
|
|
79
|
-
|
|
105
|
+
import_chunk_EWDCQQHP.prismaSchemaWasm.debug_panic();
|
|
80
106
|
});
|
|
81
107
|
}
|
|
82
108
|
const defaultFormattingOptions = {
|
|
@@ -93,10 +119,10 @@ async function formatSchema({ schemas }, inputFormattingOptions) {
|
|
|
93
119
|
const { formattedMultipleSchemas, lintDiagnostics } = handleFormatPanic(() => {
|
|
94
120
|
const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas), documentFormattingParams);
|
|
95
121
|
const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
|
|
96
|
-
const lintDiagnostics2 = (0,
|
|
122
|
+
const lintDiagnostics2 = (0, import_chunk_ZI7MNI3W.lintSchema)({ schemas: formattedMultipleSchemas2 });
|
|
97
123
|
return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
|
|
98
124
|
});
|
|
99
|
-
const lintWarnings = (0,
|
|
125
|
+
const lintWarnings = (0, import_chunk_ZI7MNI3W.getLintWarningsAsText)(lintDiagnostics);
|
|
100
126
|
if (lintWarnings && import_chunk_ZJWZK45Z.logger_exports.should.warn()) {
|
|
101
127
|
console.warn(lintWarnings);
|
|
102
128
|
}
|
|
@@ -123,7 +149,7 @@ function handleFormatPanic(tryCb) {
|
|
|
123
149
|
}
|
|
124
150
|
}
|
|
125
151
|
function formatWasm(schema, documentFormattingParams) {
|
|
126
|
-
const formattedSchema =
|
|
152
|
+
const formattedSchema = import_chunk_EWDCQQHP.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
|
|
127
153
|
return formattedSchema;
|
|
128
154
|
}
|
|
129
155
|
async function loadSchemaContext({
|
|
@@ -131,46 +157,48 @@ async function loadSchemaContext({
|
|
|
131
157
|
schemaPathFromConfig,
|
|
132
158
|
schemaEngineConfig,
|
|
133
159
|
printLoadMessage = true,
|
|
160
|
+
ignoreEnvVarErrors = false,
|
|
134
161
|
allowNull = false,
|
|
135
162
|
schemaPathArgumentName = "--schema",
|
|
136
163
|
cwd = process.cwd()
|
|
137
164
|
} = {}) {
|
|
138
165
|
let schemaResult = null;
|
|
139
166
|
if (allowNull) {
|
|
140
|
-
schemaResult = await (0,
|
|
167
|
+
schemaResult = await (0, import_chunk_EYVG6XQS.getSchemaWithPathOptional)(schemaPathFromArg, schemaPathFromConfig, {
|
|
141
168
|
argumentName: schemaPathArgumentName,
|
|
142
169
|
cwd
|
|
143
170
|
});
|
|
144
171
|
if (!schemaResult) return null;
|
|
145
172
|
} else {
|
|
146
|
-
schemaResult = await (0,
|
|
173
|
+
schemaResult = await (0, import_chunk_EYVG6XQS.getSchemaWithPath)(schemaPathFromArg, schemaPathFromConfig, {
|
|
147
174
|
argumentName: schemaPathArgumentName,
|
|
148
175
|
cwd
|
|
149
176
|
});
|
|
150
177
|
}
|
|
151
|
-
return processSchemaResult({ schemaResult, schemaEngineConfig, printLoadMessage, cwd });
|
|
178
|
+
return processSchemaResult({ schemaResult, schemaEngineConfig, printLoadMessage, ignoreEnvVarErrors, cwd });
|
|
152
179
|
}
|
|
153
180
|
async function processSchemaResult({
|
|
154
181
|
schemaResult,
|
|
155
182
|
schemaEngineConfig,
|
|
156
183
|
printLoadMessage = true,
|
|
184
|
+
ignoreEnvVarErrors = false,
|
|
157
185
|
cwd = process.cwd()
|
|
158
186
|
}) {
|
|
159
187
|
const loadedFromPathForLogMessages = import_path.default.relative(cwd, schemaResult.schemaPath);
|
|
160
188
|
const schemaRootDir = schemaResult.schemaRootDir || cwd;
|
|
161
189
|
if (printLoadMessage) {
|
|
162
|
-
(0,
|
|
190
|
+
(0, import_chunk_EYVG6XQS.printSchemaLoadedMessage)(loadedFromPathForLogMessages);
|
|
163
191
|
}
|
|
164
|
-
const configFromPsl = await (0,
|
|
192
|
+
const configFromPsl = await (0, import_chunk_T2UCYUSA.getConfig)({ datamodel: schemaResult.schemas, ignoreEnvVarErrors });
|
|
165
193
|
const datasourceFromPsl = configFromPsl.datasources.at(0);
|
|
166
|
-
const primaryDatasource = (0, import_chunk_XKZ6CBLA.z)(schemaEngineConfig).with(
|
|
194
|
+
const primaryDatasource = (0, import_chunk_XKZ6CBLA.z)(schemaEngineConfig).with({ engine: "classic" }, ({ datasource }) => {
|
|
167
195
|
const { url, directUrl, shadowDatabaseUrl } = datasource;
|
|
168
196
|
const primaryDatasource2 = {
|
|
169
197
|
...datasourceFromPsl,
|
|
170
198
|
url: { fromEnvVar: null, value: url },
|
|
171
199
|
directUrl: directUrl ? { fromEnvVar: null, value: directUrl } : void 0,
|
|
172
200
|
shadowDatabaseUrl: shadowDatabaseUrl ? { fromEnvVar: null, value: shadowDatabaseUrl } : void 0,
|
|
173
|
-
[Symbol.for("
|
|
201
|
+
[Symbol.for("engine.classic")]: true
|
|
174
202
|
};
|
|
175
203
|
return primaryDatasource2;
|
|
176
204
|
}).otherwise(() => datasourceFromPsl);
|
|
@@ -194,7 +222,7 @@ function getPrimaryDatasourceDirectory(primaryDatasource) {
|
|
|
194
222
|
}
|
|
195
223
|
return null;
|
|
196
224
|
}
|
|
197
|
-
var import_p_map = (0, import_chunk_4VNS5WPM.__toESM)((0,
|
|
225
|
+
var import_p_map = (0, import_chunk_4VNS5WPM.__toESM)((0, import_chunk_BVJP43JS.require_p_map)());
|
|
198
226
|
var debug2 = (0, import_debug2.default)("prisma:getGenerators");
|
|
199
227
|
async function getGenerators(options) {
|
|
200
228
|
if (options.registry === void 0 && options.providerAliases !== void 0) {
|
|
@@ -219,27 +247,28 @@ async function getGenerators(options) {
|
|
|
219
247
|
binaryPathsOverride,
|
|
220
248
|
generatorNames = [],
|
|
221
249
|
postinstall,
|
|
250
|
+
noEngine,
|
|
222
251
|
allowNoModels = true,
|
|
223
252
|
typedSql
|
|
224
253
|
} = options;
|
|
225
|
-
const schemaContext = !options.schemaContext && schemaPath ? await loadSchemaContext({ schemaPathFromArg: schemaPath }) : options.schemaContext;
|
|
254
|
+
const schemaContext = !options.schemaContext && schemaPath ? await loadSchemaContext({ schemaPathFromArg: schemaPath, ignoreEnvVarErrors: true }) : options.schemaContext;
|
|
226
255
|
if (!schemaContext) {
|
|
227
256
|
throw new Error(`no schema provided for getGenerators`);
|
|
228
257
|
}
|
|
229
258
|
if (!schemaContext.primaryDatasource) {
|
|
230
|
-
throw new Error(
|
|
259
|
+
throw new Error(import_chunk_7QC5VORA.missingDatasource);
|
|
231
260
|
}
|
|
232
261
|
(0, import_chunk_5FJ3MENK.printConfigWarnings)(schemaContext.warnings);
|
|
233
262
|
const previewFeatures = (0, import_chunk_CRVLHWC5.extractPreviewFeatures)(schemaContext.generators);
|
|
234
|
-
const dmmf = await (0,
|
|
263
|
+
const dmmf = await (0, import_chunk_S4PA7OZ7.getDMMF)({
|
|
235
264
|
datamodel: schemaContext.schemaFiles,
|
|
236
265
|
previewFeatures
|
|
237
266
|
});
|
|
238
267
|
if (dmmf.datamodel.models.length === 0 && !allowNoModels) {
|
|
239
268
|
if (schemaContext.primaryDatasource.provider === "mongodb") {
|
|
240
|
-
throw new Error(
|
|
269
|
+
throw new Error(import_chunk_AX5N26KG.missingModelMessageMongoDB);
|
|
241
270
|
}
|
|
242
|
-
throw new Error(
|
|
271
|
+
throw new Error(import_chunk_AX5N26KG.missingModelMessage);
|
|
243
272
|
}
|
|
244
273
|
const generatorConfigs = filterGenerators(overrideGenerators || schemaContext.generators, generatorNames);
|
|
245
274
|
await validateGenerators(generatorConfigs);
|
|
@@ -282,7 +311,8 @@ You need to define \`output\` in the generator block in the schema file.`
|
|
|
282
311
|
fromEnvVar: null
|
|
283
312
|
};
|
|
284
313
|
}
|
|
285
|
-
const datamodel = (0,
|
|
314
|
+
const datamodel = (0, import_chunk_E5VGO6SU.mergeSchemas)({ schemas: schemaContext.schemaFiles });
|
|
315
|
+
const envPaths = await (0, import_chunk_46ABODUM.getEnvPaths)(schemaContext.schemaPath, { cwd: generatorConfig.output.value });
|
|
286
316
|
const options2 = {
|
|
287
317
|
datamodel,
|
|
288
318
|
datasources: schemaContext.datasources,
|
|
@@ -294,7 +324,9 @@ You need to define \`output\` in the generator block in the schema file.`
|
|
|
294
324
|
version: version2 || import_engines.enginesVersion,
|
|
295
325
|
// this version makes no sense anymore and should be ignored
|
|
296
326
|
postinstall,
|
|
327
|
+
noEngine,
|
|
297
328
|
allowNoModels,
|
|
329
|
+
envPaths,
|
|
298
330
|
typedSql
|
|
299
331
|
};
|
|
300
332
|
generatorInstance.setOptions(options2);
|
|
@@ -338,16 +370,18 @@ generator gen {
|
|
|
338
370
|
}
|
|
339
371
|
const generatorBinaryTargets = g.options?.generator?.binaryTargets;
|
|
340
372
|
if (generatorBinaryTargets && generatorBinaryTargets.length > 0) {
|
|
341
|
-
for (const
|
|
342
|
-
if (!neededVersions[neededVersion].binaryTargets.find((object) => object.value ===
|
|
343
|
-
neededVersions[neededVersion].binaryTargets.push(
|
|
373
|
+
for (const binaryTarget2 of generatorBinaryTargets) {
|
|
374
|
+
if (!neededVersions[neededVersion].binaryTargets.find((object) => object.value === binaryTarget2.value)) {
|
|
375
|
+
neededVersions[neededVersion].binaryTargets.push(binaryTarget2);
|
|
344
376
|
}
|
|
345
377
|
}
|
|
346
378
|
}
|
|
347
379
|
}
|
|
348
380
|
}
|
|
381
|
+
const queryEngineBinaryType = (0, import_engines.getCliQueryEngineBinaryType)();
|
|
382
|
+
const queryEngineType = (0, import_chunk_RS2R7COT.binaryTypeToEngineType)(queryEngineBinaryType);
|
|
349
383
|
debug2("neededVersions", JSON.stringify(neededVersions, null, 2));
|
|
350
|
-
const { binaryPathsByVersion } = await (0,
|
|
384
|
+
const { binaryPathsByVersion, binaryTarget } = await (0, import_chunk_F2OZV76L.getBinaryPathsByVersion)({
|
|
351
385
|
neededVersions,
|
|
352
386
|
// We're lazily computing the binary target here, to avoid printing the
|
|
353
387
|
// `Prisma failed to detect the libssl/openssl version to use` warning
|
|
@@ -368,6 +402,17 @@ generator gen {
|
|
|
368
402
|
const generatorBinaryPaths = (0, import_chunk_GXW4NTU2.pick)(binaryPaths ?? {}, generator.manifest.requiresEngines);
|
|
369
403
|
debug2({ generatorBinaryPaths });
|
|
370
404
|
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_S4PA7OZ7.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
|
+
}
|
|
371
416
|
}
|
|
372
417
|
}
|
|
373
418
|
return generators;
|
|
@@ -392,6 +437,17 @@ var oldToNewBinaryTargetsMapping = {
|
|
|
392
437
|
async function validateGenerators(generators) {
|
|
393
438
|
const binaryTarget = await (0, import_get_platform.getBinaryTargetForCurrentPlatform)();
|
|
394
439
|
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
|
+
}
|
|
395
451
|
if (generator.binaryTargets) {
|
|
396
452
|
const binaryTargets2 = generator.binaryTargets && generator.binaryTargets.length > 0 ? generator.binaryTargets : [{ fromEnvVar: null, value: "native" }];
|
|
397
453
|
const resolvedBinaryTargets = binaryTargets2.flatMap((object) => (0, import_chunk_IOIAK7V7.parseBinaryTargetsEnvValue)(object)).map((p) => p === "native" ? binaryTarget : p);
|
|
@@ -455,7 +511,7 @@ var forbiddenCmdWithDataProxyFlagMessage = (command) => `
|
|
|
455
511
|
Using an Accelerate URL is not supported for this CLI command ${(0, import_chunk_PG5FDKSF.green)(`prisma ${command}`)} yet.
|
|
456
512
|
Please use a direct connection to your database via the datasource \`directUrl\` setting.
|
|
457
513
|
|
|
458
|
-
More information about this limitation: ${(0,
|
|
514
|
+
More information about this limitation: ${(0, import_chunk_I6WLABB2.link)("https://pris.ly/d/accelerate-limitations")}
|
|
459
515
|
`;
|
|
460
516
|
function checkUnsupportedDataProxy({
|
|
461
517
|
cmd,
|
|
@@ -468,7 +524,7 @@ function checkUnsupportedDataProxy({
|
|
|
468
524
|
}
|
|
469
525
|
}
|
|
470
526
|
if (!schemaContext?.primaryDatasource) return;
|
|
471
|
-
const url = (0,
|
|
527
|
+
const url = (0, import_chunk_T2UCYUSA.resolveUrl)((0, import_chunk_T2UCYUSA.getEffectiveUrl)(schemaContext.primaryDatasource));
|
|
472
528
|
if (url?.startsWith("prisma://")) {
|
|
473
529
|
throw new Error(forbiddenCmdWithDataProxyFlagMessage(cmd));
|
|
474
530
|
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var chunk_PZMRR772_exports = {};
|
|
20
|
+
__export(chunk_PZMRR772_exports, {
|
|
21
|
+
loadEnvFile: () => loadEnvFile
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(chunk_PZMRR772_exports);
|
|
24
|
+
var import_chunk_46ABODUM = require("./chunk-46ABODUM.js");
|
|
25
|
+
var import_chunk_3FP46GUV = require("./chunk-3FP46GUV.js");
|
|
26
|
+
async function loadEnvFile({
|
|
27
|
+
schemaPath,
|
|
28
|
+
config,
|
|
29
|
+
printMessage = false
|
|
30
|
+
}) {
|
|
31
|
+
if (config.loadedFromFile) {
|
|
32
|
+
process.stderr.write(`Prisma config detected, skipping environment variable loading.
|
|
33
|
+
`);
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const envPaths = await (0, import_chunk_46ABODUM.getEnvPaths)(schemaPath);
|
|
37
|
+
const envData = (0, import_chunk_3FP46GUV.tryLoadEnvs)(envPaths, { conflictCheck: "error" });
|
|
38
|
+
if (printMessage && envData && envData.message) {
|
|
39
|
+
process.stderr.write(envData.message + "\n");
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -16,11 +16,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_QJ3QPUM5_exports = {};
|
|
20
|
+
__export(chunk_QJ3QPUM5_exports, {
|
|
21
21
|
version: () => version
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
25
|
-
var packageJson = (0,
|
|
23
|
+
module.exports = __toCommonJS(chunk_QJ3QPUM5_exports);
|
|
24
|
+
var import_chunk_CCLAMTCA = require("./chunk-CCLAMTCA.js");
|
|
25
|
+
var packageJson = (0, import_chunk_CCLAMTCA.require_package)();
|
|
26
26
|
var version = packageJson.version;
|
|
@@ -16,15 +16,21 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_RS2R7COT_exports = {};
|
|
20
|
+
__export(chunk_RS2R7COT_exports, {
|
|
21
21
|
binaryTypeToEngineType: () => binaryTypeToEngineType
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_RS2R7COT_exports);
|
|
24
24
|
var import_fetch_engine = require("@prisma/fetch-engine");
|
|
25
25
|
function binaryTypeToEngineType(binaryType) {
|
|
26
26
|
if (binaryType === import_fetch_engine.BinaryType.SchemaEngineBinary) {
|
|
27
27
|
return "schemaEngine";
|
|
28
28
|
}
|
|
29
|
+
if (binaryType === import_fetch_engine.BinaryType.QueryEngineLibrary) {
|
|
30
|
+
return "libqueryEngine";
|
|
31
|
+
}
|
|
32
|
+
if (binaryType === import_fetch_engine.BinaryType.QueryEngineBinary) {
|
|
33
|
+
return "queryEngine";
|
|
34
|
+
}
|
|
29
35
|
throw new Error(`Could not convert binary type ${binaryType}`);
|
|
30
36
|
}
|
|
@@ -26,16 +26,16 @@ 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_S4PA7OZ7_exports = {};
|
|
30
|
+
__export(chunk_S4PA7OZ7_exports, {
|
|
31
31
|
GetDmmfError: () => GetDmmfError,
|
|
32
32
|
getDMMF: () => getDMMF
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
35
|
-
var
|
|
34
|
+
module.exports = __toCommonJS(chunk_S4PA7OZ7_exports);
|
|
35
|
+
var import_chunk_TZJROXB3 = require("./chunk-TZJROXB3.js");
|
|
36
36
|
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
|
37
|
-
var
|
|
38
|
-
var
|
|
37
|
+
var import_chunk_O2AHE2LQ = require("./chunk-O2AHE2LQ.js");
|
|
38
|
+
var import_chunk_EWDCQQHP = require("./chunk-EWDCQQHP.js");
|
|
39
39
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
|
40
40
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
|
41
41
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
@@ -58,25 +58,25 @@ ${detailsHeader} ${message}`;
|
|
|
58
58
|
}).exhaustive();
|
|
59
59
|
const errorMessageWithContext = `${constructedErrorMessage}
|
|
60
60
|
[Context: getDmmf]`;
|
|
61
|
-
super((0,
|
|
61
|
+
super((0, import_chunk_O2AHE2LQ.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
|
62
62
|
this.name = "GetDmmfError";
|
|
63
63
|
}
|
|
64
64
|
};
|
|
65
65
|
async function getDMMF(options) {
|
|
66
|
-
const debugErrorType = (0,
|
|
66
|
+
const debugErrorType = (0, import_chunk_TZJROXB3.createDebugErrorType)(debug, "getDmmfWasm");
|
|
67
67
|
debug(`Using getDmmf Wasm`);
|
|
68
68
|
const dmmfPipeline = (0, import_function.pipe)(
|
|
69
69
|
(0, import_chunk_5DBOS77Y.tryCatch)(
|
|
70
70
|
() => {
|
|
71
71
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
|
|
72
72
|
debug("Triggering a Rust panic...");
|
|
73
|
-
|
|
73
|
+
import_chunk_EWDCQQHP.prismaSchemaWasm.debug_panic();
|
|
74
74
|
}
|
|
75
75
|
const params = JSON.stringify({
|
|
76
76
|
prismaSchema: options.datamodel,
|
|
77
77
|
noColor: Boolean(process.env.NO_COLOR)
|
|
78
78
|
});
|
|
79
|
-
const data =
|
|
79
|
+
const data = import_chunk_EWDCQQHP.prismaSchemaWasm.get_dmmf(params);
|
|
80
80
|
return data;
|
|
81
81
|
},
|
|
82
82
|
(e) => ({
|
|
@@ -124,7 +124,7 @@ async function getDMMF(options) {
|
|
|
124
124
|
return panic;
|
|
125
125
|
}
|
|
126
126
|
const errorOutput = e.error.message;
|
|
127
|
-
return new GetDmmfError((0,
|
|
127
|
+
return new GetDmmfError((0, import_chunk_TZJROXB3.parseQueryEngineError)({ errorOutput, reason: e.reason }));
|
|
128
128
|
}).with({ type: "parse-json" }, (e) => {
|
|
129
129
|
debugErrorType(e);
|
|
130
130
|
return new GetDmmfError({ _tag: "unparsed", message: e.error.message, reason: e.reason });
|
|
@@ -26,20 +26,20 @@ 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_SOKSKSEX_exports = {};
|
|
30
|
+
__export(chunk_SOKSKSEX_exports, {
|
|
31
31
|
GetConfigError: () => GetConfigError,
|
|
32
32
|
getConfig: () => getConfig,
|
|
33
33
|
getDirectUrl: () => getDirectUrl,
|
|
34
34
|
getEffectiveUrl: () => getEffectiveUrl,
|
|
35
35
|
resolveUrl: () => resolveUrl
|
|
36
36
|
});
|
|
37
|
-
module.exports = __toCommonJS(
|
|
38
|
-
var
|
|
39
|
-
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
|
37
|
+
module.exports = __toCommonJS(chunk_SOKSKSEX_exports);
|
|
38
|
+
var import_chunk_TZJROXB3 = require("./chunk-TZJROXB3.js");
|
|
40
39
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
|
41
|
-
var
|
|
42
|
-
var
|
|
40
|
+
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
|
41
|
+
var import_chunk_JTS4UPHJ = require("./chunk-JTS4UPHJ.js");
|
|
42
|
+
var import_chunk_FHZ5QJLR = require("./chunk-FHZ5QJLR.js");
|
|
43
43
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
|
44
44
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
|
45
45
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
@@ -64,7 +64,7 @@ ${detailsHeader} ${message}`;
|
|
|
64
64
|
}).exhaustive();
|
|
65
65
|
const errorMessageWithContext = `${constructedErrorMessage}
|
|
66
66
|
[Context: getConfig]`;
|
|
67
|
-
super((0,
|
|
67
|
+
super((0, import_chunk_JTS4UPHJ.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
|
68
68
|
this.name = "GetConfigError";
|
|
69
69
|
}
|
|
70
70
|
};
|
|
@@ -82,17 +82,23 @@ function resolveUrl(envValue) {
|
|
|
82
82
|
return urlFromValue ?? urlEnvVarValue;
|
|
83
83
|
}
|
|
84
84
|
async function getConfig(options) {
|
|
85
|
-
const debugErrorType = (0,
|
|
85
|
+
const debugErrorType = (0, import_chunk_TZJROXB3.createDebugErrorType)(debug, "getConfigWasm");
|
|
86
86
|
debug(`Using getConfig Wasm`);
|
|
87
87
|
const configEither = (0, import_function.pipe)(
|
|
88
88
|
(0, import_chunk_5DBOS77Y.tryCatch)(
|
|
89
89
|
() => {
|
|
90
90
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_CONFIG) {
|
|
91
91
|
debug("Triggering a Rust panic...");
|
|
92
|
-
|
|
92
|
+
import_chunk_FHZ5QJLR.prismaSchemaWasm.debug_panic();
|
|
93
93
|
}
|
|
94
|
-
const params = JSON.stringify({
|
|
95
|
-
|
|
94
|
+
const params = JSON.stringify({
|
|
95
|
+
prismaSchema: options.datamodel,
|
|
96
|
+
datasourceOverrides: {},
|
|
97
|
+
ignoreEnvVarErrors: options.ignoreEnvVarErrors ?? false,
|
|
98
|
+
env: process.env
|
|
99
|
+
});
|
|
100
|
+
const data = import_chunk_FHZ5QJLR.prismaSchemaWasm.get_config(params);
|
|
101
|
+
return data;
|
|
96
102
|
},
|
|
97
103
|
(e) => ({
|
|
98
104
|
type: "wasm-error",
|
|
@@ -150,12 +156,12 @@ async function getConfig(options) {
|
|
|
150
156
|
return panic;
|
|
151
157
|
}
|
|
152
158
|
const errorOutput = e.error.message;
|
|
153
|
-
return new GetConfigError((0,
|
|
159
|
+
return new GetConfigError((0, import_chunk_TZJROXB3.parseQueryEngineError)({ errorOutput, reason: e.reason }));
|
|
154
160
|
}).with({ type: "validation-error" }, (e) => {
|
|
155
161
|
return new GetConfigError({
|
|
156
162
|
_tag: "parsed",
|
|
157
163
|
errorCode: SCHEMA_VALIDATION_ERROR_CODE,
|
|
158
|
-
reason: (0,
|
|
164
|
+
reason: (0, import_chunk_TZJROXB3.createSchemaValidationError)(e.reason),
|
|
159
165
|
message: formatErrors(e.error)
|
|
160
166
|
});
|
|
161
167
|
}).otherwise((e) => {
|