@prisma/internals 6.10.0-dev.4 → 6.10.0-dev.6
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-IEORMKTI.js → chunk-2XILTJ6F.js} +54 -66
- package/dist/{chunk-55RJHBMD.js → chunk-32I2OVXU.js} +5 -5
- package/dist/{chunk-OPNZJ66T.js → chunk-4HGVQYAY.js} +8 -8
- package/dist/{chunk-ALISKGOG.js → chunk-7UHEZFM3.js} +7 -7
- package/dist/{chunk-EPXBOIA5.js → chunk-F2OZV76L.js} +10 -5
- package/dist/{chunk-ASL6IKQY.js → chunk-F4UKKHKS.js} +6 -6
- package/dist/{chunk-TA7XAR7Q.js → chunk-FFAP6KGZ.js} +8 -8
- package/dist/{chunk-RWB5GZYW.js → chunk-FPJDKQJ4.js} +5 -5
- package/dist/{chunk-UHP3P7WJ.js → chunk-GCGNVBHT.js} +7 -7
- package/dist/{chunk-OVWYMR6U.js → chunk-J6W7FOAF.js} +8 -8
- package/dist/{chunk-3PC6RJ2R.js → chunk-KEJ2X2G4.js} +8 -8
- package/dist/{chunk-ZNMYMQH3.js → chunk-LFHCZX53.js} +5 -5
- package/dist/{chunk-QETFQGU5.js → chunk-MP65Z3BZ.js} +5 -5
- package/dist/{chunk-LNLOEMXM.js → chunk-MUNRY6HC.js} +8 -8
- package/dist/{chunk-AGSIYRTH.js → chunk-NYHSUWPC.js} +54 -66
- package/dist/{chunk-BREZO65N.js → chunk-SAG6D4GH.js} +8 -8
- package/dist/{chunk-LUEVA6ES.js → chunk-SKAKUYQB.js} +5 -5
- package/dist/{chunk-5PSUW3RA.js → chunk-T42XVBT4.js} +5 -5
- package/dist/{chunk-TPVOP24I.js → chunk-UZPMK7GX.js} +5 -5
- package/dist/{chunk-HOQOJ6L6.js → chunk-YJ7KM4I3.js} +5 -5
- package/dist/{chunk-M2GETUBE.js → chunk-ZQSJ4N7S.js} +5 -5
- package/dist/cli/checkUnsupportedDataProxy.js +13 -13
- package/dist/cli/checkUnsupportedSchemaEngineWasm.js +13 -13
- 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/getGenerators.d.ts +1 -1
- package/dist/get-generators/getGenerators.js +15 -15
- package/dist/get-generators/utils/getBinaryPathsByVersion.d.ts +5 -1
- package/dist/get-generators/utils/getBinaryPathsByVersion.js +2 -2
- package/dist/index.js +32 -32
- package/dist/utils/getVersionFromPackageJson.js +3 -3
- package/dist/wasm.js +5 -5
- package/package.json +13 -13
@@ -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_J6W7FOAF_exports = {};
|
30
|
+
__export(chunk_J6W7FOAF_exports, {
|
31
31
|
ValidateError: () => ValidateError,
|
32
32
|
validate: () => validate
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
34
|
+
module.exports = __toCommonJS(chunk_J6W7FOAF_exports);
|
35
35
|
var import_chunk_TZJROXB3 = require("./chunk-TZJROXB3.js");
|
36
36
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
37
37
|
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
38
|
-
var
|
39
|
-
var
|
38
|
+
var import_chunk_SKAKUYQB = require("./chunk-SKAKUYQB.js");
|
39
|
+
var import_chunk_YJ7KM4I3 = require("./chunk-YJ7KM4I3.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: validate]`;
|
62
|
-
super((0,
|
62
|
+
super((0, import_chunk_SKAKUYQB.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
63
63
|
this.name = "ValidateError";
|
64
64
|
}
|
65
65
|
};
|
@@ -71,13 +71,13 @@ function validate(options) {
|
|
71
71
|
() => {
|
72
72
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
|
73
73
|
debug("Triggering a Rust panic...");
|
74
|
-
|
74
|
+
import_chunk_YJ7KM4I3.prismaSchemaWasm.debug_panic();
|
75
75
|
}
|
76
76
|
const params = JSON.stringify({
|
77
77
|
prismaSchema: options.schemas,
|
78
78
|
noColor: Boolean(process.env.NO_COLOR)
|
79
79
|
});
|
80
|
-
|
80
|
+
import_chunk_YJ7KM4I3.prismaSchemaWasm.validate(params);
|
81
81
|
},
|
82
82
|
(e) => ({
|
83
83
|
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_KEJ2X2G4_exports = {};
|
30
|
+
__export(chunk_KEJ2X2G4_exports, {
|
31
31
|
GetDmmfError: () => GetDmmfError,
|
32
32
|
getDMMF: () => getDMMF
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
34
|
+
module.exports = __toCommonJS(chunk_KEJ2X2G4_exports);
|
35
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_UZPMK7GX = require("./chunk-UZPMK7GX.js");
|
38
|
+
var import_chunk_LFHCZX53 = require("./chunk-LFHCZX53.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_UZPMK7GX.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_LFHCZX53.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_LFHCZX53.prismaSchemaWasm.get_dmmf(params);
|
80
80
|
return data;
|
81
81
|
},
|
82
82
|
(e) => ({
|
@@ -26,15 +26,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
26
26
|
mod
|
27
27
|
));
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
var
|
30
|
-
__export(
|
29
|
+
var chunk_LFHCZX53_exports = {};
|
30
|
+
__export(chunk_LFHCZX53_exports, {
|
31
31
|
prismaSchemaWasm: () => import_prisma_schema_wasm.default,
|
32
32
|
prismaSchemaWasmVersion: () => prismaSchemaWasmVersion,
|
33
33
|
schemaEngineWasmVersion: () => schemaEngineWasmVersion,
|
34
34
|
wasm_exports: () => wasm_exports
|
35
35
|
});
|
36
|
-
module.exports = __toCommonJS(
|
37
|
-
var
|
36
|
+
module.exports = __toCommonJS(chunk_LFHCZX53_exports);
|
37
|
+
var import_chunk_F4UKKHKS = require("./chunk-F4UKKHKS.js");
|
38
38
|
var import_chunk_WXRVYSYN = require("./chunk-WXRVYSYN.js");
|
39
39
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
40
40
|
var import_prisma_schema_wasm = __toESM(require("@prisma/prisma-schema-wasm"));
|
@@ -46,6 +46,6 @@ var wasm_exports = {};
|
|
46
46
|
});
|
47
47
|
var globalWithPanicRegistry = globalThis;
|
48
48
|
globalWithPanicRegistry.PRISMA_WASM_PANIC_REGISTRY = new import_chunk_WXRVYSYN.WasmPanicRegistry();
|
49
|
-
var { dependencies } = (0,
|
49
|
+
var { dependencies } = (0, import_chunk_F4UKKHKS.require_package)();
|
50
50
|
var prismaSchemaWasmVersion = dependencies["@prisma/prisma-schema-wasm"];
|
51
51
|
var schemaEngineWasmVersion = dependencies["@prisma/schema-engine-wasm"];
|
@@ -16,20 +16,20 @@ 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_MP65Z3BZ_exports = {};
|
20
|
+
__export(chunk_MP65Z3BZ_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(
|
28
|
-
var
|
27
|
+
module.exports = __toCommonJS(chunk_MP65Z3BZ_exports);
|
28
|
+
var import_chunk_LFHCZX53 = require("./chunk-LFHCZX53.js");
|
29
29
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
30
30
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
31
31
|
function lintSchema({ schemas }) {
|
32
|
-
const lintResult =
|
32
|
+
const lintResult = import_chunk_LFHCZX53.prismaSchemaWasm.lint(JSON.stringify(schemas));
|
33
33
|
const lintDiagnostics = JSON.parse(lintResult);
|
34
34
|
return lintDiagnostics;
|
35
35
|
}
|
@@ -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_MUNRY6HC_exports = {};
|
30
|
+
__export(chunk_MUNRY6HC_exports, {
|
31
31
|
GetDmmfError: () => GetDmmfError,
|
32
32
|
getDMMF: () => getDMMF
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
34
|
+
module.exports = __toCommonJS(chunk_MUNRY6HC_exports);
|
35
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_SKAKUYQB = require("./chunk-SKAKUYQB.js");
|
38
|
+
var import_chunk_YJ7KM4I3 = require("./chunk-YJ7KM4I3.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_SKAKUYQB.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_YJ7KM4I3.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_YJ7KM4I3.prismaSchemaWasm.get_dmmf(params);
|
80
80
|
return data;
|
81
81
|
},
|
82
82
|
(e) => ({
|
@@ -17,7 +17,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
17
17
|
}
|
18
18
|
return to;
|
19
19
|
};
|
20
|
-
var
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
21
21
|
// If the importer is in node compatibility mode or this is not an ESM
|
22
22
|
// file that has been converted to a CommonJS file using a Babel-
|
23
23
|
// compatible transform (i.e. "__esModule" has not been set), then set
|
@@ -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_NYHSUWPC_exports = {};
|
30
|
+
__export(chunk_NYHSUWPC_exports, {
|
31
31
|
checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
|
32
32
|
checkUnsupportedSchemaEngineWasm: () => checkUnsupportedSchemaEngineWasm,
|
33
33
|
forbiddenCmdFlagWithSchemaEngineWasm: () => forbiddenCmdFlagWithSchemaEngineWasm,
|
@@ -42,11 +42,11 @@ __export(chunk_AGSIYRTH_exports, {
|
|
42
42
|
processSchemaResult: () => processSchemaResult,
|
43
43
|
skipIndex: () => skipIndex
|
44
44
|
});
|
45
|
-
module.exports = __toCommonJS(
|
45
|
+
module.exports = __toCommonJS(chunk_NYHSUWPC_exports);
|
46
46
|
var import_chunk_X3P4J7WW = require("./chunk-X3P4J7WW.js");
|
47
47
|
var import_chunk_LRU47BGE = require("./chunk-LRU47BGE.js");
|
48
48
|
var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
|
49
|
-
var
|
49
|
+
var import_chunk_F2OZV76L = require("./chunk-F2OZV76L.js");
|
50
50
|
var import_chunk_RS2R7COT = require("./chunk-RS2R7COT.js");
|
51
51
|
var import_chunk_5V36RLCO = require("./chunk-5V36RLCO.js");
|
52
52
|
var import_chunk_5FJ3MENK = require("./chunk-5FJ3MENK.js");
|
@@ -55,15 +55,14 @@ var import_chunk_AX5N26KG = require("./chunk-AX5N26KG.js");
|
|
55
55
|
var import_chunk_WXRTT6AT = require("./chunk-WXRTT6AT.js");
|
56
56
|
var import_chunk_I6WLABB2 = require("./chunk-I6WLABB2.js");
|
57
57
|
var import_chunk_CRVLHWC5 = require("./chunk-CRVLHWC5.js");
|
58
|
-
var
|
59
|
-
var
|
60
|
-
var
|
61
|
-
var
|
58
|
+
var import_chunk_4HGVQYAY = require("./chunk-4HGVQYAY.js");
|
59
|
+
var import_chunk_MUNRY6HC = require("./chunk-MUNRY6HC.js");
|
60
|
+
var import_chunk_ZQSJ4N7S = require("./chunk-ZQSJ4N7S.js");
|
61
|
+
var import_chunk_7UHEZFM3 = require("./chunk-7UHEZFM3.js");
|
62
62
|
var import_chunk_ZCBEMBHR = require("./chunk-ZCBEMBHR.js");
|
63
|
-
var
|
63
|
+
var import_chunk_YJ7KM4I3 = require("./chunk-YJ7KM4I3.js");
|
64
64
|
var import_chunk_ZJWZK45Z = require("./chunk-ZJWZK45Z.js");
|
65
65
|
var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
|
66
|
-
var import_chunk_M3GBKLGE = require("./chunk-M3GBKLGE.js");
|
67
66
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
68
67
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
69
68
|
var import_chunk_BPDMLM32 = require("./chunk-BPDMLM32.js");
|
@@ -71,13 +70,12 @@ var import_chunk_IOIAK7V7 = require("./chunk-IOIAK7V7.js");
|
|
71
70
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
72
71
|
var import_chunk_ZIFBTC6Y = require("./chunk-ZIFBTC6Y.js");
|
73
72
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
74
|
-
var import_path =
|
75
|
-
var import_debug =
|
76
|
-
var import_debug2 =
|
73
|
+
var import_path = __toESM(require("path"));
|
74
|
+
var import_debug = __toESM(require("@prisma/debug"));
|
75
|
+
var import_debug2 = __toESM(require("@prisma/debug"));
|
77
76
|
var import_engines = require("@prisma/engines");
|
78
|
-
var import_fetch_engine = require("@prisma/fetch-engine");
|
79
77
|
var import_get_platform = require("@prisma/get-platform");
|
80
|
-
var import_path2 =
|
78
|
+
var import_path2 = __toESM(require("path"));
|
81
79
|
var import_get_platform2 = require("@prisma/get-platform");
|
82
80
|
var forbiddenCmdFlagWithSchemaEngineWasm = ({ cmd, flag }) => `
|
83
81
|
Passing the ${(0, import_chunk_PG5FDKSF.green)(`${flag}`)} flag to the ${(0, import_chunk_PG5FDKSF.green)(`prisma ${cmd}`)} command is not supported when
|
@@ -104,7 +102,7 @@ var debug = (0, import_debug.default)("prisma:format");
|
|
104
102
|
async function formatSchema({ schemas }, inputFormattingOptions) {
|
105
103
|
if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
|
106
104
|
handleFormatPanic(() => {
|
107
|
-
|
105
|
+
import_chunk_YJ7KM4I3.prismaSchemaWasm.debug_panic();
|
108
106
|
});
|
109
107
|
}
|
110
108
|
const defaultFormattingOptions = {
|
@@ -121,10 +119,10 @@ async function formatSchema({ schemas }, inputFormattingOptions) {
|
|
121
119
|
const { formattedMultipleSchemas, lintDiagnostics } = handleFormatPanic(() => {
|
122
120
|
const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas), documentFormattingParams);
|
123
121
|
const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
|
124
|
-
const lintDiagnostics2 = (0,
|
122
|
+
const lintDiagnostics2 = (0, import_chunk_ZQSJ4N7S.lintSchema)({ schemas: formattedMultipleSchemas2 });
|
125
123
|
return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
|
126
124
|
});
|
127
|
-
const lintWarnings = (0,
|
125
|
+
const lintWarnings = (0, import_chunk_ZQSJ4N7S.getLintWarningsAsText)(lintDiagnostics);
|
128
126
|
if (lintWarnings && import_chunk_ZJWZK45Z.logger_exports.should.warn()) {
|
129
127
|
console.warn(lintWarnings);
|
130
128
|
}
|
@@ -151,7 +149,7 @@ function handleFormatPanic(tryCb) {
|
|
151
149
|
}
|
152
150
|
}
|
153
151
|
function formatWasm(schema, documentFormattingParams) {
|
154
|
-
const formattedSchema =
|
152
|
+
const formattedSchema = import_chunk_YJ7KM4I3.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
|
155
153
|
return formattedSchema;
|
156
154
|
}
|
157
155
|
async function loadSchemaContext({
|
@@ -188,7 +186,7 @@ async function processSchemaResult({
|
|
188
186
|
if (printLoadMessage) {
|
189
187
|
(0, import_chunk_ZCBEMBHR.printSchemaLoadedMessage)(loadedFromPathForLogMessages);
|
190
188
|
}
|
191
|
-
const configFromPsl = await (0,
|
189
|
+
const configFromPsl = await (0, import_chunk_4HGVQYAY.getConfig)({ datamodel: schemaResult.schemas, ignoreEnvVarErrors });
|
192
190
|
const primaryDatasource = configFromPsl.datasources.at(0);
|
193
191
|
const schemaRootDir = schemaResult.schemaRootDir || cwd;
|
194
192
|
return {
|
@@ -228,7 +226,7 @@ async function getGenerators(options) {
|
|
228
226
|
const {
|
229
227
|
schemaPath,
|
230
228
|
registry,
|
231
|
-
version,
|
229
|
+
version: version2,
|
232
230
|
printDownloadProgress,
|
233
231
|
overrideGenerators,
|
234
232
|
skipDownload,
|
@@ -243,30 +241,12 @@ async function getGenerators(options) {
|
|
243
241
|
if (!schemaContext) {
|
244
242
|
throw new Error(`no schema provided for getGenerators`);
|
245
243
|
}
|
246
|
-
const binaryTarget = await (0, import_get_platform.getBinaryTargetForCurrentPlatform)();
|
247
|
-
const queryEngineBinaryType = (0, import_engines.getCliQueryEngineBinaryType)();
|
248
|
-
const queryEngineType = (0, import_chunk_RS2R7COT.binaryTypeToEngineType)(queryEngineBinaryType);
|
249
|
-
if (version && !binaryPathsOverride?.[queryEngineType]) {
|
250
|
-
const potentialPath = eval(`require('path').join(__dirname, '..')`);
|
251
|
-
if (!potentialPath.match(import_chunk_M3GBKLGE.vercelPkgPathRegex)) {
|
252
|
-
const downloadParams = {
|
253
|
-
binaries: {
|
254
|
-
[queryEngineBinaryType]: potentialPath
|
255
|
-
},
|
256
|
-
binaryTargets: [binaryTarget],
|
257
|
-
showProgress: false,
|
258
|
-
version,
|
259
|
-
skipDownload
|
260
|
-
};
|
261
|
-
await (0, import_fetch_engine.download)(downloadParams);
|
262
|
-
}
|
263
|
-
}
|
264
244
|
if (!schemaContext.primaryDatasource) {
|
265
245
|
throw new Error(import_chunk_7QC5VORA.missingDatasource);
|
266
246
|
}
|
267
247
|
(0, import_chunk_5FJ3MENK.printConfigWarnings)(schemaContext.warnings);
|
268
248
|
const previewFeatures = (0, import_chunk_CRVLHWC5.extractPreviewFeatures)(schemaContext.generators);
|
269
|
-
const dmmf = await (0,
|
249
|
+
const dmmf = await (0, import_chunk_MUNRY6HC.getDMMF)({
|
270
250
|
datamodel: schemaContext.schemaFiles,
|
271
251
|
previewFeatures
|
272
252
|
});
|
@@ -317,7 +297,7 @@ You need to define \`output\` in the generator block in the schema file.`
|
|
317
297
|
fromEnvVar: null
|
318
298
|
};
|
319
299
|
}
|
320
|
-
const datamodel = (0,
|
300
|
+
const datamodel = (0, import_chunk_7UHEZFM3.mergeSchemas)({ schemas: schemaContext.schemaFiles });
|
321
301
|
const envPaths = await (0, import_chunk_WXRTT6AT.getEnvPaths)(schemaContext.schemaPath, { cwd: generatorConfig.output.value });
|
322
302
|
const options2 = {
|
323
303
|
datamodel,
|
@@ -327,7 +307,7 @@ You need to define \`output\` in the generator block in the schema file.`
|
|
327
307
|
otherGenerators: skipIndex(generatorConfigs, index),
|
328
308
|
schemaPath: schemaContext.schemaPath,
|
329
309
|
// TODO:(schemaPath) can we get rid of schema path passing here?
|
330
|
-
version:
|
310
|
+
version: version2 || import_engines.enginesVersion,
|
331
311
|
// this version makes no sense anymore and should be ignored
|
332
312
|
postinstall,
|
333
313
|
noEngine,
|
@@ -365,7 +345,7 @@ generator gen {
|
|
365
345
|
const neededVersions = /* @__PURE__ */ Object.create(null);
|
366
346
|
for (const g of generators) {
|
367
347
|
if (g.manifest && g.manifest.requiresEngines && Array.isArray(g.manifest.requiresEngines) && g.manifest.requiresEngines.length > 0) {
|
368
|
-
const neededVersion = (0, import_chunk_X3P4J7WW.getEngineVersionForGenerator)(g.manifest,
|
348
|
+
const neededVersion = (0, import_chunk_X3P4J7WW.getEngineVersionForGenerator)(g.manifest, version2);
|
369
349
|
if (!neededVersions[neededVersion]) {
|
370
350
|
neededVersions[neededVersion] = { engines: [], binaryTargets: [] };
|
371
351
|
}
|
@@ -384,24 +364,32 @@ generator gen {
|
|
384
364
|
}
|
385
365
|
}
|
386
366
|
}
|
367
|
+
const queryEngineBinaryType = (0, import_engines.getCliQueryEngineBinaryType)();
|
368
|
+
const queryEngineType = (0, import_chunk_RS2R7COT.binaryTypeToEngineType)(queryEngineBinaryType);
|
387
369
|
debug2("neededVersions", JSON.stringify(neededVersions, null, 2));
|
388
|
-
const binaryPathsByVersion = await (0,
|
370
|
+
const { binaryPathsByVersion, binaryTarget } = await (0, import_chunk_F2OZV76L.getBinaryPathsByVersion)({
|
389
371
|
neededVersions,
|
390
|
-
|
391
|
-
version
|
372
|
+
// We're lazily computing the binary target here, to avoid printing the
|
373
|
+
// `Prisma failed to detect the libssl/openssl version to use` warning
|
374
|
+
// on StackBlitz, where the binary target is not detected.
|
375
|
+
//
|
376
|
+
// On other platforms, it's safe and fast to call this function again,
|
377
|
+
// as its result is memoized anyway.
|
378
|
+
detectBinaryTarget: import_get_platform.getBinaryTargetForCurrentPlatform,
|
379
|
+
version: version2,
|
392
380
|
printDownloadProgress,
|
393
381
|
skipDownload,
|
394
382
|
binaryPathsOverride
|
395
383
|
});
|
396
384
|
for (const generator of generators) {
|
397
385
|
if (generator.manifest && generator.manifest.requiresEngines) {
|
398
|
-
const engineVersion = (0, import_chunk_X3P4J7WW.getEngineVersionForGenerator)(generator.manifest,
|
386
|
+
const engineVersion = (0, import_chunk_X3P4J7WW.getEngineVersionForGenerator)(generator.manifest, version2);
|
399
387
|
const binaryPaths = binaryPathsByVersion[engineVersion];
|
400
388
|
const generatorBinaryPaths = (0, import_chunk_5V36RLCO.pick)(binaryPaths ?? {}, generator.manifest.requiresEngines);
|
401
389
|
debug2({ generatorBinaryPaths });
|
402
390
|
generator.setBinaryPaths(generatorBinaryPaths);
|
403
|
-
if (engineVersion !==
|
404
|
-
const customDmmf = await (0,
|
391
|
+
if (engineVersion !== version2 && generator.options && generator.manifest.requiresEngines.includes(queryEngineType) && generatorBinaryPaths[queryEngineType] && generatorBinaryPaths[queryEngineType]?.[binaryTarget]) {
|
392
|
+
const customDmmf = await (0, import_chunk_MUNRY6HC.getDMMF)({
|
405
393
|
datamodel: schemaContext.schemaFiles,
|
406
394
|
previewFeatures
|
407
395
|
});
|
@@ -419,8 +407,8 @@ generator gen {
|
|
419
407
|
throw e;
|
420
408
|
}
|
421
409
|
}
|
422
|
-
async function getGenerator(
|
423
|
-
const generators = await getGenerators(
|
410
|
+
async function getGenerator(options) {
|
411
|
+
const generators = await getGenerators(options);
|
424
412
|
return generators[0];
|
425
413
|
}
|
426
414
|
function skipIndex(arr, index) {
|
@@ -433,7 +421,7 @@ var oldToNewBinaryTargetsMapping = {
|
|
433
421
|
"linux-glibc-libssl1.1.0": "debian-openssl1.1.x"
|
434
422
|
};
|
435
423
|
async function validateGenerators(generators) {
|
436
|
-
const
|
424
|
+
const binaryTarget = await (0, import_get_platform.getBinaryTargetForCurrentPlatform)();
|
437
425
|
for (const generator of generators) {
|
438
426
|
if (generator.config.platforms) {
|
439
427
|
throw new Error(
|
@@ -448,7 +436,7 @@ Please use the PRISMA_QUERY_ENGINE_BINARY env var instead to pin the binary targ
|
|
448
436
|
}
|
449
437
|
if (generator.binaryTargets) {
|
450
438
|
const binaryTargets2 = generator.binaryTargets && generator.binaryTargets.length > 0 ? generator.binaryTargets : [{ fromEnvVar: null, value: "native" }];
|
451
|
-
const resolvedBinaryTargets = binaryTargets2.flatMap((object) => (0, import_chunk_IOIAK7V7.parseBinaryTargetsEnvValue)(object)).map((p) => p === "native" ?
|
439
|
+
const resolvedBinaryTargets = binaryTargets2.flatMap((object) => (0, import_chunk_IOIAK7V7.parseBinaryTargetsEnvValue)(object)).map((p) => p === "native" ? binaryTarget : p);
|
452
440
|
for (const resolvedBinaryTarget of resolvedBinaryTargets) {
|
453
441
|
if (oldToNewBinaryTargetsMapping[resolvedBinaryTarget]) {
|
454
442
|
throw new Error(
|
@@ -464,10 +452,10 @@ Possible binaryTargets: ${(0, import_chunk_PG5FDKSF.green)(knownBinaryTargets.jo
|
|
464
452
|
);
|
465
453
|
}
|
466
454
|
}
|
467
|
-
if (!resolvedBinaryTargets.includes(
|
455
|
+
if (!resolvedBinaryTargets.includes(binaryTarget)) {
|
468
456
|
const originalBinaryTargetsConfig = (0, import_chunk_LRU47BGE.getOriginalBinaryTargetsValue)(generator.binaryTargets);
|
469
457
|
console.log(`${(0, import_chunk_PG5FDKSF.yellow)("Warning:")} Your current platform \`${(0, import_chunk_PG5FDKSF.bold)(
|
470
|
-
|
458
|
+
binaryTarget
|
471
459
|
)}\` is not included in your generator's \`binaryTargets\` configuration ${JSON.stringify(
|
472
460
|
originalBinaryTargetsConfig
|
473
461
|
)}.
|
@@ -475,11 +463,11 @@ To fix it, use this generator config in your ${(0, import_chunk_PG5FDKSF.bold)("
|
|
475
463
|
${(0, import_chunk_PG5FDKSF.green)(
|
476
464
|
(0, import_chunk_LRU47BGE.printGeneratorConfig)({
|
477
465
|
...generator,
|
478
|
-
binaryTargets: (0, import_chunk_X77CS5RK.fixBinaryTargets)(generator.binaryTargets,
|
466
|
+
binaryTargets: (0, import_chunk_X77CS5RK.fixBinaryTargets)(generator.binaryTargets, binaryTarget)
|
479
467
|
})
|
480
468
|
)}
|
481
469
|
${(0, import_chunk_PG5FDKSF.gray)(
|
482
|
-
`Note, that by providing \`native\`, Prisma Client automatically resolves \`${
|
470
|
+
`Note, that by providing \`native\`, Prisma Client automatically resolves \`${binaryTarget}\`.
|
483
471
|
Read more about deploying Prisma Client: ${(0, import_chunk_PG5FDKSF.underline)(
|
484
472
|
"https://www.prisma.io/docs/reference/tools-and-interfaces/prisma-schema/generators"
|
485
473
|
)}`
|
@@ -489,13 +477,13 @@ Read more about deploying Prisma Client: ${(0, import_chunk_PG5FDKSF.underline)(
|
|
489
477
|
}
|
490
478
|
}
|
491
479
|
}
|
492
|
-
function filterGenerators(generators,
|
493
|
-
if (
|
480
|
+
function filterGenerators(generators, generatorNames) {
|
481
|
+
if (generatorNames.length < 1) {
|
494
482
|
return generators;
|
495
483
|
}
|
496
|
-
const filtered = generators.filter((generator) =>
|
497
|
-
if (filtered.length !==
|
498
|
-
const missings =
|
484
|
+
const filtered = generators.filter((generator) => generatorNames.includes(generator.name));
|
485
|
+
if (filtered.length !== generatorNames.length) {
|
486
|
+
const missings = generatorNames.filter((name) => filtered.find((generator) => generator.name === name) == null);
|
499
487
|
const isSingular = missings.length <= 1;
|
500
488
|
throw new Error(
|
501
489
|
`The ${isSingular ? "generator" : "generators"} ${(0, import_chunk_PG5FDKSF.bold)(missings.join(", "))} specified via ${(0, import_chunk_PG5FDKSF.bold)(
|
@@ -513,7 +501,7 @@ More information about this limitation: ${(0, import_chunk_I6WLABB2.link)("https
|
|
513
501
|
`;
|
514
502
|
function checkUnsupportedDataProxy({
|
515
503
|
cmd,
|
516
|
-
schemaContext
|
504
|
+
schemaContext = void 0,
|
517
505
|
urls = []
|
518
506
|
}) {
|
519
507
|
for (const url2 of urls) {
|
@@ -521,8 +509,8 @@ function checkUnsupportedDataProxy({
|
|
521
509
|
throw new Error(forbiddenCmdWithDataProxyFlagMessage(cmd));
|
522
510
|
}
|
523
511
|
}
|
524
|
-
if (!
|
525
|
-
const url = (0,
|
512
|
+
if (!schemaContext?.primaryDatasource) return;
|
513
|
+
const url = (0, import_chunk_4HGVQYAY.resolveUrl)((0, import_chunk_4HGVQYAY.getEffectiveUrl)(schemaContext.primaryDatasource));
|
526
514
|
if (url?.startsWith("prisma://")) {
|
527
515
|
throw new Error(forbiddenCmdWithDataProxyFlagMessage(cmd));
|
528
516
|
}
|
@@ -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_SAG6D4GH_exports = {};
|
30
|
+
__export(chunk_SAG6D4GH_exports, {
|
31
31
|
ValidateError: () => ValidateError,
|
32
32
|
validate: () => validate
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
34
|
+
module.exports = __toCommonJS(chunk_SAG6D4GH_exports);
|
35
35
|
var import_chunk_TZJROXB3 = require("./chunk-TZJROXB3.js");
|
36
36
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
37
37
|
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
38
|
-
var
|
39
|
-
var
|
38
|
+
var import_chunk_UZPMK7GX = require("./chunk-UZPMK7GX.js");
|
39
|
+
var import_chunk_LFHCZX53 = require("./chunk-LFHCZX53.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: validate]`;
|
62
|
-
super((0,
|
62
|
+
super((0, import_chunk_UZPMK7GX.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
63
63
|
this.name = "ValidateError";
|
64
64
|
}
|
65
65
|
};
|
@@ -71,13 +71,13 @@ function validate(options) {
|
|
71
71
|
() => {
|
72
72
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
|
73
73
|
debug("Triggering a Rust panic...");
|
74
|
-
|
74
|
+
import_chunk_LFHCZX53.prismaSchemaWasm.debug_panic();
|
75
75
|
}
|
76
76
|
const params = JSON.stringify({
|
77
77
|
prismaSchema: options.schemas,
|
78
78
|
noColor: Boolean(process.env.NO_COLOR)
|
79
79
|
});
|
80
|
-
|
80
|
+
import_chunk_LFHCZX53.prismaSchemaWasm.validate(params);
|
81
81
|
},
|
82
82
|
(e) => ({
|
83
83
|
type: "wasm-error",
|
@@ -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_SKAKUYQB_exports = {};
|
20
|
+
__export(chunk_SKAKUYQB_exports, {
|
21
21
|
addVersionDetailsToErrorMessage: () => addVersionDetailsToErrorMessage
|
22
22
|
});
|
23
|
-
module.exports = __toCommonJS(
|
24
|
-
var
|
23
|
+
module.exports = __toCommonJS(chunk_SKAKUYQB_exports);
|
24
|
+
var import_chunk_32I2OVXU = require("./chunk-32I2OVXU.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_32I2OVXU.version]];
|
28
28
|
return `${message}
|
29
29
|
|
30
30
|
${(0, import_chunk_QN6PSQY7.formatTable)(rows)}`;
|
@@ -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_T42XVBT4_exports = {};
|
20
|
+
__export(chunk_T42XVBT4_exports, {
|
21
21
|
require_package: () => require_package
|
22
22
|
});
|
23
|
-
module.exports = __toCommonJS(
|
23
|
+
module.exports = __toCommonJS(chunk_T42XVBT4_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,8 +113,8 @@ 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.10.0-
|
117
|
-
"@prisma/schema-engine-wasm": "6.10.0-
|
116
|
+
"@prisma/prisma-schema-wasm": "6.10.0-5.a0a2003e0c13fc43fd48e4921e9f95a6fe295618",
|
117
|
+
"@prisma/schema-engine-wasm": "6.10.0-5.a0a2003e0c13fc43fd48e4921e9f95a6fe295618",
|
118
118
|
"@prisma/schema-files-loader": "workspace:*",
|
119
119
|
arg: "5.0.2",
|
120
120
|
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_UZPMK7GX_exports = {};
|
20
|
+
__export(chunk_UZPMK7GX_exports, {
|
21
21
|
addVersionDetailsToErrorMessage: () => addVersionDetailsToErrorMessage
|
22
22
|
});
|
23
|
-
module.exports = __toCommonJS(
|
24
|
-
var
|
23
|
+
module.exports = __toCommonJS(chunk_UZPMK7GX_exports);
|
24
|
+
var import_chunk_FPJDKQJ4 = require("./chunk-FPJDKQJ4.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_FPJDKQJ4.version]];
|
28
28
|
return `${message}
|
29
29
|
|
30
30
|
${(0, import_chunk_QN6PSQY7.formatTable)(rows)}`;
|