@prisma/internals 6.4.0-dev.52 → 6.4.0-dev.54
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-PLR4NGTL.js → chunk-2K2XI63H.js} +8 -8
- package/dist/{chunk-7IUXNMQN.js → chunk-5GKT3YLL.js} +5 -5
- package/dist/{chunk-5G7KCW2W.js → chunk-AI7X7EUG.js} +5 -5
- package/dist/{chunk-EHGYTB2W.js → chunk-B7G3GZFM.js} +7 -7
- package/dist/{chunk-UUOFJ3L7.js → chunk-CAFE5NHO.js} +7 -7
- package/dist/{chunk-XVEEPFYE.js → chunk-FAITWW26.js} +8 -8
- package/dist/{chunk-TFP2PT2F.js → chunk-FJCSJKMC.js} +8 -8
- package/dist/{chunk-AKACKNBA.js → chunk-GRK3XTH3.js} +8 -8
- package/dist/{chunk-I75T3XHR.js → chunk-GWR372US.js} +4 -4
- package/dist/{chunk-O5POCMIP.js → chunk-HETQ4SJU.js} +5 -5
- package/dist/{chunk-INH5LWZO.js → chunk-L2VWCVXE.js} +63 -35
- package/dist/{chunk-Y4LTKPZP.js → chunk-PYKSFBMQ.js} +8 -8
- package/dist/{chunk-CCJNOENV.js → chunk-QY472FLY.js} +8 -8
- package/dist/{chunk-FQMNIWO4.js → chunk-RCMVHIVH.js} +5 -5
- package/dist/{chunk-ZIPZKF5P.js → chunk-RIXONOI6.js} +5 -5
- package/dist/{chunk-KND4SOF3.js → chunk-SHFK6RCN.js} +63 -35
- package/dist/{chunk-S7K4NVXJ.js → chunk-TKJXNLL5.js} +5 -5
- package/dist/{chunk-TVLZHIWW.js → chunk-ULI2QEKS.js} +5 -5
- package/dist/{chunk-OHSLHSOR.js → chunk-V6LH7LFD.js} +5 -5
- package/dist/{chunk-EWNECZAE.js → chunk-XTQ6EZQW.js} +5 -5
- 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,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_PYKSFBMQ_exports = {};
|
30
|
+
__export(chunk_PYKSFBMQ_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_PYKSFBMQ_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_RIXONOI6 = require("./chunk-RIXONOI6.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_V6LH7LFD = require("./chunk-V6LH7LFD.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_RIXONOI6.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_V6LH7LFD.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_V6LH7LFD.prismaSchemaWasm.get_config(params);
|
102
102
|
return data;
|
103
103
|
},
|
104
104
|
(e) => ({
|
@@ -26,18 +26,18 @@ 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_QY472FLY_exports = {};
|
30
|
+
__export(chunk_QY472FLY_exports, {
|
31
31
|
GetDmmfError: () => GetDmmfError,
|
32
32
|
getDMMF: () => getDMMF
|
33
33
|
});
|
34
|
-
module.exports = __toCommonJS(
|
34
|
+
module.exports = __toCommonJS(chunk_QY472FLY_exports);
|
35
35
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
36
36
|
var import_chunk_6TXVGFQA = require("./chunk-6TXVGFQA.js");
|
37
|
-
var
|
37
|
+
var import_chunk_RCMVHIVH = require("./chunk-RCMVHIVH.js");
|
38
38
|
var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
|
39
39
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
40
|
-
var
|
40
|
+
var import_chunk_AI7X7EUG = require("./chunk-AI7X7EUG.js");
|
41
41
|
var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
|
42
42
|
var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
|
43
43
|
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: getDmmf]`;
|
63
|
-
super((0,
|
63
|
+
super((0, import_chunk_RCMVHIVH.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
64
64
|
this.name = "GetDmmfError";
|
65
65
|
}
|
66
66
|
};
|
@@ -90,13 +90,13 @@ async function getDMMF(options) {
|
|
90
90
|
() => {
|
91
91
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
|
92
92
|
debug("Triggering a Rust panic...");
|
93
|
-
|
93
|
+
import_chunk_AI7X7EUG.prismaSchemaWasm.debug_panic();
|
94
94
|
}
|
95
95
|
const params = JSON.stringify({
|
96
96
|
prismaSchema: datamodel,
|
97
97
|
noColor: Boolean(process.env.NO_COLOR)
|
98
98
|
});
|
99
|
-
const data =
|
99
|
+
const data = import_chunk_AI7X7EUG.prismaSchemaWasm.get_dmmf(params);
|
100
100
|
return data;
|
101
101
|
},
|
102
102
|
(e) => ({
|
@@ -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_RCMVHIVH_exports = {};
|
20
|
+
__export(chunk_RCMVHIVH_exports, {
|
21
21
|
addVersionDetailsToErrorMessage: () => addVersionDetailsToErrorMessage
|
22
22
|
});
|
23
|
-
module.exports = __toCommonJS(
|
24
|
-
var
|
23
|
+
module.exports = __toCommonJS(chunk_RCMVHIVH_exports);
|
24
|
+
var import_chunk_5GKT3YLL = require("./chunk-5GKT3YLL.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_5GKT3YLL.version]];
|
28
28
|
return `${message}
|
29
29
|
|
30
30
|
${(0, import_chunk_QN6PSQY7.formatTable)(rows)}`;
|
@@ -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_RIXONOI6_exports = {};
|
20
|
+
__export(chunk_RIXONOI6_exports, {
|
21
21
|
addVersionDetailsToErrorMessage: () => addVersionDetailsToErrorMessage
|
22
22
|
});
|
23
|
-
module.exports = __toCommonJS(
|
24
|
-
var
|
23
|
+
module.exports = __toCommonJS(chunk_RIXONOI6_exports);
|
24
|
+
var import_chunk_TKJXNLL5 = require("./chunk-TKJXNLL5.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_TKJXNLL5.version]];
|
28
28
|
return `${message}
|
29
29
|
|
30
30
|
${(0, import_chunk_QN6PSQY7.formatTable)(rows)}`;
|
@@ -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_SHFK6RCN_exports = {};
|
30
|
+
__export2(chunk_SHFK6RCN_exports, {
|
31
31
|
checkTypeScriptVersion: () => checkTypeScriptVersion,
|
32
32
|
checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
|
33
33
|
debug: () => debug6,
|
@@ -51,11 +51,10 @@ __export2(chunk_KND4SOF3_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_SHFK6RCN_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_CCJNOENV = require("./chunk-CCJNOENV.js");
|
82
|
+
var import_chunk_ULI2QEKS = require("./chunk-ULI2QEKS.js");
|
83
|
+
var import_chunk_CAFE5NHO = require("./chunk-CAFE5NHO.js");
|
84
|
+
var import_chunk_2K2XI63H = require("./chunk-2K2XI63H.js");
|
85
|
+
var import_chunk_QY472FLY = require("./chunk-QY472FLY.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_AI7X7EUG = require("./chunk-AI7X7EUG.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_2K2XI63H.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_2K2XI63H.getConfig)({ datamodel, ignoreEnvVarErrors: true });
|
15081
|
+
const url = (0, import_chunk_2K2XI63H.resolveUrl)((0, import_chunk_2K2XI63H.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_2K2XI63H.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_QY472FLY.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_CAFE5NHO.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_QY472FLY.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_AI7X7EUG.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_ULI2QEKS.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_ULI2QEKS.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_AI7X7EUG.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
|
15735
15763
|
return formattedSchema;
|
15736
15764
|
}
|
15737
15765
|
/*! Bundled license information:
|
@@ -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_TKJXNLL5_exports = {};
|
20
|
+
__export(chunk_TKJXNLL5_exports, {
|
21
21
|
version: () => version
|
22
22
|
});
|
23
|
-
module.exports = __toCommonJS(
|
24
|
-
var
|
25
|
-
var packageJson = (0,
|
23
|
+
module.exports = __toCommonJS(chunk_TKJXNLL5_exports);
|
24
|
+
var import_chunk_GWR372US = require("./chunk-GWR372US.js");
|
25
|
+
var packageJson = (0, import_chunk_GWR372US.require_package)();
|
26
26
|
var version = packageJson.version;
|
@@ -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_ULI2QEKS_exports = {};
|
20
|
+
__export(chunk_ULI2QEKS_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_ULI2QEKS_exports);
|
28
28
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
29
|
-
var
|
29
|
+
var import_chunk_AI7X7EUG = require("./chunk-AI7X7EUG.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_AI7X7EUG.prismaSchemaWasm.lint(JSON.stringify(schemas));
|
34
34
|
const lintDiagnostics = JSON.parse(lintResult);
|
35
35
|
return lintDiagnostics;
|
36
36
|
}
|
@@ -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_V6LH7LFD_exports = {};
|
30
|
+
__export(chunk_V6LH7LFD_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_V6LH7LFD_exports);
|
36
|
+
var import_chunk_GWR372US = require("./chunk-GWR372US.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_GWR372US.require_package)();
|
46
46
|
var prismaSchemaWasmVersion = dependencies["@prisma/prisma-schema-wasm"];
|
47
47
|
globalThis.PRISMA_WASM_PANIC_REGISTRY = new import_chunk_HOZFIXMD.WasmPanicRegistry();
|
@@ -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_XTQ6EZQW_exports = {};
|
20
|
+
__export(chunk_XTQ6EZQW_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_XTQ6EZQW_exports);
|
28
28
|
var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
|
29
|
-
var
|
29
|
+
var import_chunk_V6LH7LFD = require("./chunk-V6LH7LFD.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_V6LH7LFD.prismaSchemaWasm.lint(JSON.stringify(schemas));
|
34
34
|
const lintDiagnostics = JSON.parse(lintResult);
|
35
35
|
return lintDiagnostics;
|
36
36
|
}
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import type { O } from 'ts-toolbelt';
|
2
|
+
import type { SchemaPathFromConfig } from './getSchema';
|
2
3
|
/**
|
3
4
|
* These are the cli args that we check the data proxy for. If in use
|
4
5
|
*/
|
@@ -18,5 +19,5 @@ type Args = O.Optional<O.Update<typeof checkedArgs, any, string>>;
|
|
18
19
|
* @returns
|
19
20
|
*/
|
20
21
|
export declare const forbiddenCmdWithDataProxyFlagMessage: (command: string) => string;
|
21
|
-
export declare function checkUnsupportedDataProxy(command: string, args: Args, implicitSchema: boolean): Promise<void>;
|
22
|
+
export declare function checkUnsupportedDataProxy(command: string, args: Args, schemaPathFromConfig: SchemaPathFromConfig | undefined, implicitSchema: boolean): Promise<void>;
|
22
23
|
export {};
|
@@ -18,11 +18,11 @@ var __copyProps = (to, from, except, desc) => {
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
19
19
|
var checkUnsupportedDataProxy_exports = {};
|
20
20
|
__export(checkUnsupportedDataProxy_exports, {
|
21
|
-
checkUnsupportedDataProxy: () =>
|
22
|
-
forbiddenCmdWithDataProxyFlagMessage: () =>
|
21
|
+
checkUnsupportedDataProxy: () => import_chunk_SHFK6RCN.checkUnsupportedDataProxy,
|
22
|
+
forbiddenCmdWithDataProxyFlagMessage: () => import_chunk_SHFK6RCN.forbiddenCmdWithDataProxyFlagMessage
|
23
23
|
});
|
24
24
|
module.exports = __toCommonJS(checkUnsupportedDataProxy_exports);
|
25
|
-
var
|
25
|
+
var import_chunk_SHFK6RCN = require("../chunk-SHFK6RCN.js");
|
26
26
|
var import_chunk_EUTJYQDW = require("../chunk-EUTJYQDW.js");
|
27
27
|
var import_chunk_IPKE37QC = require("../chunk-IPKE37QC.js");
|
28
28
|
var import_chunk_PIPE5DSU = require("../chunk-PIPE5DSU.js");
|
@@ -74,22 +74,22 @@ var import_chunk_Y4TOGY6I = require("../chunk-Y4TOGY6I.js");
|
|
74
74
|
var import_chunk_IL7PSY44 = require("../chunk-IL7PSY44.js");
|
75
75
|
var import_chunk_AOQIUJT4 = require("../chunk-AOQIUJT4.js");
|
76
76
|
var import_chunk_L6KOIJJ5 = require("../chunk-L6KOIJJ5.js");
|
77
|
-
var
|
78
|
-
var
|
79
|
-
var
|
77
|
+
var import_chunk_ULI2QEKS = require("../chunk-ULI2QEKS.js");
|
78
|
+
var import_chunk_CAFE5NHO = require("../chunk-CAFE5NHO.js");
|
79
|
+
var import_chunk_GRK3XTH3 = require("../chunk-GRK3XTH3.js");
|
80
80
|
var import_chunk_TQCLUNM2 = require("../chunk-TQCLUNM2.js");
|
81
81
|
var import_chunk_OIVPX3BR = require("../chunk-OIVPX3BR.js");
|
82
82
|
var import_chunk_CYAS6B5N = require("../chunk-CYAS6B5N.js");
|
83
83
|
var import_chunk_HPVMQFIY = require("../chunk-HPVMQFIY.js");
|
84
84
|
var import_chunk_E23HYCQJ = require("../chunk-E23HYCQJ.js");
|
85
85
|
var import_chunk_MUPZUVSI = require("../chunk-MUPZUVSI.js");
|
86
|
-
var
|
87
|
-
var
|
86
|
+
var import_chunk_2K2XI63H = require("../chunk-2K2XI63H.js");
|
87
|
+
var import_chunk_QY472FLY = require("../chunk-QY472FLY.js");
|
88
88
|
var import_chunk_YRBRUREX = require("../chunk-YRBRUREX.js");
|
89
89
|
var import_chunk_6TXVGFQA = require("../chunk-6TXVGFQA.js");
|
90
90
|
var import_chunk_C47SCASR = require("../chunk-C47SCASR.js");
|
91
|
-
var
|
92
|
-
var
|
91
|
+
var import_chunk_RCMVHIVH = require("../chunk-RCMVHIVH.js");
|
92
|
+
var import_chunk_5GKT3YLL = require("../chunk-5GKT3YLL.js");
|
93
93
|
var import_chunk_QN6PSQY7 = require("../chunk-QN6PSQY7.js");
|
94
94
|
var import_chunk_OYLZC5OV = require("../chunk-OYLZC5OV.js");
|
95
95
|
var import_chunk_PFLLVWZX = require("../chunk-PFLLVWZX.js");
|
@@ -97,8 +97,8 @@ var import_chunk_IWJ2BUYF = require("../chunk-IWJ2BUYF.js");
|
|
97
97
|
var import_chunk_I7IEEULS = require("../chunk-I7IEEULS.js");
|
98
98
|
var import_chunk_DZYINYAA = require("../chunk-DZYINYAA.js");
|
99
99
|
var import_chunk_XKZ6CBLA = require("../chunk-XKZ6CBLA.js");
|
100
|
-
var
|
101
|
-
var
|
100
|
+
var import_chunk_AI7X7EUG = require("../chunk-AI7X7EUG.js");
|
101
|
+
var import_chunk_HETQ4SJU = require("../chunk-HETQ4SJU.js");
|
102
102
|
var import_chunk_6JE6QGSJ = require("../chunk-6JE6QGSJ.js");
|
103
103
|
var import_chunk_QVVSDACW = require("../chunk-QVVSDACW.js");
|
104
104
|
var import_chunk_XYCIH36R = require("../chunk-XYCIH36R.js");
|
package/dist/cli/getSchema.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { GetSchemaResult,
|
1
|
+
import type { GetSchemaResult, SuccessfulLookupResult } from '@prisma/schema-files-loader';
|
2
2
|
import type { MultipleSchemas } from '../utils/schemaFileInput';
|
3
3
|
type PackageJsonLookupResult = SuccessfulLookupResult | {
|
4
4
|
ok: false;
|
@@ -6,6 +6,26 @@ type PackageJsonLookupResult = SuccessfulLookupResult | {
|
|
6
6
|
kind: 'PackageJsonNotConfigured';
|
7
7
|
};
|
8
8
|
};
|
9
|
+
export type SchemaPathFromConfig = {
|
10
|
+
/**
|
11
|
+
* Tell Prisma to use a single `.prisma` schema file.
|
12
|
+
*/
|
13
|
+
kind: 'single';
|
14
|
+
/**
|
15
|
+
* The path to a single `.prisma` schema file.
|
16
|
+
*/
|
17
|
+
filenamePath: string;
|
18
|
+
} | {
|
19
|
+
/**
|
20
|
+
* Tell Prisma to use multiple `.prisma` schema files, via the `prismaSchemaFolder` preview feature.
|
21
|
+
*/
|
22
|
+
kind: 'multi';
|
23
|
+
/**
|
24
|
+
* The path to a folder containing multiple `.prisma` schema files.
|
25
|
+
* All of the files in this folder will be used.
|
26
|
+
*/
|
27
|
+
folder: string;
|
28
|
+
};
|
9
29
|
export type GetSchemaOptions = {
|
10
30
|
cwd?: string;
|
11
31
|
argumentName?: string;
|
@@ -13,20 +33,21 @@ export type GetSchemaOptions = {
|
|
13
33
|
/**
|
14
34
|
* Loads the schema, throws an error if it is not found
|
15
35
|
* @param schemaPathFromArgs
|
36
|
+
* @param schemaPathFromConfig
|
16
37
|
* @param opts
|
17
38
|
*/
|
18
|
-
export declare function getSchemaWithPath(schemaPathFromArgs?: string, { cwd, argumentName }?: GetSchemaOptions): Promise<GetSchemaResult>;
|
39
|
+
export declare function getSchemaWithPath(schemaPathFromArgs?: string, schemaPathFromConfig?: SchemaPathFromConfig, { cwd, argumentName }?: GetSchemaOptions): Promise<GetSchemaResult>;
|
19
40
|
/**
|
20
41
|
* Loads the schema, returns null if it is not found
|
21
42
|
* Throws an error if schema is specified explicitly in
|
22
43
|
* any of the available ways (argument, package.json config), but
|
23
44
|
* can not be loaded
|
24
45
|
* @param schemaPathFromArgs
|
25
|
-
* @param
|
46
|
+
* @param schemaPathFromConfig
|
47
|
+
* @param opts
|
26
48
|
* @returns
|
27
49
|
*/
|
28
|
-
export declare function getSchemaWithPathOptional(schemaPathFromArgs?: string, { cwd, argumentName }?: GetSchemaOptions): Promise<GetSchemaResult | null>;
|
29
|
-
export declare function readSchemaFromSingleFile(schemaPath: string): Promise<LookupResult>;
|
50
|
+
export declare function getSchemaWithPathOptional(schemaPathFromArgs?: string, schemaPathFromConfig?: SchemaPathFromConfig, { cwd, argumentName }?: GetSchemaOptions): Promise<GetSchemaResult | null>;
|
30
51
|
export type PrismaConfig = {
|
31
52
|
schema?: string;
|
32
53
|
seed?: string;
|
@@ -40,5 +61,5 @@ export declare function getSchemaFromPackageJson(cwd: string): Promise<PackageJs
|
|
40
61
|
* Small helper that returns the directory which contains the `schema.prisma` file
|
41
62
|
*/
|
42
63
|
export declare function getSchemaDir(schemaPathFromArgs?: string): Promise<string | null>;
|
43
|
-
export declare function getSchema(schemaPathFromArgs?: string): Promise<MultipleSchemas>;
|
64
|
+
export declare function getSchema(schemaPathFromArgs?: string, schemaPathFromConfig?: SchemaPathFromConfig): Promise<MultipleSchemas>;
|
44
65
|
export {};
|