@prisma/internals 6.1.0-dev.16 → 6.1.0-dev.17
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-H3T4L34H.js → chunk-25RJ7YTB.js} +88 -83
- package/dist/{chunk-S4LINK5Y.js → chunk-2XRDQCIA.js} +5 -5
- package/dist/{chunk-2DXAGCPS.js → chunk-3DMEILBC.js} +11 -11
- package/dist/{chunk-LATZTP6I.js → chunk-6VQNACCJ.js} +5 -5
- package/dist/{chunk-NM5GRZUZ.js → chunk-6Z4G2HUQ.js} +14 -14
- package/dist/{chunk-JTG7OZIV.js → chunk-7RQQQMVJ.js} +5 -5
- package/dist/{chunk-S3RSLT5E.js → chunk-B635PHDW.js} +5 -5
- package/dist/{chunk-PC46MJ4M.js → chunk-BTVQXJCY.js} +15 -15
- package/dist/{chunk-V7Z7JKVU.js → chunk-CBT2JDO2.js} +15 -15
- package/dist/{chunk-I4467NNA.js → chunk-CXEMRKV4.js} +6 -6
- package/dist/{chunk-ZARJI3YA.js → chunk-DKYVVZJS.js} +5 -5
- package/dist/{chunk-V2VWODV3.js → chunk-EKBX4J6O.js} +5 -5
- package/dist/{chunk-7OIRG4DY.js → chunk-HUPMOQXK.js} +13 -13
- package/dist/{chunk-CVDEO2SW.js → chunk-I6ARU6UV.js} +27 -27
- package/dist/{chunk-OTGIAUDE.js → chunk-IJZBI63R.js} +27 -27
- package/dist/{chunk-2PP7BHKH.js → chunk-JVNF5V6D.js} +5 -5
- package/dist/{chunk-DUSBGGO7.js → chunk-MGFN2DTW.js} +14 -14
- package/dist/{chunk-J4MA2JIK.js → chunk-N6K7M2HZ.js} +5 -5
- package/dist/{chunk-PDG6GFQR.js → chunk-N75APZYT.js} +5 -5
- package/dist/{chunk-SM6BW5WS.js → chunk-NAT4O7NW.js} +5 -5
- package/dist/{chunk-Z75GVIRM.js → chunk-NAXNJDRZ.js} +5 -5
- package/dist/{chunk-RFYKY4ZX.js → chunk-NO5X2ADB.js} +13 -13
- package/dist/{chunk-SLBBRUQS.js → chunk-QTXYAZFX.js} +5 -5
- package/dist/{chunk-LSTUJ7L4.js → chunk-RHPV7ERN.js} +5 -5
- package/dist/{chunk-T2RTHBYQ.js → chunk-UCB5JX3B.js} +4 -4
- package/dist/{chunk-HPF5G47V.js → chunk-UPIULDLZ.js} +5 -5
- package/dist/{chunk-EPKZPJC5.js → chunk-V5LBZC3L.js} +14 -14
- package/dist/{chunk-BK7GVFPW.js → chunk-ZHIIE6KR.js} +14 -14
- package/dist/cli/checkUnsupportedDataProxy.js +20 -20
- package/dist/cli/getSchema.js +25 -25
- package/dist/cli/hashes.js +20 -20
- package/dist/engine-commands/errorHelpers.js +4 -4
- package/dist/engine-commands/formatSchema.js +19 -19
- package/dist/engine-commands/getConfig.js +12 -12
- package/dist/engine-commands/getDmmf.js +9 -9
- package/dist/engine-commands/getEngineVersion.js +6 -6
- package/dist/engine-commands/getEnginesMetaInfo.js +8 -8
- package/dist/engine-commands/index.js +30 -30
- package/dist/engine-commands/lintSchema.js +8 -8
- package/dist/engine-commands/mergeSchemas.js +9 -9
- package/dist/engine-commands/queryEngineCommons.js +6 -6
- package/dist/engine-commands/validate.js +9 -9
- package/dist/get-generators/generatorResolvers/generatorResolvers.js +19 -19
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +19 -19
- package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +20 -20
- package/dist/get-generators/getGenerators.js +22 -22
- package/dist/index.js +52 -52
- package/dist/sendPanic.js +19 -19
- package/dist/utils/cloudflareD1.js +3 -3
- package/dist/utils/getEnvPaths.js +19 -19
- package/dist/utils/getGitHubIssueUrl.js +4 -4
- package/dist/utils/getVersionFromPackageJson.js +3 -3
- package/dist/utils/handleEngineLoadingErrors.js +3 -3
- package/dist/utils/handlePanic.js +19 -19
- package/dist/utils/load.js +4 -4
- package/dist/utils/loadEnvFile.js +19 -19
- package/dist/wasm.js +4 -4
- package/package.json +8 -8
@@ -26,22 +26,22 @@ 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_BTVQXJCY_exports = {};
|
30
|
+
__export(chunk_BTVQXJCY_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(
|
37
|
+
module.exports = __toCommonJS(chunk_BTVQXJCY_exports);
|
38
38
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
39
|
-
var
|
39
|
+
var import_chunk_CXEMRKV4 = require("./chunk-CXEMRKV4.js");
|
40
40
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
41
|
-
var
|
41
|
+
var import_chunk_6VQNACCJ = require("./chunk-6VQNACCJ.js");
|
42
42
|
var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
|
43
|
-
var
|
44
|
-
var
|
43
|
+
var import_chunk_25RJ7YTB = require("./chunk-25RJ7YTB.js");
|
44
|
+
var import_chunk_NAT4O7NW = require("./chunk-NAT4O7NW.js");
|
45
45
|
var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
|
46
46
|
var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
|
47
47
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
@@ -53,7 +53,7 @@ var debug = (0, import_debug.default)("prisma:getConfig");
|
|
53
53
|
var SCHEMA_VALIDATION_ERROR_CODE = "P1012";
|
54
54
|
var GetConfigError = class extends Error {
|
55
55
|
constructor(params) {
|
56
|
-
const constructedErrorMessage = (0,
|
56
|
+
const constructedErrorMessage = (0, import_chunk_25RJ7YTB.z)(params).with({ _tag: "parsed" }, ({ errorCode, message, reason }) => {
|
57
57
|
const errorCodeMessage = errorCode ? `Error code: ${errorCode}` : "";
|
58
58
|
return `${reason}
|
59
59
|
${errorCodeMessage}
|
@@ -65,7 +65,7 @@ ${detailsHeader} ${message}`;
|
|
65
65
|
}).exhaustive();
|
66
66
|
const errorMessageWithContext = `${constructedErrorMessage}
|
67
67
|
[Context: getConfig]`;
|
68
|
-
super((0,
|
68
|
+
super((0, import_chunk_6VQNACCJ.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
69
69
|
this.name = "GetConfigError";
|
70
70
|
}
|
71
71
|
};
|
@@ -83,14 +83,14 @@ function resolveUrl(envValue) {
|
|
83
83
|
return urlFromValue ?? urlEnvVarValue;
|
84
84
|
}
|
85
85
|
async function getConfig(options) {
|
86
|
-
const debugErrorType = (0,
|
86
|
+
const debugErrorType = (0, import_chunk_CXEMRKV4.createDebugErrorType)(debug, "getConfigWasm");
|
87
87
|
debug(`Using getConfig Wasm`);
|
88
88
|
const configEither = (0, import_function.pipe)(
|
89
89
|
(0, import_chunk_7MD6344A.tryCatch)(
|
90
90
|
() => {
|
91
91
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_CONFIG) {
|
92
92
|
debug("Triggering a Rust panic...");
|
93
|
-
|
93
|
+
import_chunk_NAT4O7NW.prismaSchemaWasm.debug_panic();
|
94
94
|
}
|
95
95
|
const params = JSON.stringify({
|
96
96
|
prismaSchema: options.datamodel,
|
@@ -98,7 +98,7 @@ async function getConfig(options) {
|
|
98
98
|
ignoreEnvVarErrors: options.ignoreEnvVarErrors ?? false,
|
99
99
|
env: process.env
|
100
100
|
});
|
101
|
-
const data =
|
101
|
+
const data = import_chunk_NAT4O7NW.prismaSchemaWasm.get_config(params);
|
102
102
|
return data;
|
103
103
|
},
|
104
104
|
(e) => ({
|
@@ -140,7 +140,7 @@ async function getConfig(options) {
|
|
140
140
|
}
|
141
141
|
return Promise.resolve(data);
|
142
142
|
}
|
143
|
-
const error = (0,
|
143
|
+
const error = (0, import_chunk_25RJ7YTB.z)(configEither.left).with({ type: "wasm-error" }, (e) => {
|
144
144
|
debugErrorType(e);
|
145
145
|
if ((0, import_chunk_A4QWQE3W.isWasmPanic)(e.error)) {
|
146
146
|
const { message, stack } = (0, import_chunk_A4QWQE3W.getWasmError)(e.error);
|
@@ -160,12 +160,12 @@ async function getConfig(options) {
|
|
160
160
|
return panic;
|
161
161
|
}
|
162
162
|
const errorOutput = e.error.message;
|
163
|
-
return new GetConfigError((0,
|
163
|
+
return new GetConfigError((0, import_chunk_CXEMRKV4.parseQueryEngineError)({ errorOutput, reason: e.reason }));
|
164
164
|
}).with({ type: "validation-error" }, (e) => {
|
165
165
|
return new GetConfigError({
|
166
166
|
_tag: "parsed",
|
167
167
|
errorCode: SCHEMA_VALIDATION_ERROR_CODE,
|
168
|
-
reason: (0,
|
168
|
+
reason: (0, import_chunk_CXEMRKV4.createSchemaValidationError)(e.reason),
|
169
169
|
message: formatErrors(e.error)
|
170
170
|
});
|
171
171
|
}).otherwise((e) => {
|
@@ -26,22 +26,22 @@ 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_CBT2JDO2_exports = {};
|
30
|
+
__export(chunk_CBT2JDO2_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(
|
37
|
+
module.exports = __toCommonJS(chunk_CBT2JDO2_exports);
|
38
38
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
39
|
-
var
|
39
|
+
var import_chunk_CXEMRKV4 = require("./chunk-CXEMRKV4.js");
|
40
40
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
41
|
-
var
|
41
|
+
var import_chunk_B635PHDW = require("./chunk-B635PHDW.js");
|
42
42
|
var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
|
43
|
-
var
|
44
|
-
var
|
43
|
+
var import_chunk_25RJ7YTB = require("./chunk-25RJ7YTB.js");
|
44
|
+
var import_chunk_RHPV7ERN = require("./chunk-RHPV7ERN.js");
|
45
45
|
var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
|
46
46
|
var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
|
47
47
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
@@ -53,7 +53,7 @@ var debug = (0, import_debug.default)("prisma:getConfig");
|
|
53
53
|
var SCHEMA_VALIDATION_ERROR_CODE = "P1012";
|
54
54
|
var GetConfigError = class extends Error {
|
55
55
|
constructor(params) {
|
56
|
-
const constructedErrorMessage = (0,
|
56
|
+
const constructedErrorMessage = (0, import_chunk_25RJ7YTB.z)(params).with({ _tag: "parsed" }, ({ errorCode, message, reason }) => {
|
57
57
|
const errorCodeMessage = errorCode ? `Error code: ${errorCode}` : "";
|
58
58
|
return `${reason}
|
59
59
|
${errorCodeMessage}
|
@@ -65,7 +65,7 @@ ${detailsHeader} ${message}`;
|
|
65
65
|
}).exhaustive();
|
66
66
|
const errorMessageWithContext = `${constructedErrorMessage}
|
67
67
|
[Context: getConfig]`;
|
68
|
-
super((0,
|
68
|
+
super((0, import_chunk_B635PHDW.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
69
69
|
this.name = "GetConfigError";
|
70
70
|
}
|
71
71
|
};
|
@@ -83,14 +83,14 @@ function resolveUrl(envValue) {
|
|
83
83
|
return urlFromValue ?? urlEnvVarValue;
|
84
84
|
}
|
85
85
|
async function getConfig(options) {
|
86
|
-
const debugErrorType = (0,
|
86
|
+
const debugErrorType = (0, import_chunk_CXEMRKV4.createDebugErrorType)(debug, "getConfigWasm");
|
87
87
|
debug(`Using getConfig Wasm`);
|
88
88
|
const configEither = (0, import_function.pipe)(
|
89
89
|
(0, import_chunk_7MD6344A.tryCatch)(
|
90
90
|
() => {
|
91
91
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_CONFIG) {
|
92
92
|
debug("Triggering a Rust panic...");
|
93
|
-
|
93
|
+
import_chunk_RHPV7ERN.prismaSchemaWasm.debug_panic();
|
94
94
|
}
|
95
95
|
const params = JSON.stringify({
|
96
96
|
prismaSchema: options.datamodel,
|
@@ -98,7 +98,7 @@ async function getConfig(options) {
|
|
98
98
|
ignoreEnvVarErrors: options.ignoreEnvVarErrors ?? false,
|
99
99
|
env: process.env
|
100
100
|
});
|
101
|
-
const data =
|
101
|
+
const data = import_chunk_RHPV7ERN.prismaSchemaWasm.get_config(params);
|
102
102
|
return data;
|
103
103
|
},
|
104
104
|
(e) => ({
|
@@ -140,7 +140,7 @@ async function getConfig(options) {
|
|
140
140
|
}
|
141
141
|
return Promise.resolve(data);
|
142
142
|
}
|
143
|
-
const error = (0,
|
143
|
+
const error = (0, import_chunk_25RJ7YTB.z)(configEither.left).with({ type: "wasm-error" }, (e) => {
|
144
144
|
debugErrorType(e);
|
145
145
|
if ((0, import_chunk_A4QWQE3W.isWasmPanic)(e.error)) {
|
146
146
|
const { message, stack } = (0, import_chunk_A4QWQE3W.getWasmError)(e.error);
|
@@ -160,12 +160,12 @@ async function getConfig(options) {
|
|
160
160
|
return panic;
|
161
161
|
}
|
162
162
|
const errorOutput = e.error.message;
|
163
|
-
return new GetConfigError((0,
|
163
|
+
return new GetConfigError((0, import_chunk_CXEMRKV4.parseQueryEngineError)({ errorOutput, reason: e.reason }));
|
164
164
|
}).with({ type: "validation-error" }, (e) => {
|
165
165
|
return new GetConfigError({
|
166
166
|
_tag: "parsed",
|
167
167
|
errorCode: SCHEMA_VALIDATION_ERROR_CODE,
|
168
|
-
reason: (0,
|
168
|
+
reason: (0, import_chunk_CXEMRKV4.createSchemaValidationError)(e.reason),
|
169
169
|
message: formatErrors(e.error)
|
170
170
|
});
|
171
171
|
}).otherwise((e) => {
|
@@ -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_CXEMRKV4_exports = {};
|
30
|
+
__export(chunk_CXEMRKV4_exports, {
|
31
31
|
createDebugErrorType: () => createDebugErrorType,
|
32
32
|
createSchemaValidationError: () => createSchemaValidationError,
|
33
33
|
parseQueryEngineError: () => parseQueryEngineError,
|
34
34
|
unlinkTempDatamodelPath: () => unlinkTempDatamodelPath
|
35
35
|
});
|
36
|
-
module.exports = __toCommonJS(
|
36
|
+
module.exports = __toCommonJS(chunk_CXEMRKV4_exports);
|
37
37
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
38
38
|
var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
|
39
|
-
var
|
39
|
+
var import_chunk_25RJ7YTB = require("./chunk-25RJ7YTB.js");
|
40
40
|
var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
|
41
41
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
42
42
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
@@ -72,12 +72,12 @@ function parseQueryEngineError({ errorOutput, reason }) {
|
|
72
72
|
),
|
73
73
|
(0, import_chunk_7MD6344A.map)((errorOutputAsJSON) => {
|
74
74
|
const defaultMessage = (0, import_chunk_PG5FDKSF.red)((0, import_chunk_PG5FDKSF.bold)((0, import_chunk_C47SCASR.relativizePathInPSLError)(errorOutputAsJSON.message)));
|
75
|
-
const getConfigErrorInit = (0,
|
75
|
+
const getConfigErrorInit = (0, import_chunk_25RJ7YTB.z)(errorOutputAsJSON).with({ error_code: "P1012" }, (eJSON) => {
|
76
76
|
return {
|
77
77
|
reason: createSchemaValidationError(reason),
|
78
78
|
errorCode: eJSON.error_code
|
79
79
|
};
|
80
|
-
}).with({ error_code:
|
80
|
+
}).with({ error_code: import_chunk_25RJ7YTB.N.string }, (eJSON) => {
|
81
81
|
return {
|
82
82
|
reason,
|
83
83
|
errorCode: eJSON.error_code
|
@@ -16,21 +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_DKYVVZJS_exports = {};
|
20
|
+
__export(chunk_DKYVVZJS_exports, {
|
21
21
|
getLintWarnings: () => getLintWarnings,
|
22
22
|
getLintWarningsAsText: () => getLintWarningsAsText,
|
23
23
|
handleLintPanic: () => handleLintPanic,
|
24
24
|
lintSchema: () => lintSchema,
|
25
25
|
warningToString: () => warningToString
|
26
26
|
});
|
27
|
-
module.exports = __toCommonJS(
|
27
|
+
module.exports = __toCommonJS(chunk_DKYVVZJS_exports);
|
28
28
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
29
|
-
var
|
29
|
+
var import_chunk_RHPV7ERN = require("./chunk-RHPV7ERN.js");
|
30
30
|
var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
|
31
31
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
32
32
|
function lintSchema({ schemas }) {
|
33
|
-
const lintResult =
|
33
|
+
const lintResult = import_chunk_RHPV7ERN.prismaSchemaWasm.lint(JSON.stringify(schemas));
|
34
34
|
const lintDiagnostics = JSON.parse(lintResult);
|
35
35
|
return lintDiagnostics;
|
36
36
|
}
|
@@ -16,13 +16,13 @@ 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_EKBX4J6O_exports = {};
|
20
|
+
__export(chunk_EKBX4J6O_exports, {
|
21
21
|
getEngineVersion: () => getEngineVersion,
|
22
22
|
safeGetEngineVersion: () => safeGetEngineVersion
|
23
23
|
});
|
24
|
-
module.exports = __toCommonJS(
|
25
|
-
var
|
24
|
+
module.exports = __toCommonJS(chunk_EKBX4J6O_exports);
|
25
|
+
var import_chunk_2XRDQCIA = require("./chunk-2XRDQCIA.js");
|
26
26
|
var import_chunk_7XNZDY2V = require("./chunk-7XNZDY2V.js");
|
27
27
|
var import_chunk_QJZIYUVB = require("./chunk-QJZIYUVB.js");
|
28
28
|
var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
|
@@ -39,7 +39,7 @@ async function getEngineVersion(enginePath, binaryName) {
|
|
39
39
|
const platformInfo = await (0, import_get_platform.getPlatformInfo)();
|
40
40
|
if (binaryName === import_fetch_engine.BinaryType.QueryEngineLibrary) {
|
41
41
|
(0, import_get_platform.assertNodeAPISupported)();
|
42
|
-
const QE = (0,
|
42
|
+
const QE = (0, import_chunk_2XRDQCIA.loadLibrary)(enginePath, platformInfo);
|
43
43
|
return `${import_fetch_engine.BinaryType.QueryEngineLibrary} ${QE.version().commit}`;
|
44
44
|
} else {
|
45
45
|
const { stdout } = await (0, import_execa.default)(enginePath, ["--version"]);
|
@@ -26,19 +26,19 @@ 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_HUPMOQXK_exports = {};
|
30
|
+
__export(chunk_HUPMOQXK_exports, {
|
31
31
|
MergeSchemasError: () => MergeSchemasError,
|
32
32
|
mergeSchemas: () => mergeSchemas
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
34
|
+
module.exports = __toCommonJS(chunk_HUPMOQXK_exports);
|
35
35
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
36
|
-
var
|
36
|
+
var import_chunk_CXEMRKV4 = require("./chunk-CXEMRKV4.js");
|
37
37
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
38
|
-
var
|
38
|
+
var import_chunk_6VQNACCJ = require("./chunk-6VQNACCJ.js");
|
39
39
|
var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
|
40
|
-
var
|
41
|
-
var
|
40
|
+
var import_chunk_25RJ7YTB = require("./chunk-25RJ7YTB.js");
|
41
|
+
var import_chunk_NAT4O7NW = require("./chunk-NAT4O7NW.js");
|
42
42
|
var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
|
43
43
|
var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
|
44
44
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
@@ -48,7 +48,7 @@ var import_function = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_PFLLVW
|
|
48
48
|
var debug = (0, import_debug.default)("prisma:mergeSchemas");
|
49
49
|
var MergeSchemasError = class extends Error {
|
50
50
|
constructor(params) {
|
51
|
-
const constructedErrorMessage = (0,
|
51
|
+
const constructedErrorMessage = (0, import_chunk_25RJ7YTB.z)(params).with({ _tag: "parsed" }, ({ errorCode, message, reason }) => {
|
52
52
|
const errorCodeMessage = errorCode ? `Error code: ${errorCode}` : "";
|
53
53
|
return `${reason}
|
54
54
|
${errorCodeMessage}
|
@@ -60,12 +60,12 @@ ${detailsHeader} ${message}`;
|
|
60
60
|
}).exhaustive();
|
61
61
|
const errorMessageWithContext = `${constructedErrorMessage}
|
62
62
|
[Context: mergeSchemas]`;
|
63
|
-
super((0,
|
63
|
+
super((0, import_chunk_6VQNACCJ.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
64
64
|
this.name = "MergeSchemasError";
|
65
65
|
}
|
66
66
|
};
|
67
67
|
function mergeSchemas(options) {
|
68
|
-
const debugErrorType = (0,
|
68
|
+
const debugErrorType = (0, import_chunk_CXEMRKV4.createDebugErrorType)(debug, "mergeSchemasWasm");
|
69
69
|
debug(`Using mergeSchemas Wasm`);
|
70
70
|
const mergeSchemasEither = (0, import_function.pipe)(
|
71
71
|
(0, import_chunk_7MD6344A.tryCatch)(
|
@@ -73,7 +73,7 @@ function mergeSchemas(options) {
|
|
73
73
|
const params = JSON.stringify({
|
74
74
|
schema: options.schemas
|
75
75
|
});
|
76
|
-
return
|
76
|
+
return import_chunk_NAT4O7NW.prismaSchemaWasm.merge_schemas(params);
|
77
77
|
},
|
78
78
|
(e) => ({
|
79
79
|
type: "wasm-error",
|
@@ -85,7 +85,7 @@ function mergeSchemas(options) {
|
|
85
85
|
if ((0, import_chunk_7MD6344A.isRight)(mergeSchemasEither)) {
|
86
86
|
return mergeSchemasEither.right;
|
87
87
|
}
|
88
|
-
const error = (0,
|
88
|
+
const error = (0, import_chunk_25RJ7YTB.z)(mergeSchemasEither.left).with({ type: "wasm-error" }, (e) => {
|
89
89
|
debugErrorType(e);
|
90
90
|
console.error("");
|
91
91
|
if ((0, import_chunk_A4QWQE3W.isWasmPanic)(e.error)) {
|
@@ -108,7 +108,7 @@ function mergeSchemas(options) {
|
|
108
108
|
return panic;
|
109
109
|
}
|
110
110
|
const errorOutput = e.error.message;
|
111
|
-
return new MergeSchemasError((0,
|
111
|
+
return new MergeSchemasError((0, import_chunk_CXEMRKV4.parseQueryEngineError)({ errorOutput, reason: e.reason }));
|
112
112
|
}).exhaustive();
|
113
113
|
throw error;
|
114
114
|
}
|
@@ -26,8 +26,8 @@ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__g
|
|
26
26
|
mod
|
27
27
|
));
|
28
28
|
var __toCommonJS2 = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
var
|
30
|
-
__export2(
|
29
|
+
var chunk_I6ARU6UV_exports = {};
|
30
|
+
__export2(chunk_I6ARU6UV_exports, {
|
31
31
|
checkTypeScriptVersion: () => checkTypeScriptVersion,
|
32
32
|
checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
|
33
33
|
debug: () => debug5,
|
@@ -55,7 +55,7 @@ __export2(chunk_CVDEO2SW_exports, {
|
|
55
55
|
sendPanic: () => sendPanic,
|
56
56
|
skipIndex: () => skipIndex
|
57
57
|
});
|
58
|
-
module.exports = __toCommonJS2(
|
58
|
+
module.exports = __toCommonJS2(chunk_I6ARU6UV_exports);
|
59
59
|
var import_chunk_77IC3DNO = require("./chunk-77IC3DNO.js");
|
60
60
|
var import_chunk_MGZOEY6N = require("./chunk-MGZOEY6N.js");
|
61
61
|
var import_chunk_S57RMXZW = require("./chunk-S57RMXZW.js");
|
@@ -76,17 +76,17 @@ var import_chunk_2MWIMEFK = require("./chunk-2MWIMEFK.js");
|
|
76
76
|
var import_chunk_L6GBFCXG = require("./chunk-L6GBFCXG.js");
|
77
77
|
var import_chunk_KDHESRKE = require("./chunk-KDHESRKE.js");
|
78
78
|
var import_chunk_J77ZIDXB = require("./chunk-J77ZIDXB.js");
|
79
|
-
var
|
79
|
+
var import_chunk_QTXYAZFX = require("./chunk-QTXYAZFX.js");
|
80
80
|
var import_chunk_EPJYKNCQ = require("./chunk-EPJYKNCQ.js");
|
81
81
|
var import_chunk_ODI3VNBD = require("./chunk-ODI3VNBD.js");
|
82
82
|
var import_chunk_TSJICM5S = require("./chunk-TSJICM5S.js");
|
83
|
-
var
|
84
|
-
var
|
85
|
-
var
|
86
|
-
var
|
83
|
+
var import_chunk_DKYVVZJS = require("./chunk-DKYVVZJS.js");
|
84
|
+
var import_chunk_NO5X2ADB = require("./chunk-NO5X2ADB.js");
|
85
|
+
var import_chunk_CBT2JDO2 = require("./chunk-CBT2JDO2.js");
|
86
|
+
var import_chunk_ZHIIE6KR = require("./chunk-ZHIIE6KR.js");
|
87
87
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
88
|
-
var
|
89
|
-
var
|
88
|
+
var import_chunk_25RJ7YTB = require("./chunk-25RJ7YTB.js");
|
89
|
+
var import_chunk_RHPV7ERN = require("./chunk-RHPV7ERN.js");
|
90
90
|
var import_chunk_MUPZUVSI = require("./chunk-MUPZUVSI.js");
|
91
91
|
var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
|
92
92
|
var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
|
@@ -14751,7 +14751,7 @@ async function readSchemaFromDirectory(schemaPath2) {
|
|
14751
14751
|
}
|
14752
14752
|
const files = await (0, import_schema_files_loader.loadSchemaFiles)(schemaPath2);
|
14753
14753
|
debug2("Loading config");
|
14754
|
-
const config2 = await (0,
|
14754
|
+
const config2 = await (0, import_chunk_CBT2JDO2.getConfig)({
|
14755
14755
|
datamodel: files,
|
14756
14756
|
ignoreEnvVarErrors: true
|
14757
14757
|
});
|
@@ -15059,8 +15059,8 @@ async function checkUnsupportedDataProxyMessage(command, args, implicitSchema) {
|
|
15059
15059
|
if (argName.includes("schema")) {
|
15060
15060
|
await loadEnvFile({ schemaPath: argValue, printMessage: false });
|
15061
15061
|
const datamodel = await import_fs.default.promises.readFile(argValue, "utf-8");
|
15062
|
-
const config2 = await (0,
|
15063
|
-
const url = (0,
|
15062
|
+
const config2 = await (0, import_chunk_CBT2JDO2.getConfig)({ datamodel, ignoreEnvVarErrors: true });
|
15063
|
+
const url = (0, import_chunk_CBT2JDO2.resolveUrl)((0, import_chunk_CBT2JDO2.getEffectiveUrl)(config2.datasources[0]));
|
15064
15064
|
if (url?.startsWith("prisma://")) {
|
15065
15065
|
return forbiddenCmdWithDataProxyFlagMessage(command);
|
15066
15066
|
}
|
@@ -15232,7 +15232,7 @@ async function getGenerators(options) {
|
|
15232
15232
|
prismaPath = binaryPathsWithEngineType[queryEngineBinaryType][binaryTarget];
|
15233
15233
|
}
|
15234
15234
|
}
|
15235
|
-
const config = await (0,
|
15235
|
+
const config = await (0, import_chunk_CBT2JDO2.getConfig)({
|
15236
15236
|
datamodel: schemas,
|
15237
15237
|
datamodelPath: schemaPath,
|
15238
15238
|
prismaPath,
|
@@ -15243,7 +15243,7 @@ async function getGenerators(options) {
|
|
15243
15243
|
}
|
15244
15244
|
(0, import_chunk_5FJ3MENK.printConfigWarnings)(config.warnings);
|
15245
15245
|
const previewFeatures = (0, import_chunk_TSJICM5S.extractPreviewFeatures)(config);
|
15246
|
-
const dmmf = await (0,
|
15246
|
+
const dmmf = await (0, import_chunk_ZHIIE6KR.getDMMF)({
|
15247
15247
|
datamodel: schemas,
|
15248
15248
|
datamodelPath: schemaPath,
|
15249
15249
|
prismaPath,
|
@@ -15304,7 +15304,7 @@ The generator needs to either define the \`defaultOutput\` path in the manifest
|
|
15304
15304
|
fromEnvVar: "null"
|
15305
15305
|
};
|
15306
15306
|
}
|
15307
|
-
const datamodel = (0,
|
15307
|
+
const datamodel = (0, import_chunk_NO5X2ADB.mergeSchemas)({ schemas });
|
15308
15308
|
const envPaths2 = await getEnvPaths(schemaPath, { cwd: generator.output.value });
|
15309
15309
|
const options2 = {
|
15310
15310
|
datamodel,
|
@@ -15387,7 +15387,7 @@ generator gen {
|
|
15387
15387
|
debug6({ generatorBinaryPaths });
|
15388
15388
|
generator.setBinaryPaths(generatorBinaryPaths);
|
15389
15389
|
if (engineVersion !== version && generator.options && generator.manifest.requiresEngines.includes(queryEngineType) && generatorBinaryPaths[queryEngineType] && generatorBinaryPaths[queryEngineType]?.[binaryTarget]) {
|
15390
|
-
const customDmmf = await (0,
|
15390
|
+
const customDmmf = await (0, import_chunk_ZHIIE6KR.getDMMF)({
|
15391
15391
|
datamodel: schemas,
|
15392
15392
|
datamodelPath: schemaPath,
|
15393
15393
|
prismaPath: generatorBinaryPaths[queryEngineType]?.[binaryTarget],
|
@@ -15505,23 +15505,23 @@ async function sendPanic({
|
|
15505
15505
|
enginesVersion: enginesVersion2,
|
15506
15506
|
getDatabaseVersionSafe
|
15507
15507
|
}) {
|
15508
|
-
const schema = await (0,
|
15508
|
+
const schema = await (0, import_chunk_25RJ7YTB.z)(error).with({ schemaPath: import_chunk_25RJ7YTB.N.not(import_chunk_25RJ7YTB.N.nullish) }, (err) => {
|
15509
15509
|
return getSchema(err.schemaPath);
|
15510
|
-
}).with({ schema:
|
15510
|
+
}).with({ schema: import_chunk_25RJ7YTB.N.not(import_chunk_25RJ7YTB.N.nullish) }, (err) => Promise.resolve(err.schema)).otherwise(() => void 0);
|
15511
15511
|
const maskedSchema = schema ? (0, import_chunk_KDHESRKE.maskSchemas)(schema) : void 0;
|
15512
15512
|
let dbVersion;
|
15513
15513
|
if (error.area === "LIFT_CLI") {
|
15514
|
-
const getDatabaseVersionParams = (0,
|
15514
|
+
const getDatabaseVersionParams = (0, import_chunk_25RJ7YTB.z)({
|
15515
15515
|
schema,
|
15516
15516
|
introspectionUrl: error.introspectionUrl
|
15517
|
-
}).with({ schema:
|
15517
|
+
}).with({ schema: import_chunk_25RJ7YTB.N.not(void 0) }, ({ schema: schema2 }) => {
|
15518
15518
|
return {
|
15519
15519
|
datasource: {
|
15520
15520
|
tag: "Schema",
|
15521
15521
|
...(0, import_chunk_JHQHVXIR.toSchemasContainer)(schema2)
|
15522
15522
|
}
|
15523
15523
|
};
|
15524
|
-
}).with({ introspectionUrl:
|
15524
|
+
}).with({ introspectionUrl: import_chunk_25RJ7YTB.N.not(void 0) }, ({ introspectionUrl }) => {
|
15525
15525
|
return {
|
15526
15526
|
datasource: {
|
15527
15527
|
tag: "ConnectionString",
|
@@ -15671,7 +15671,7 @@ ${(0, import_chunk_PG5FDKSF.bold)("Thanks a lot for your help! \u{1F64F}")}`);
|
|
15671
15671
|
console.error(`${(0, import_chunk_PG5FDKSF.gray)("Error report submission failed due to: ")}`, error2);
|
15672
15672
|
}
|
15673
15673
|
}
|
15674
|
-
await (0,
|
15674
|
+
await (0, import_chunk_QTXYAZFX.wouldYouLikeToCreateANewIssue)({
|
15675
15675
|
prompt: !shouldSubmitReport,
|
15676
15676
|
error,
|
15677
15677
|
cliVersion: cliVersion2,
|
@@ -15685,7 +15685,7 @@ async function formatSchema({ schemas: schemas2 }, inputFormattingOptions) {
|
|
15685
15685
|
if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
|
15686
15686
|
handleFormatPanic(
|
15687
15687
|
() => {
|
15688
|
-
|
15688
|
+
import_chunk_RHPV7ERN.prismaSchemaWasm.debug_panic();
|
15689
15689
|
},
|
15690
15690
|
{ schemas: schemas2 }
|
15691
15691
|
);
|
@@ -15705,12 +15705,12 @@ async function formatSchema({ schemas: schemas2 }, inputFormattingOptions) {
|
|
15705
15705
|
() => {
|
15706
15706
|
const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas2), documentFormattingParams);
|
15707
15707
|
const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
|
15708
|
-
const lintDiagnostics2 = (0,
|
15708
|
+
const lintDiagnostics2 = (0, import_chunk_DKYVVZJS.lintSchema)({ schemas: formattedMultipleSchemas2 });
|
15709
15709
|
return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
|
15710
15710
|
},
|
15711
15711
|
{ schemas: schemas2 }
|
15712
15712
|
);
|
15713
|
-
const lintWarnings = (0,
|
15713
|
+
const lintWarnings = (0, import_chunk_DKYVVZJS.getLintWarningsAsText)(lintDiagnostics);
|
15714
15714
|
if (lintWarnings && import_chunk_AZNLB67U.logger_exports.should.warn()) {
|
15715
15715
|
console.warn(lintWarnings);
|
15716
15716
|
}
|
@@ -15740,7 +15740,7 @@ function handleFormatPanic(tryCb, { schemas: schemas2 }) {
|
|
15740
15740
|
}
|
15741
15741
|
}
|
15742
15742
|
function formatWasm(schema, documentFormattingParams) {
|
15743
|
-
const formattedSchema =
|
15743
|
+
const formattedSchema = import_chunk_RHPV7ERN.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
|
15744
15744
|
return formattedSchema;
|
15745
15745
|
}
|
15746
15746
|
/*! Bundled license information:
|