@prisma/internals 6.4.0-dev.53 → 6.4.0-dev.55
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-DSNEAR3R.js → chunk-3S4C4BO4.js} +8 -8
- package/dist/{chunk-FJCSJKMC.js → chunk-5D4MYYJU.js} +8 -8
- package/dist/{chunk-WUSBNTQA.js → chunk-6IPSA2KQ.js} +5 -5
- package/dist/{chunk-7S7GBEY2.js → chunk-BPZKVGOI.js} +5 -5
- package/dist/{chunk-SUSIX7T6.js → chunk-BUSIMVZU.js} +8 -8
- package/dist/{chunk-74EUCQ7K.js → chunk-CDUXRV77.js} +5 -5
- package/dist/{chunk-FVWKFMTY.js → chunk-DDMVXVI6.js} +63 -35
- package/dist/{chunk-DGCAMZNA.js → chunk-ERWGWAPF.js} +7 -7
- package/dist/{chunk-G7VM7547.js → chunk-FKSDCLIK.js} +63 -35
- package/dist/{chunk-TKJXNLL5.js → chunk-I2MFAJEI.js} +5 -5
- package/dist/{chunk-47ZPFBZN.js → chunk-LJ6XZO4U.js} +5 -5
- package/dist/{chunk-FAITWW26.js → chunk-MU65ZKUO.js} +8 -8
- package/dist/{chunk-B7G3GZFM.js → chunk-NGZYB4IC.js} +7 -7
- package/dist/{chunk-V6LH7LFD.js → chunk-OILMA5ZJ.js} +5 -5
- package/dist/{chunk-XTQ6EZQW.js → chunk-QW3UZ6BN.js} +5 -5
- package/dist/{chunk-RIXONOI6.js → chunk-R7TP3QXM.js} +5 -5
- package/dist/{chunk-S7E43WJ4.js → chunk-VGWMXMI3.js} +5 -5
- package/dist/{chunk-VWAFQGF5.js → chunk-X3Q7552D.js} +8 -8
- package/dist/{chunk-GWR372US.js → chunk-YEX3J7VY.js} +4 -4
- package/dist/{chunk-PYKSFBMQ.js → chunk-YX7ZT5SA.js} +8 -8
- package/dist/cli/checkUnsupportedDataProxy.d.ts +2 -1
- package/dist/cli/checkUnsupportedDataProxy.js +12 -12
- package/dist/cli/getSchema.d.ts +27 -6
- package/dist/cli/getSchema.js +16 -17
- package/dist/cli/hashes.d.ts +2 -1
- package/dist/cli/hashes.js +12 -12
- package/dist/engine-commands/errorHelpers.js +4 -4
- package/dist/engine-commands/formatSchema.js +11 -11
- package/dist/engine-commands/getConfig.js +10 -10
- package/dist/engine-commands/getDmmf.js +7 -7
- package/dist/engine-commands/index.js +20 -20
- package/dist/engine-commands/lintSchema.js +8 -8
- package/dist/engine-commands/mergeSchemas.js +7 -7
- package/dist/engine-commands/validate.js +7 -7
- package/dist/get-generators/generatorResolvers/generatorResolvers.js +11 -11
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +11 -11
- package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +12 -12
- package/dist/get-generators/getGenerators.js +14 -14
- package/dist/index.d.ts +1 -1
- package/dist/index.js +39 -39
- package/dist/sendPanic.js +11 -11
- package/dist/utils/getEnvPaths.js +11 -11
- package/dist/utils/getVersionFromPackageJson.js +3 -3
- package/dist/utils/handlePanic.js +11 -11
- package/dist/utils/loadEnvFile.js +11 -11
- package/dist/wasm.js +4 -4
- package/package.json +9 -9
@@ -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_3S4C4BO4_exports = {};
|
30
|
+
__export(chunk_3S4C4BO4_exports, {
|
31
31
|
ValidateError: () => ValidateError,
|
32
32
|
validate: () => validate
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
34
|
+
module.exports = __toCommonJS(chunk_3S4C4BO4_exports);
|
35
35
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
36
36
|
var import_chunk_6TXVGFQA = require("./chunk-6TXVGFQA.js");
|
37
37
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
38
|
-
var
|
38
|
+
var import_chunk_LJ6XZO4U = require("./chunk-LJ6XZO4U.js");
|
39
39
|
var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
|
40
40
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
41
|
-
var
|
41
|
+
var import_chunk_CDUXRV77 = require("./chunk-CDUXRV77.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");
|
@@ -60,7 +60,7 @@ ${detailsHeader} ${message}`;
|
|
60
60
|
}).exhaustive();
|
61
61
|
const errorMessageWithContext = `${constructedErrorMessage}
|
62
62
|
[Context: validate]`;
|
63
|
-
super((0,
|
63
|
+
super((0, import_chunk_LJ6XZO4U.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
64
64
|
this.name = "ValidateError";
|
65
65
|
}
|
66
66
|
};
|
@@ -72,13 +72,13 @@ function validate(options) {
|
|
72
72
|
() => {
|
73
73
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
|
74
74
|
debug("Triggering a Rust panic...");
|
75
|
-
|
75
|
+
import_chunk_CDUXRV77.prismaSchemaWasm.debug_panic();
|
76
76
|
}
|
77
77
|
const params = JSON.stringify({
|
78
78
|
prismaSchema: options.schemas,
|
79
79
|
noColor: Boolean(process.env.NO_COLOR)
|
80
80
|
});
|
81
|
-
|
81
|
+
import_chunk_CDUXRV77.prismaSchemaWasm.validate(params);
|
82
82
|
},
|
83
83
|
(e) => ({
|
84
84
|
type: "wasm-error",
|
@@ -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_5D4MYYJU_exports = {};
|
30
|
+
__export(chunk_5D4MYYJU_exports, {
|
31
31
|
ValidateError: () => ValidateError,
|
32
32
|
validate: () => validate
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
34
|
+
module.exports = __toCommonJS(chunk_5D4MYYJU_exports);
|
35
35
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
36
36
|
var import_chunk_6TXVGFQA = require("./chunk-6TXVGFQA.js");
|
37
37
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
38
|
-
var
|
38
|
+
var import_chunk_R7TP3QXM = require("./chunk-R7TP3QXM.js");
|
39
39
|
var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
|
40
40
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
41
|
-
var
|
41
|
+
var import_chunk_OILMA5ZJ = require("./chunk-OILMA5ZJ.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");
|
@@ -60,7 +60,7 @@ ${detailsHeader} ${message}`;
|
|
60
60
|
}).exhaustive();
|
61
61
|
const errorMessageWithContext = `${constructedErrorMessage}
|
62
62
|
[Context: validate]`;
|
63
|
-
super((0,
|
63
|
+
super((0, import_chunk_R7TP3QXM.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
64
64
|
this.name = "ValidateError";
|
65
65
|
}
|
66
66
|
};
|
@@ -72,13 +72,13 @@ function validate(options) {
|
|
72
72
|
() => {
|
73
73
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
|
74
74
|
debug("Triggering a Rust panic...");
|
75
|
-
|
75
|
+
import_chunk_OILMA5ZJ.prismaSchemaWasm.debug_panic();
|
76
76
|
}
|
77
77
|
const params = JSON.stringify({
|
78
78
|
prismaSchema: options.schemas,
|
79
79
|
noColor: Boolean(process.env.NO_COLOR)
|
80
80
|
});
|
81
|
-
|
81
|
+
import_chunk_OILMA5ZJ.prismaSchemaWasm.validate(params);
|
82
82
|
},
|
83
83
|
(e) => ({
|
84
84
|
type: "wasm-error",
|
@@ -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_6IPSA2KQ_exports = {};
|
20
|
+
__export(chunk_6IPSA2KQ_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_6IPSA2KQ_exports);
|
28
28
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
29
|
-
var
|
29
|
+
var import_chunk_CDUXRV77 = require("./chunk-CDUXRV77.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_CDUXRV77.prismaSchemaWasm.lint(JSON.stringify(schemas));
|
34
34
|
const lintDiagnostics = JSON.parse(lintResult);
|
35
35
|
return lintDiagnostics;
|
36
36
|
}
|
@@ -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_BPZKVGOI_exports = {};
|
20
|
+
__export(chunk_BPZKVGOI_exports, {
|
21
21
|
version: () => version
|
22
22
|
});
|
23
|
-
module.exports = __toCommonJS(
|
24
|
-
var
|
25
|
-
var packageJson = (0,
|
23
|
+
module.exports = __toCommonJS(chunk_BPZKVGOI_exports);
|
24
|
+
var import_chunk_YEX3J7VY = require("./chunk-YEX3J7VY.js");
|
25
|
+
var packageJson = (0, import_chunk_YEX3J7VY.require_package)();
|
26
26
|
var version = packageJson.version;
|
@@ -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_BUSIMVZU_exports = {};
|
30
|
+
__export(chunk_BUSIMVZU_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_BUSIMVZU_exports);
|
38
38
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
39
39
|
var import_chunk_6TXVGFQA = require("./chunk-6TXVGFQA.js");
|
40
40
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
41
|
-
var
|
41
|
+
var import_chunk_R7TP3QXM = require("./chunk-R7TP3QXM.js");
|
42
42
|
var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
|
43
43
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
44
|
-
var
|
44
|
+
var import_chunk_OILMA5ZJ = require("./chunk-OILMA5ZJ.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");
|
@@ -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_R7TP3QXM.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
69
69
|
this.name = "GetConfigError";
|
70
70
|
}
|
71
71
|
};
|
@@ -90,7 +90,7 @@ async function getConfig(options) {
|
|
90
90
|
() => {
|
91
91
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_CONFIG) {
|
92
92
|
debug("Triggering a Rust panic...");
|
93
|
-
|
93
|
+
import_chunk_OILMA5ZJ.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_OILMA5ZJ.prismaSchemaWasm.get_config(params);
|
102
102
|
return data;
|
103
103
|
},
|
104
104
|
(e) => ({
|
@@ -26,14 +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(
|
29
|
+
var chunk_CDUXRV77_exports = {};
|
30
|
+
__export(chunk_CDUXRV77_exports, {
|
31
31
|
prismaSchemaWasm: () => import_prisma_schema_wasm.default,
|
32
32
|
prismaSchemaWasmVersion: () => prismaSchemaWasmVersion,
|
33
33
|
wasm_exports: () => wasm_exports
|
34
34
|
});
|
35
|
-
module.exports = __toCommonJS(
|
36
|
-
var
|
35
|
+
module.exports = __toCommonJS(chunk_CDUXRV77_exports);
|
36
|
+
var import_chunk_YEX3J7VY = require("./chunk-YEX3J7VY.js");
|
37
37
|
var import_chunk_HOZFIXMD = require("./chunk-HOZFIXMD.js");
|
38
38
|
var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
|
39
39
|
var import_prisma_schema_wasm = __toESM(require("@prisma/prisma-schema-wasm"));
|
@@ -42,6 +42,6 @@ var wasm_exports = {};
|
|
42
42
|
prismaSchemaWasm: () => import_prisma_schema_wasm.default,
|
43
43
|
prismaSchemaWasmVersion: () => prismaSchemaWasmVersion
|
44
44
|
});
|
45
|
-
var { dependencies } = (0,
|
45
|
+
var { dependencies } = (0, import_chunk_YEX3J7VY.require_package)();
|
46
46
|
var prismaSchemaWasmVersion = dependencies["@prisma/prisma-schema-wasm"];
|
47
47
|
globalThis.PRISMA_WASM_PANIC_REGISTRY = new import_chunk_HOZFIXMD.WasmPanicRegistry();
|
@@ -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_DDMVXVI6_exports = {};
|
30
|
+
__export2(chunk_DDMVXVI6_exports, {
|
31
31
|
checkTypeScriptVersion: () => checkTypeScriptVersion,
|
32
32
|
checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
|
33
33
|
debug: () => debug6,
|
@@ -51,11 +51,10 @@ __export2(chunk_FVWKFMTY_exports, {
|
|
51
51
|
knownBinaryTargets: () => knownBinaryTargets,
|
52
52
|
loadEnvFile: () => loadEnvFile,
|
53
53
|
prismaClientResolver: () => prismaClientResolver,
|
54
|
-
readSchemaFromSingleFile: () => readSchemaFromSingleFile,
|
55
54
|
sendPanic: () => sendPanic,
|
56
55
|
skipIndex: () => skipIndex
|
57
56
|
});
|
58
|
-
module.exports = __toCommonJS2(
|
57
|
+
module.exports = __toCommonJS2(chunk_DDMVXVI6_exports);
|
59
58
|
var import_chunk_EUTJYQDW = require("./chunk-EUTJYQDW.js");
|
60
59
|
var import_chunk_IPKE37QC = require("./chunk-IPKE37QC.js");
|
61
60
|
var import_chunk_PIPE5DSU = require("./chunk-PIPE5DSU.js");
|
@@ -80,14 +79,13 @@ var import_chunk_AC6EAR56 = require("./chunk-AC6EAR56.js");
|
|
80
79
|
var import_chunk_EPJYKNCQ = require("./chunk-EPJYKNCQ.js");
|
81
80
|
var import_chunk_ODI3VNBD = require("./chunk-ODI3VNBD.js");
|
82
81
|
var import_chunk_TSJICM5S = require("./chunk-TSJICM5S.js");
|
83
|
-
var
|
84
|
-
var
|
85
|
-
var
|
86
|
-
var
|
87
|
-
var import_chunk_VWAFQGF5 = require("./chunk-VWAFQGF5.js");
|
82
|
+
var import_chunk_QW3UZ6BN = require("./chunk-QW3UZ6BN.js");
|
83
|
+
var import_chunk_NGZYB4IC = require("./chunk-NGZYB4IC.js");
|
84
|
+
var import_chunk_BUSIMVZU = require("./chunk-BUSIMVZU.js");
|
85
|
+
var import_chunk_MU65ZKUO = require("./chunk-MU65ZKUO.js");
|
88
86
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
89
87
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
90
|
-
var
|
88
|
+
var import_chunk_OILMA5ZJ = require("./chunk-OILMA5ZJ.js");
|
91
89
|
var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
|
92
90
|
var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
|
93
91
|
var import_chunk_QIVUAERL = require("./chunk-QIVUAERL.js");
|
@@ -14718,15 +14716,15 @@ var import_find_up = (0, import_chunk_WWAWV7DQ.__toESM)(require_find_up());
|
|
14718
14716
|
var readFile = (0, import_util.promisify)(import_fs3.default.readFile);
|
14719
14717
|
var stat = (0, import_util.promisify)(import_fs3.default.stat);
|
14720
14718
|
var debug2 = (0, import_debug4.Debug)("prisma:getSchema");
|
14721
|
-
async function getSchemaWithPath(schemaPathFromArgs, { cwd = process.cwd(), argumentName = "--schema" } = {}) {
|
14722
|
-
const result = await getSchemaWithPathInternal(schemaPathFromArgs, { cwd, argumentName });
|
14719
|
+
async function getSchemaWithPath(schemaPathFromArgs, schemaPathFromConfig, { cwd = process.cwd(), argumentName = "--schema" } = {}) {
|
14720
|
+
const result = await getSchemaWithPathInternal(schemaPathFromArgs, schemaPathFromConfig, { cwd, argumentName });
|
14723
14721
|
if (result.ok) {
|
14724
14722
|
return result.schema;
|
14725
14723
|
}
|
14726
14724
|
throw new Error(renderDefaultLookupError(result.error, cwd));
|
14727
14725
|
}
|
14728
|
-
async function getSchemaWithPathOptional(schemaPathFromArgs, { cwd = process.cwd(), argumentName = "--schema" } = {}) {
|
14729
|
-
const result = await getSchemaWithPathInternal(schemaPathFromArgs, { cwd, argumentName });
|
14726
|
+
async function getSchemaWithPathOptional(schemaPathFromArgs, schemaPathFromConfig, { cwd = process.cwd(), argumentName = "--schema" } = {}) {
|
14727
|
+
const result = await getSchemaWithPathInternal(schemaPathFromArgs, schemaPathFromConfig, { cwd, argumentName });
|
14730
14728
|
if (result.ok) {
|
14731
14729
|
return result.schema;
|
14732
14730
|
}
|
@@ -14753,7 +14751,7 @@ async function readSchemaFromDirectory(schemaPath2) {
|
|
14753
14751
|
}
|
14754
14752
|
const files = await (0, import_schema_files_loader.loadSchemaFiles)(schemaPath2);
|
14755
14753
|
debug2("Loading config");
|
14756
|
-
const config2 = await (0,
|
14754
|
+
const config2 = await (0, import_chunk_BUSIMVZU.getConfig)({
|
14757
14755
|
datamodel: files,
|
14758
14756
|
ignoreEnvVarErrors: true
|
14759
14757
|
});
|
@@ -14781,7 +14779,7 @@ async function readSchemaFromFileOrDirectory(schemaPath2) {
|
|
14781
14779
|
}
|
14782
14780
|
return { ok: false, error: { kind: "WrongType", path: schemaPath2, expectedTypes: ["file", "directory"] } };
|
14783
14781
|
}
|
14784
|
-
async function getSchemaWithPathInternal(schemaPathFromArgs, { cwd, argumentName }) {
|
14782
|
+
async function getSchemaWithPathInternal(schemaPathFromArgs, schemaPathFromConfig, { cwd, argumentName }) {
|
14785
14783
|
if (schemaPathFromArgs) {
|
14786
14784
|
const absPath = import_path2.default.resolve(cwd, schemaPathFromArgs);
|
14787
14785
|
const customSchemaResult = await readSchemaFromFileOrDirectory(absPath);
|
@@ -14795,6 +14793,10 @@ async function getSchemaWithPathInternal(schemaPathFromArgs, { cwd, argumentName
|
|
14795
14793
|
}
|
14796
14794
|
return customSchemaResult;
|
14797
14795
|
}
|
14796
|
+
const prismaConfigResult = await readSchemaFromPrismaConfigBasedLocation(schemaPathFromConfig);
|
14797
|
+
if (prismaConfigResult.ok) {
|
14798
|
+
return prismaConfigResult;
|
14799
|
+
}
|
14798
14800
|
const pkgJsonResult = await getSchemaFromPackageJson(cwd);
|
14799
14801
|
if (pkgJsonResult.ok) {
|
14800
14802
|
return pkgJsonResult;
|
@@ -14850,6 +14852,31 @@ async function getPrismaConfigFromPackageJson(cwd) {
|
|
14850
14852
|
packagePath: pkgJson.path
|
14851
14853
|
};
|
14852
14854
|
}
|
14855
|
+
async function readSchemaFromPrismaConfigBasedLocation(schemaPathFromConfig) {
|
14856
|
+
if (!schemaPathFromConfig) {
|
14857
|
+
return {
|
14858
|
+
ok: false,
|
14859
|
+
error: { kind: "PrismaConfigNotConfigured" }
|
14860
|
+
};
|
14861
|
+
}
|
14862
|
+
let schemaResult2;
|
14863
|
+
if (schemaPathFromConfig.kind === "single") {
|
14864
|
+
schemaResult2 = await readSchemaFromSingleFile(schemaPathFromConfig.filenamePath);
|
14865
|
+
if (!schemaResult2.ok) {
|
14866
|
+
throw new Error(
|
14867
|
+
`Could not load schema from file \`${schemaPathFromConfig.filenamePath}\` provided by "prisma.config.ts" config\`: ${renderLookupError(schemaResult2.error)}`
|
14868
|
+
);
|
14869
|
+
}
|
14870
|
+
} else {
|
14871
|
+
schemaResult2 = await readSchemaFromDirectory(schemaPathFromConfig.folder);
|
14872
|
+
if (!schemaResult2.ok) {
|
14873
|
+
throw new Error(
|
14874
|
+
`Could not load schema from folder \`${schemaPathFromConfig.folder}\` provided by "prisma.config.ts" config\`: ${renderLookupError(schemaResult2.error)}`
|
14875
|
+
);
|
14876
|
+
}
|
14877
|
+
}
|
14878
|
+
return schemaResult2;
|
14879
|
+
}
|
14853
14880
|
async function getSchemaFromPackageJson(cwd) {
|
14854
14881
|
const prismaConfig = await getPrismaConfigFromPackageJson(cwd);
|
14855
14882
|
debug2("prismaConfig", prismaConfig);
|
@@ -14954,8 +14981,8 @@ async function getSchemaDir(schemaPathFromArgs) {
|
|
14954
14981
|
}
|
14955
14982
|
return import_path2.default.dirname(schemaPathResult.schemaPath);
|
14956
14983
|
}
|
14957
|
-
async function getSchema(schemaPathFromArgs) {
|
14958
|
-
const schemaPathResult = await getSchemaWithPath(schemaPathFromArgs);
|
14984
|
+
async function getSchema(schemaPathFromArgs, schemaPathFromConfig) {
|
14985
|
+
const schemaPathResult = await getSchemaWithPath(schemaPathFromArgs, schemaPathFromConfig);
|
14959
14986
|
return schemaPathResult.schemas;
|
14960
14987
|
}
|
14961
14988
|
var debug3 = (0, import_debug3.default)("prisma:loadEnv");
|
@@ -15038,9 +15065,9 @@ Please use a direct connection to your database via the datasource \`directUrl\`
|
|
15038
15065
|
|
15039
15066
|
More information about this limitation: ${(0, import_chunk_L6GBFCXG.link)("https://pris.ly/d/accelerate-limitations")}
|
15040
15067
|
`;
|
15041
|
-
async function checkUnsupportedDataProxyMessage(command, args, implicitSchema) {
|
15068
|
+
async function checkUnsupportedDataProxyMessage(command, args, schemaPathFromConfig, implicitSchema) {
|
15042
15069
|
if (implicitSchema === true) {
|
15043
|
-
args["--schema"] = (await getSchemaWithPath(args["--schema"]))?.schemaPath ?? void 0;
|
15070
|
+
args["--schema"] = (await getSchemaWithPath(args["--schema"], schemaPathFromConfig))?.schemaPath ?? void 0;
|
15044
15071
|
}
|
15045
15072
|
const argList = Object.entries(args);
|
15046
15073
|
for (const [argName, argValue] of argList) {
|
@@ -15050,8 +15077,8 @@ async function checkUnsupportedDataProxyMessage(command, args, implicitSchema) {
|
|
15050
15077
|
if (argName.includes("schema")) {
|
15051
15078
|
await loadEnvFile({ schemaPath: argValue, printMessage: false, config: (0, import_config.defaultTestConfig)() });
|
15052
15079
|
const datamodel = await import_fs.default.promises.readFile(argValue, "utf-8");
|
15053
|
-
const config2 = await (0,
|
15054
|
-
const url = (0,
|
15080
|
+
const config2 = await (0, import_chunk_BUSIMVZU.getConfig)({ datamodel, ignoreEnvVarErrors: true });
|
15081
|
+
const url = (0, import_chunk_BUSIMVZU.resolveUrl)((0, import_chunk_BUSIMVZU.getEffectiveUrl)(config2.datasources[0]));
|
15055
15082
|
if (url?.startsWith("prisma://")) {
|
15056
15083
|
return forbiddenCmdWithDataProxyFlagMessage(command);
|
15057
15084
|
}
|
@@ -15059,13 +15086,14 @@ async function checkUnsupportedDataProxyMessage(command, args, implicitSchema) {
|
|
15059
15086
|
}
|
15060
15087
|
return void 0;
|
15061
15088
|
}
|
15062
|
-
async function checkUnsupportedDataProxy(command, args, implicitSchema) {
|
15063
|
-
const message = await checkUnsupportedDataProxyMessage(command, args, implicitSchema).catch(
|
15089
|
+
async function checkUnsupportedDataProxy(command, args, schemaPathFromConfig, implicitSchema) {
|
15090
|
+
const message = await checkUnsupportedDataProxyMessage(command, args, schemaPathFromConfig, implicitSchema).catch(
|
15091
|
+
() => void 0
|
15092
|
+
);
|
15064
15093
|
if (message) throw new Error(message);
|
15065
15094
|
}
|
15066
|
-
async function getProjectHash() {
|
15067
|
-
const
|
15068
|
-
const projectPath = (await getSchemaWithPath(args["--schema"]))?.schemaPath ?? process.cwd();
|
15095
|
+
async function getProjectHash(schemaPathFromArgs, schemaPathFromConfig) {
|
15096
|
+
const projectPath = (await getSchemaWithPath(schemaPathFromArgs, schemaPathFromConfig))?.schemaPath ?? process.cwd();
|
15069
15097
|
return import_crypto.default.createHash("sha256").update(projectPath).digest("hex").substring(0, 8);
|
15070
15098
|
}
|
15071
15099
|
function getCLIPathHash() {
|
@@ -15223,7 +15251,7 @@ async function getGenerators(options) {
|
|
15223
15251
|
prismaPath = binaryPathsWithEngineType[queryEngineBinaryType][binaryTarget];
|
15224
15252
|
}
|
15225
15253
|
}
|
15226
|
-
const config = await (0,
|
15254
|
+
const config = await (0, import_chunk_BUSIMVZU.getConfig)({
|
15227
15255
|
datamodel: schemas,
|
15228
15256
|
datamodelPath: schemaPath,
|
15229
15257
|
prismaPath,
|
@@ -15234,7 +15262,7 @@ async function getGenerators(options) {
|
|
15234
15262
|
}
|
15235
15263
|
(0, import_chunk_5FJ3MENK.printConfigWarnings)(config.warnings);
|
15236
15264
|
const previewFeatures = (0, import_chunk_TSJICM5S.extractPreviewFeatures)(config);
|
15237
|
-
const dmmf = await (0,
|
15265
|
+
const dmmf = await (0, import_chunk_MU65ZKUO.getDMMF)({
|
15238
15266
|
datamodel: schemas,
|
15239
15267
|
datamodelPath: schemaPath,
|
15240
15268
|
prismaPath,
|
@@ -15295,7 +15323,7 @@ The generator needs to either define the \`defaultOutput\` path in the manifest
|
|
15295
15323
|
fromEnvVar: "null"
|
15296
15324
|
};
|
15297
15325
|
}
|
15298
|
-
const datamodel = (0,
|
15326
|
+
const datamodel = (0, import_chunk_NGZYB4IC.mergeSchemas)({ schemas });
|
15299
15327
|
const envPaths2 = await getEnvPaths(schemaPath, { cwd: generator.output.value });
|
15300
15328
|
const options2 = {
|
15301
15329
|
datamodel,
|
@@ -15378,7 +15406,7 @@ generator gen {
|
|
15378
15406
|
debug7({ generatorBinaryPaths });
|
15379
15407
|
generator.setBinaryPaths(generatorBinaryPaths);
|
15380
15408
|
if (engineVersion !== version && generator.options && generator.manifest.requiresEngines.includes(queryEngineType) && generatorBinaryPaths[queryEngineType] && generatorBinaryPaths[queryEngineType]?.[binaryTarget]) {
|
15381
|
-
const customDmmf = await (0,
|
15409
|
+
const customDmmf = await (0, import_chunk_MU65ZKUO.getDMMF)({
|
15382
15410
|
datamodel: schemas,
|
15383
15411
|
datamodelPath: schemaPath,
|
15384
15412
|
prismaPath: generatorBinaryPaths[queryEngineType]?.[binaryTarget],
|
@@ -15676,7 +15704,7 @@ async function formatSchema({ schemas: schemas2 }, inputFormattingOptions) {
|
|
15676
15704
|
if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
|
15677
15705
|
handleFormatPanic(
|
15678
15706
|
() => {
|
15679
|
-
|
15707
|
+
import_chunk_OILMA5ZJ.prismaSchemaWasm.debug_panic();
|
15680
15708
|
},
|
15681
15709
|
{ schemas: schemas2 }
|
15682
15710
|
);
|
@@ -15696,12 +15724,12 @@ async function formatSchema({ schemas: schemas2 }, inputFormattingOptions) {
|
|
15696
15724
|
() => {
|
15697
15725
|
const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas2), documentFormattingParams);
|
15698
15726
|
const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
|
15699
|
-
const lintDiagnostics2 = (0,
|
15727
|
+
const lintDiagnostics2 = (0, import_chunk_QW3UZ6BN.lintSchema)({ schemas: formattedMultipleSchemas2 });
|
15700
15728
|
return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
|
15701
15729
|
},
|
15702
15730
|
{ schemas: schemas2 }
|
15703
15731
|
);
|
15704
|
-
const lintWarnings = (0,
|
15732
|
+
const lintWarnings = (0, import_chunk_QW3UZ6BN.getLintWarningsAsText)(lintDiagnostics);
|
15705
15733
|
if (lintWarnings && import_chunk_AZNLB67U.logger_exports.should.warn()) {
|
15706
15734
|
console.warn(lintWarnings);
|
15707
15735
|
}
|
@@ -15731,7 +15759,7 @@ function handleFormatPanic(tryCb, { schemas: schemas2 }) {
|
|
15731
15759
|
}
|
15732
15760
|
}
|
15733
15761
|
function formatWasm(schema, documentFormattingParams) {
|
15734
|
-
const formattedSchema =
|
15762
|
+
const formattedSchema = import_chunk_OILMA5ZJ.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
|
15735
15763
|
return formattedSchema;
|
15736
15764
|
}
|
15737
15765
|
/*! Bundled license information:
|
@@ -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_ERWGWAPF_exports = {};
|
30
|
+
__export(chunk_ERWGWAPF_exports, {
|
31
31
|
MergeSchemasError: () => MergeSchemasError,
|
32
32
|
mergeSchemas: () => mergeSchemas
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
34
|
+
module.exports = __toCommonJS(chunk_ERWGWAPF_exports);
|
35
35
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
36
36
|
var import_chunk_6TXVGFQA = require("./chunk-6TXVGFQA.js");
|
37
37
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
38
|
-
var
|
38
|
+
var import_chunk_LJ6XZO4U = require("./chunk-LJ6XZO4U.js");
|
39
39
|
var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
|
40
40
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
41
|
-
var
|
41
|
+
var import_chunk_CDUXRV77 = require("./chunk-CDUXRV77.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");
|
@@ -60,7 +60,7 @@ ${detailsHeader} ${message}`;
|
|
60
60
|
}).exhaustive();
|
61
61
|
const errorMessageWithContext = `${constructedErrorMessage}
|
62
62
|
[Context: mergeSchemas]`;
|
63
|
-
super((0,
|
63
|
+
super((0, import_chunk_LJ6XZO4U.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
64
64
|
this.name = "MergeSchemasError";
|
65
65
|
}
|
66
66
|
};
|
@@ -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_CDUXRV77.prismaSchemaWasm.merge_schemas(params);
|
77
77
|
},
|
78
78
|
(e) => ({
|
79
79
|
type: "wasm-error",
|