@prisma/internals 6.6.0-integration-mcp.3 → 6.6.0-integration-feat-orm-693-d1-driver-create-migration-adapter-using-new-http-binding.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-VTJOX6HO.js → chunk-244JZX3O.js} +5 -5
- package/dist/{chunk-MZHKUMZX.js → chunk-5UDIJ23I.js} +8 -8
- package/dist/{chunk-46FA36ZM.js → chunk-75AJJ2SV.js} +5 -5
- package/dist/{chunk-VYJSNZF3.js → chunk-ABTIXQDX.js} +4 -4
- package/dist/{chunk-ZQEXNNVO.js → chunk-B2BBNLC5.js} +5 -5
- package/dist/{chunk-OL4K6FMD.js → chunk-BTWAF3S4.js} +7 -7
- package/dist/{chunk-LWBLVV7Y.js → chunk-GIOVJ5SL.js} +8 -8
- package/dist/{chunk-ITKXEANW.js → chunk-HX2VLZFY.js} +111 -50
- package/dist/{chunk-SNSJWJTA.js → chunk-HZP4ATW5.js} +5 -5
- package/dist/{chunk-W4ZUPFHQ.js → chunk-L2OMDDLG.js} +111 -50
- package/dist/{chunk-7SLJMIAW.js → chunk-LHESHKC2.js} +5 -5
- package/dist/{chunk-FAPPXX7W.js → chunk-M6JO5TM5.js} +8 -8
- package/dist/{chunk-FXFNXBNO.js → chunk-MSQTODVE.js} +8 -8
- package/dist/{chunk-TYGHBZMD.js → chunk-OIAO45HN.js} +5 -5
- package/dist/{chunk-AP52B62F.js → chunk-PQE76XRR.js} +5 -5
- package/dist/{chunk-INWG6J3Y.js → chunk-Q3IVXLMC.js} +5 -5
- package/dist/{chunk-GV244NDE.js → chunk-R57AYZIS.js} +7 -7
- package/dist/{chunk-2H6XXXKO.js → chunk-TV34NMBZ.js} +12 -15
- package/dist/{chunk-OUQPIJFQ.js → chunk-XKIMYV5V.js} +5 -5
- package/dist/{chunk-PING5S2U.js → chunk-XQSHUIJ5.js} +8 -8
- package/dist/{chunk-RT6W6X7Y.js → chunk-Z2MGSX7I.js} +8 -8
- package/dist/cli/checkUnsupportedDataProxy.js +13 -13
- package/dist/cli/directoryConfig.d.ts +1 -1
- package/dist/cli/directoryConfig.js +2 -2
- package/dist/cli/getSchema.d.ts +28 -3
- package/dist/cli/getSchema.js +17 -16
- package/dist/cli/hashes.d.ts +2 -1
- package/dist/cli/hashes.js +13 -13
- package/dist/cli/schemaContext.d.ts +3 -4
- package/dist/cli/schemaContext.js +13 -13
- package/dist/engine-commands/errorHelpers.js +4 -4
- package/dist/engine-commands/formatSchema.js +12 -12
- package/dist/engine-commands/getConfig.js +10 -10
- package/dist/engine-commands/getDmmf.js +7 -7
- package/dist/engine-commands/index.js +21 -21
- 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 +12 -12
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +12 -12
- package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +13 -13
- package/dist/get-generators/getGenerators.js +15 -15
- package/dist/index.d.ts +1 -1
- package/dist/index.js +41 -40
- package/dist/utils/getEnvPaths.js +12 -12
- package/dist/utils/getVersionFromPackageJson.js +3 -3
- package/dist/utils/loadEnvFile.js +12 -12
- package/dist/wasm.js +4 -4
- package/package.json +11 -11
@@ -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_244JZX3O_exports = {};
|
20
|
+
__export(chunk_244JZX3O_exports, {
|
21
21
|
version: () => version
|
22
22
|
});
|
23
|
-
module.exports = __toCommonJS(
|
24
|
-
var
|
25
|
-
var packageJson = (0,
|
23
|
+
module.exports = __toCommonJS(chunk_244JZX3O_exports);
|
24
|
+
var import_chunk_OIAO45HN = require("./chunk-OIAO45HN.js");
|
25
|
+
var packageJson = (0, import_chunk_OIAO45HN.require_package)();
|
26
26
|
var version = packageJson.version;
|
@@ -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_5UDIJ23I_exports = {};
|
30
|
+
__export(chunk_5UDIJ23I_exports, {
|
31
31
|
GetDmmfError: () => GetDmmfError,
|
32
32
|
getDMMF: () => getDMMF
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
34
|
+
module.exports = __toCommonJS(chunk_5UDIJ23I_exports);
|
35
35
|
var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
|
36
36
|
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
37
|
-
var
|
38
|
-
var
|
37
|
+
var import_chunk_B2BBNLC5 = require("./chunk-B2BBNLC5.js");
|
38
|
+
var import_chunk_HZP4ATW5 = require("./chunk-HZP4ATW5.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,7 +58,7 @@ ${detailsHeader} ${message}`;
|
|
58
58
|
}).exhaustive();
|
59
59
|
const errorMessageWithContext = `${constructedErrorMessage}
|
60
60
|
[Context: getDmmf]`;
|
61
|
-
super((0,
|
61
|
+
super((0, import_chunk_B2BBNLC5.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
62
62
|
this.name = "GetDmmfError";
|
63
63
|
}
|
64
64
|
};
|
@@ -70,13 +70,13 @@ async function getDMMF(options) {
|
|
70
70
|
() => {
|
71
71
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
|
72
72
|
debug("Triggering a Rust panic...");
|
73
|
-
|
73
|
+
import_chunk_HZP4ATW5.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_HZP4ATW5.prismaSchemaWasm.get_dmmf(params);
|
80
80
|
return data;
|
81
81
|
},
|
82
82
|
(e) => ({
|
@@ -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_75AJJ2SV_exports = {};
|
20
|
+
__export(chunk_75AJJ2SV_exports, {
|
21
21
|
version: () => version
|
22
22
|
});
|
23
|
-
module.exports = __toCommonJS(
|
24
|
-
var
|
25
|
-
var packageJson = (0,
|
23
|
+
module.exports = __toCommonJS(chunk_75AJJ2SV_exports);
|
24
|
+
var import_chunk_ABTIXQDX = require("./chunk-ABTIXQDX.js");
|
25
|
+
var packageJson = (0, import_chunk_ABTIXQDX.require_package)();
|
26
26
|
var version = packageJson.version;
|
@@ -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_ABTIXQDX_exports = {};
|
20
|
+
__export(chunk_ABTIXQDX_exports, {
|
21
21
|
require_package: () => require_package
|
22
22
|
});
|
23
|
-
module.exports = __toCommonJS(
|
23
|
+
module.exports = __toCommonJS(chunk_ABTIXQDX_exports);
|
24
24
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
25
25
|
var require_package = (0, import_chunk_4VNS5WPM.__commonJS)({
|
26
26
|
"package.json"(exports, module2) {
|
@@ -113,7 +113,7 @@ var require_package = (0, import_chunk_4VNS5WPM.__commonJS)({
|
|
113
113
|
"@prisma/generator": "workspace:*",
|
114
114
|
"@prisma/generator-helper": "workspace:*",
|
115
115
|
"@prisma/get-platform": "workspace:*",
|
116
|
-
"@prisma/prisma-schema-wasm": "6.6.0-
|
116
|
+
"@prisma/prisma-schema-wasm": "6.6.0-25.0302bd9e49a13a657a302c060e529d54b08fad04",
|
117
117
|
"@prisma/schema-files-loader": "workspace:*",
|
118
118
|
arg: "5.0.2",
|
119
119
|
prompts: "2.4.2"
|
@@ -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_B2BBNLC5_exports = {};
|
20
|
+
__export(chunk_B2BBNLC5_exports, {
|
21
21
|
addVersionDetailsToErrorMessage: () => addVersionDetailsToErrorMessage
|
22
22
|
});
|
23
|
-
module.exports = __toCommonJS(
|
24
|
-
var
|
23
|
+
module.exports = __toCommonJS(chunk_B2BBNLC5_exports);
|
24
|
+
var import_chunk_244JZX3O = require("./chunk-244JZX3O.js");
|
25
25
|
var import_chunk_QN6PSQY7 = require("./chunk-QN6PSQY7.js");
|
26
26
|
function addVersionDetailsToErrorMessage(message) {
|
27
|
-
const rows = [["Prisma CLI Version",
|
27
|
+
const rows = [["Prisma CLI Version", import_chunk_244JZX3O.version]];
|
28
28
|
return `${message}
|
29
29
|
|
30
30
|
${(0, import_chunk_QN6PSQY7.formatTable)(rows)}`;
|
@@ -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_BTWAF3S4_exports = {};
|
30
|
+
__export(chunk_BTWAF3S4_exports, {
|
31
31
|
MergeSchemasError: () => MergeSchemasError,
|
32
32
|
mergeSchemas: () => mergeSchemas
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
34
|
+
module.exports = __toCommonJS(chunk_BTWAF3S4_exports);
|
35
35
|
var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
|
36
36
|
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
37
37
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
38
|
-
var
|
39
|
-
var
|
38
|
+
var import_chunk_PQE76XRR = require("./chunk-PQE76XRR.js");
|
39
|
+
var import_chunk_LHESHKC2 = require("./chunk-LHESHKC2.js");
|
40
40
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
41
41
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
42
42
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
@@ -59,7 +59,7 @@ ${detailsHeader} ${message}`;
|
|
59
59
|
}).exhaustive();
|
60
60
|
const errorMessageWithContext = `${constructedErrorMessage}
|
61
61
|
[Context: mergeSchemas]`;
|
62
|
-
super((0,
|
62
|
+
super((0, import_chunk_PQE76XRR.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
63
63
|
this.name = "MergeSchemasError";
|
64
64
|
}
|
65
65
|
};
|
@@ -72,7 +72,7 @@ function mergeSchemas(options) {
|
|
72
72
|
const params = JSON.stringify({
|
73
73
|
schema: options.schemas
|
74
74
|
});
|
75
|
-
return
|
75
|
+
return import_chunk_LHESHKC2.prismaSchemaWasm.merge_schemas(params);
|
76
76
|
},
|
77
77
|
(e) => ({
|
78
78
|
type: "wasm-error",
|
@@ -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_GIOVJ5SL_exports = {};
|
30
|
+
__export(chunk_GIOVJ5SL_exports, {
|
31
31
|
GetDmmfError: () => GetDmmfError,
|
32
32
|
getDMMF: () => getDMMF
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
34
|
+
module.exports = __toCommonJS(chunk_GIOVJ5SL_exports);
|
35
35
|
var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
|
36
36
|
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
37
|
-
var
|
38
|
-
var
|
37
|
+
var import_chunk_PQE76XRR = require("./chunk-PQE76XRR.js");
|
38
|
+
var import_chunk_LHESHKC2 = require("./chunk-LHESHKC2.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,7 +58,7 @@ ${detailsHeader} ${message}`;
|
|
58
58
|
}).exhaustive();
|
59
59
|
const errorMessageWithContext = `${constructedErrorMessage}
|
60
60
|
[Context: getDmmf]`;
|
61
|
-
super((0,
|
61
|
+
super((0, import_chunk_PQE76XRR.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
62
62
|
this.name = "GetDmmfError";
|
63
63
|
}
|
64
64
|
};
|
@@ -70,13 +70,13 @@ async function getDMMF(options) {
|
|
70
70
|
() => {
|
71
71
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
|
72
72
|
debug("Triggering a Rust panic...");
|
73
|
-
|
73
|
+
import_chunk_LHESHKC2.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_LHESHKC2.prismaSchemaWasm.get_dmmf(params);
|
80
80
|
return data;
|
81
81
|
},
|
82
82
|
(e) => ({
|
@@ -26,8 +26,8 @@ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__g
|
|
26
26
|
mod
|
27
27
|
));
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
var
|
30
|
-
__export(
|
29
|
+
var chunk_HX2VLZFY_exports = {};
|
30
|
+
__export(chunk_HX2VLZFY_exports, {
|
31
31
|
checkTypeScriptVersion: () => checkTypeScriptVersion,
|
32
32
|
checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
|
33
33
|
debug: () => debug4,
|
@@ -42,18 +42,19 @@ __export(chunk_ITKXEANW_exports, {
|
|
42
42
|
getNodeAPIName: () => import_get_platform2.getNodeAPIName,
|
43
43
|
getPrismaConfigFromPackageJson: () => getPrismaConfigFromPackageJson,
|
44
44
|
getProjectHash: () => getProjectHash,
|
45
|
+
getSchema: () => getSchema,
|
46
|
+
getSchemaDir: () => getSchemaDir,
|
45
47
|
getSchemaFromPackageJson: () => getSchemaFromPackageJson,
|
46
48
|
getSchemaWithPath: () => getSchemaWithPath,
|
47
49
|
getSchemaWithPathOptional: () => getSchemaWithPathOptional,
|
48
50
|
knownBinaryTargets: () => knownBinaryTargets,
|
49
51
|
loadEnvFile: () => loadEnvFile,
|
50
52
|
loadSchemaContext: () => loadSchemaContext,
|
51
|
-
printSchemaLoadedMessage: () => printSchemaLoadedMessage,
|
52
53
|
prismaClientResolver: () => prismaClientResolver,
|
53
54
|
processSchemaResult: () => processSchemaResult,
|
54
55
|
skipIndex: () => skipIndex
|
55
56
|
});
|
56
|
-
module.exports = __toCommonJS(
|
57
|
+
module.exports = __toCommonJS(chunk_HX2VLZFY_exports);
|
57
58
|
var import_chunk_QGJH4P4N = require("./chunk-QGJH4P4N.js");
|
58
59
|
var import_chunk_GHHABGYW = require("./chunk-GHHABGYW.js");
|
59
60
|
var import_chunk_EUTJYQDW = require("./chunk-EUTJYQDW.js");
|
@@ -72,11 +73,11 @@ var import_chunk_XLTQGAI2 = require("./chunk-XLTQGAI2.js");
|
|
72
73
|
var import_chunk_HAGJ64PM = require("./chunk-HAGJ64PM.js");
|
73
74
|
var import_chunk_CRVLHWC5 = require("./chunk-CRVLHWC5.js");
|
74
75
|
var import_chunk_J77ZIDXB = require("./chunk-J77ZIDXB.js");
|
75
|
-
var
|
76
|
-
var
|
77
|
-
var
|
78
|
-
var
|
79
|
-
var
|
76
|
+
var import_chunk_XKIMYV5V = require("./chunk-XKIMYV5V.js");
|
77
|
+
var import_chunk_BTWAF3S4 = require("./chunk-BTWAF3S4.js");
|
78
|
+
var import_chunk_MSQTODVE = require("./chunk-MSQTODVE.js");
|
79
|
+
var import_chunk_GIOVJ5SL = require("./chunk-GIOVJ5SL.js");
|
80
|
+
var import_chunk_LHESHKC2 = require("./chunk-LHESHKC2.js");
|
80
81
|
var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
|
81
82
|
var import_chunk_M3GBKLGE = require("./chunk-M3GBKLGE.js");
|
82
83
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
@@ -120,7 +121,7 @@ var debug = (0, import_debug2.default)("prisma:format");
|
|
120
121
|
async function formatSchema({ schemas }, inputFormattingOptions) {
|
121
122
|
if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
|
122
123
|
handleFormatPanic(() => {
|
123
|
-
|
124
|
+
import_chunk_LHESHKC2.prismaSchemaWasm.debug_panic();
|
124
125
|
});
|
125
126
|
}
|
126
127
|
const defaultFormattingOptions = {
|
@@ -137,10 +138,10 @@ async function formatSchema({ schemas }, inputFormattingOptions) {
|
|
137
138
|
const { formattedMultipleSchemas, lintDiagnostics } = handleFormatPanic(() => {
|
138
139
|
const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas), documentFormattingParams);
|
139
140
|
const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
|
140
|
-
const lintDiagnostics2 = (0,
|
141
|
+
const lintDiagnostics2 = (0, import_chunk_XKIMYV5V.lintSchema)({ schemas: formattedMultipleSchemas2 });
|
141
142
|
return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
|
142
143
|
});
|
143
|
-
const lintWarnings = (0,
|
144
|
+
const lintWarnings = (0, import_chunk_XKIMYV5V.getLintWarningsAsText)(lintDiagnostics);
|
144
145
|
if (lintWarnings && import_chunk_ZJWZK45Z.logger_exports.should.warn()) {
|
145
146
|
console.warn(lintWarnings);
|
146
147
|
}
|
@@ -167,7 +168,7 @@ function handleFormatPanic(tryCb) {
|
|
167
168
|
}
|
168
169
|
}
|
169
170
|
function formatWasm(schema, documentFormattingParams) {
|
170
|
-
const formattedSchema =
|
171
|
+
const formattedSchema = import_chunk_LHESHKC2.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
|
171
172
|
return formattedSchema;
|
172
173
|
}
|
173
174
|
var readFile = (0, import_util.promisify)(import_fs.default.readFile);
|
@@ -187,9 +188,6 @@ async function getSchemaWithPathOptional(schemaPathFromArgs, schemaPathFromConfi
|
|
187
188
|
}
|
188
189
|
return null;
|
189
190
|
}
|
190
|
-
function printSchemaLoadedMessage(schemaPath2) {
|
191
|
-
process.stdout.write((0, import_chunk_PG5FDKSF.dim)(`Prisma schema loaded from ${import_path.default.relative(process.cwd(), schemaPath2)}`) + "\n");
|
192
|
-
}
|
193
191
|
async function readSchemaFromSingleFile(schemaPath2) {
|
194
192
|
debug2("Reading schema from single file", schemaPath2);
|
195
193
|
const typeError = await (0, import_schema_files_loader.ensureType)(schemaPath2, "file");
|
@@ -211,7 +209,7 @@ async function readSchemaFromDirectory(schemaPath2) {
|
|
211
209
|
}
|
212
210
|
const files = await (0, import_schema_files_loader.loadSchemaFiles)(schemaPath2);
|
213
211
|
debug2("Loading config");
|
214
|
-
const config = await (0,
|
212
|
+
const config = await (0, import_chunk_MSQTODVE.getConfig)({
|
215
213
|
datamodel: files,
|
216
214
|
ignoreEnvVarErrors: true
|
217
215
|
});
|
@@ -285,16 +283,15 @@ function renderLookupError(error) {
|
|
285
283
|
function renderDefaultLookupError(error, cwd) {
|
286
284
|
const parts = [
|
287
285
|
`Could not find Prisma Schema that is required for this command.`,
|
288
|
-
`You can either provide it with ${(0, import_chunk_PG5FDKSF.green)(
|
289
|
-
|
290
|
-
|
291
|
-
`or put it into the default location (${(0, import_chunk_PG5FDKSF.green)("`./prisma/schema.prisma`")}, or ${(0, import_chunk_PG5FDKSF.green)("`./schema.prisma`")}.`,
|
286
|
+
`You can either provide it with ${(0, import_chunk_PG5FDKSF.green)(
|
287
|
+
"`--schema`"
|
288
|
+
)} argument, set it as \`prisma.schema\` in your package.json or put it into the default location.`,
|
292
289
|
"Checked following paths:\n"
|
293
290
|
];
|
294
291
|
const printedPaths = /* @__PURE__ */ new Set();
|
295
292
|
for (const failure of error.failures) {
|
296
|
-
const filePath = failure.path;
|
297
|
-
if (!printedPaths.has(failure.path)) {
|
293
|
+
const filePath = failure.rule.schemaPath.path;
|
294
|
+
if (!printedPaths.has(failure.rule.schemaPath.path)) {
|
298
295
|
parts.push(`${import_path.default.relative(cwd, filePath)}: ${renderLookupError(failure.error)}`);
|
299
296
|
printedPaths.add(filePath);
|
300
297
|
}
|
@@ -320,13 +317,21 @@ async function readSchemaFromPrismaConfigBasedLocation(schemaPathFromConfig) {
|
|
320
317
|
error: { kind: "PrismaConfigNotConfigured" }
|
321
318
|
};
|
322
319
|
}
|
323
|
-
|
324
|
-
if (
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
320
|
+
let schemaResult;
|
321
|
+
if (schemaPathFromConfig.kind === "single") {
|
322
|
+
schemaResult = await readSchemaFromSingleFile(schemaPathFromConfig.filePath);
|
323
|
+
if (!schemaResult.ok) {
|
324
|
+
throw new Error(
|
325
|
+
`Could not load schema from file \`${schemaPathFromConfig.filePath}\` provided by "prisma.config.ts"\`: ${renderLookupError(schemaResult.error)}`
|
326
|
+
);
|
327
|
+
}
|
328
|
+
} else {
|
329
|
+
schemaResult = await readSchemaFromDirectory(schemaPathFromConfig.folderPath);
|
330
|
+
if (!schemaResult.ok) {
|
331
|
+
throw new Error(
|
332
|
+
`Could not load schema from folder \`${schemaPathFromConfig.folderPath}\` provided by "prisma.config.ts"\`: ${renderLookupError(schemaResult.error)}`
|
333
|
+
);
|
334
|
+
}
|
330
335
|
}
|
331
336
|
return schemaResult;
|
332
337
|
}
|
@@ -361,14 +366,51 @@ async function getSchemaFromPackageJson(cwd) {
|
|
361
366
|
return lookupResult;
|
362
367
|
}
|
363
368
|
async function getDefaultSchema(cwd, failures = []) {
|
364
|
-
const
|
365
|
-
|
366
|
-
|
367
|
-
|
369
|
+
const schemaPrisma = {
|
370
|
+
schemaPath: {
|
371
|
+
path: import_path.default.join(cwd, "schema.prisma"),
|
372
|
+
kind: "file"
|
373
|
+
}
|
374
|
+
};
|
375
|
+
const prismaSchemaFile = {
|
376
|
+
schemaPath: {
|
377
|
+
path: import_path.default.join(cwd, "prisma", "schema.prisma"),
|
378
|
+
kind: "file"
|
379
|
+
},
|
380
|
+
conflictsWith: {
|
381
|
+
path: import_path.default.join(cwd, "prisma", "schema"),
|
382
|
+
kind: "directory"
|
383
|
+
}
|
384
|
+
};
|
385
|
+
const prismaSchemaFolder = {
|
386
|
+
schemaPath: {
|
387
|
+
path: import_path.default.join(cwd, "prisma", "schema"),
|
388
|
+
kind: "directory"
|
389
|
+
},
|
390
|
+
conflictsWith: {
|
391
|
+
path: import_path.default.join(cwd, "prisma", "schema.prisma"),
|
392
|
+
kind: "file"
|
393
|
+
}
|
394
|
+
};
|
395
|
+
const rules = [schemaPrisma, prismaSchemaFile, prismaSchemaFolder];
|
396
|
+
for (const rule of rules) {
|
397
|
+
debug2(`Checking existence of ${rule.schemaPath.path}`);
|
398
|
+
const schema = await loadSchemaFromDefaultLocation(rule.schemaPath);
|
368
399
|
if (!schema.ok) {
|
369
|
-
failures.push({
|
400
|
+
failures.push({ rule, error: schema.error });
|
370
401
|
continue;
|
371
402
|
}
|
403
|
+
if (rule.conflictsWith) {
|
404
|
+
const conflictingSchema = await loadSchemaFromDefaultLocation(rule.conflictsWith);
|
405
|
+
if (conflictingSchema.ok) {
|
406
|
+
throw new Error(
|
407
|
+
`Found Prisma Schemas at both \`${import_path.default.relative(cwd, rule.schemaPath.path)}\` and \`${import_path.default.relative(
|
408
|
+
cwd,
|
409
|
+
rule.conflictsWith.path
|
410
|
+
)}\`. Please remove one.`
|
411
|
+
);
|
412
|
+
}
|
413
|
+
}
|
372
414
|
return schema;
|
373
415
|
}
|
374
416
|
return {
|
@@ -379,6 +421,28 @@ async function getDefaultSchema(cwd, failures = []) {
|
|
379
421
|
}
|
380
422
|
};
|
381
423
|
}
|
424
|
+
async function loadSchemaFromDefaultLocation(lookupPath) {
|
425
|
+
switch (lookupPath.kind) {
|
426
|
+
case "file":
|
427
|
+
return readSchemaFromSingleFile(lookupPath.path);
|
428
|
+
case "directory":
|
429
|
+
return readSchemaFromDirectory(lookupPath.path);
|
430
|
+
}
|
431
|
+
}
|
432
|
+
async function getSchemaDir(schemaPathFromArgs) {
|
433
|
+
if (schemaPathFromArgs) {
|
434
|
+
return import_path.default.resolve(import_path.default.dirname(schemaPathFromArgs));
|
435
|
+
}
|
436
|
+
const schemaPathResult = await getSchemaWithPath();
|
437
|
+
if (!schemaPathResult) {
|
438
|
+
return null;
|
439
|
+
}
|
440
|
+
return import_path.default.dirname(schemaPathResult.schemaPath);
|
441
|
+
}
|
442
|
+
async function getSchema(schemaPathFromArgs, schemaPathFromConfig) {
|
443
|
+
const schemaPathResult = await getSchemaWithPath(schemaPathFromArgs, schemaPathFromConfig);
|
444
|
+
return schemaPathResult.schemas;
|
445
|
+
}
|
382
446
|
async function getProjectHash(schemaPathFromArgs, schemaPathFromConfig) {
|
383
447
|
const projectPath = (await getSchemaWithPath(schemaPathFromArgs, schemaPathFromConfig))?.schemaPath ?? process.cwd();
|
384
448
|
return import_crypto.default.createHash("sha256").update(projectPath).digest("hex").substring(0, 8);
|
@@ -393,35 +457,32 @@ async function loadSchemaContext({
|
|
393
457
|
printLoadMessage = true,
|
394
458
|
ignoreEnvVarErrors = false,
|
395
459
|
allowNull = false,
|
396
|
-
schemaPathArgumentName = "--schema"
|
397
|
-
cwd = process.cwd()
|
460
|
+
schemaPathArgumentName = "--schema"
|
398
461
|
} = {}) {
|
399
462
|
let schemaResult = null;
|
400
463
|
if (allowNull) {
|
401
464
|
schemaResult = await getSchemaWithPathOptional(schemaPathFromArg, schemaPathFromConfig, {
|
402
|
-
argumentName: schemaPathArgumentName
|
403
|
-
cwd
|
465
|
+
argumentName: schemaPathArgumentName
|
404
466
|
});
|
405
467
|
if (!schemaResult) return null;
|
406
468
|
} else {
|
407
469
|
schemaResult = await getSchemaWithPath(schemaPathFromArg, schemaPathFromConfig, {
|
408
|
-
argumentName: schemaPathArgumentName
|
409
|
-
cwd
|
470
|
+
argumentName: schemaPathArgumentName
|
410
471
|
});
|
411
472
|
}
|
412
|
-
return processSchemaResult({ schemaResult, printLoadMessage, ignoreEnvVarErrors
|
473
|
+
return processSchemaResult({ schemaResult, printLoadMessage, ignoreEnvVarErrors });
|
413
474
|
}
|
414
475
|
async function processSchemaResult({
|
415
476
|
schemaResult,
|
416
477
|
printLoadMessage = true,
|
417
|
-
ignoreEnvVarErrors = false
|
418
|
-
cwd = process.cwd()
|
478
|
+
ignoreEnvVarErrors = false
|
419
479
|
}) {
|
480
|
+
const cwd = process.cwd();
|
420
481
|
const loadedFromPathForLogMessages = import_path2.default.relative(cwd, schemaResult.schemaPath);
|
421
482
|
if (printLoadMessage) {
|
422
|
-
|
483
|
+
process.stdout.write((0, import_chunk_PG5FDKSF.dim)(`Prisma schema loaded from ${loadedFromPathForLogMessages}`) + "\n");
|
423
484
|
}
|
424
|
-
const configFromPsl = await (0,
|
485
|
+
const configFromPsl = await (0, import_chunk_MSQTODVE.getConfig)({ datamodel: schemaResult.schemas, ignoreEnvVarErrors });
|
425
486
|
const primaryDatasource = configFromPsl.datasources.at(0);
|
426
487
|
const schemaRootDir = schemaResult.schemaRootDir || cwd;
|
427
488
|
return {
|
@@ -591,7 +652,7 @@ async function getGenerators(options) {
|
|
591
652
|
}
|
592
653
|
(0, import_chunk_5FJ3MENK.printConfigWarnings)(schemaContext.warnings);
|
593
654
|
const previewFeatures = (0, import_chunk_CRVLHWC5.extractPreviewFeatures)(schemaContext.generators);
|
594
|
-
const dmmf = await (0,
|
655
|
+
const dmmf = await (0, import_chunk_GIOVJ5SL.getDMMF)({
|
595
656
|
datamodel: schemaContext.schemaFiles,
|
596
657
|
previewFeatures
|
597
658
|
});
|
@@ -649,7 +710,7 @@ The generator needs to either define the \`defaultOutput\` path in the manifest
|
|
649
710
|
fromEnvVar: null
|
650
711
|
};
|
651
712
|
}
|
652
|
-
const datamodel = (0,
|
713
|
+
const datamodel = (0, import_chunk_BTWAF3S4.mergeSchemas)({ schemas: schemaContext.schemaFiles });
|
653
714
|
const envPaths = await getEnvPaths(schemaContext.schemaPath, { cwd: generator.output.value });
|
654
715
|
const options2 = {
|
655
716
|
datamodel,
|
@@ -733,7 +794,7 @@ generator gen {
|
|
733
794
|
debug5({ generatorBinaryPaths });
|
734
795
|
generator.setBinaryPaths(generatorBinaryPaths);
|
735
796
|
if (engineVersion !== version && generator.options && generator.manifest.requiresEngines.includes(queryEngineType) && generatorBinaryPaths[queryEngineType] && generatorBinaryPaths[queryEngineType]?.[binaryTarget]) {
|
736
|
-
const customDmmf = await (0,
|
797
|
+
const customDmmf = await (0, import_chunk_GIOVJ5SL.getDMMF)({
|
737
798
|
datamodel: schemaContext.schemaFiles,
|
738
799
|
previewFeatures
|
739
800
|
});
|
@@ -1008,7 +1069,7 @@ function checkUnsupportedDataProxy({
|
|
1008
1069
|
}
|
1009
1070
|
}
|
1010
1071
|
if (!schemaContext2?.primaryDatasource) return;
|
1011
|
-
const url = (0,
|
1072
|
+
const url = (0, import_chunk_MSQTODVE.resolveUrl)((0, import_chunk_MSQTODVE.getEffectiveUrl)(schemaContext2.primaryDatasource));
|
1012
1073
|
if (url?.startsWith("prisma://")) {
|
1013
1074
|
throw new Error(forbiddenCmdWithDataProxyFlagMessage(cmd));
|
1014
1075
|
}
|
@@ -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_HZP4ATW5_exports = {};
|
30
|
+
__export(chunk_HZP4ATW5_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_HZP4ATW5_exports);
|
36
|
+
var import_chunk_OIAO45HN = require("./chunk-OIAO45HN.js");
|
37
37
|
var import_chunk_WXRVYSYN = require("./chunk-WXRVYSYN.js");
|
38
38
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.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_OIAO45HN.require_package)();
|
46
46
|
var prismaSchemaWasmVersion = dependencies["@prisma/prisma-schema-wasm"];
|
47
47
|
globalThis.PRISMA_WASM_PANIC_REGISTRY = new import_chunk_WXRVYSYN.WasmPanicRegistry();
|