@prisma/internals 6.6.0-integration-push-xmzqvqxpztks.7 → 6.6.0-integration-feat-orm-693-d1-driver-create-migration-adapter-using-new-http-binding.3
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/Generator.d.ts +5 -23
- package/dist/Generator.js +2 -4
- package/dist/{chunk-RN2HKPE6.js → chunk-5IAGIQ5I.js} +8 -8
- package/dist/{chunk-3CHSHRZX.js → chunk-6727N6PT.js} +5 -5
- package/dist/chunk-72UZXEBG.js +28 -0
- package/dist/{chunk-TGNGIHD7.js → chunk-75AJJ2SV.js} +5 -5
- package/dist/{chunk-3R43ZQD7.js → chunk-ABTIXQDX.js} +4 -3
- package/dist/{chunk-2THINWCT.js → chunk-BTWAF3S4.js} +7 -7
- package/dist/chunk-BWGDP6B5.js +4948 -0
- package/dist/{chunk-BPDMLM32.js → chunk-DYVL6P7F.js} +13 -46
- package/dist/chunk-EUTJYQDW.js +46 -0
- package/dist/chunk-EWWOTVR3.js +52 -0
- package/dist/chunk-GHHABGYW.js +28 -0
- package/dist/{chunk-PL5KBFMT.js → chunk-GI3F44TM.js} +5 -5
- package/dist/{chunk-YPS4L25P.js → chunk-GIOVJ5SL.js} +8 -8
- package/dist/{chunk-I7MGLNDS.js → chunk-HX2VLZFY.js} +287 -111
- package/dist/{chunk-MJIP3FY5.js → chunk-K5W6WZ6E.js} +238 -6
- package/dist/{chunk-MGFEZIW7.js → chunk-LHESHKC2.js} +5 -5
- package/dist/{chunk-IMOWQZSF.js → chunk-LLOWNQI4.js} +8 -8
- package/dist/{chunk-S2R7ACYL.js → chunk-MSQTODVE.js} +8 -8
- package/dist/{chunk-7JDKTQ7P.js → chunk-MWJN65OB.js} +7 -7
- package/dist/{chunk-DXK2BUKM.js → chunk-N4XUH3VC.js} +5 -4
- package/dist/{chunk-C73SLFIL.js → chunk-PQE76XRR.js} +5 -5
- package/dist/chunk-QGJH4P4N.js +35 -0
- package/dist/{chunk-UPQKNKIW.js → chunk-TKUGTIBG.js} +5 -5
- package/dist/{chunk-2H6XXXKO.js → chunk-TV34NMBZ.js} +12 -15
- package/dist/{chunk-YKIDHO5L.js → chunk-UUO6X4LC.js} +8 -8
- package/dist/{chunk-IS4R7W5O.js → chunk-VAVGLPCV.js} +287 -111
- package/dist/{chunk-67I7CEQJ.js → chunk-VVPSLVOR.js} +7 -6
- package/dist/{chunk-XNFIABGN.js → chunk-VYWUZ7RB.js} +5 -5
- package/dist/{chunk-EHL2GLNE.js → chunk-XKIMYV5V.js} +5 -5
- package/dist/{chunk-AMDATEIM.js → chunk-XQSHUIJ5.js} +8 -8
- package/dist/cli/checkUnsupportedDataProxy.js +29 -23
- 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 +33 -26
- package/dist/cli/hashes.d.ts +2 -1
- package/dist/cli/hashes.js +29 -23
- package/dist/cli/schemaContext.d.ts +3 -4
- package/dist/cli/schemaContext.js +29 -23
- package/dist/engine-commands/errorHelpers.js +4 -4
- package/dist/engine-commands/formatSchema.js +28 -22
- package/dist/engine-commands/getConfig.js +10 -10
- package/dist/engine-commands/getDmmf.js +7 -7
- package/dist/engine-commands/index.js +37 -31
- 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.d.ts +15 -0
- package/dist/get-generators/generatorResolvers/generatorResolvers.js +138 -0
- package/dist/get-generators/generatorResolvers/prisma-client-js/auto-installation/findPrismaClientDir.d.ts +6 -0
- package/dist/get-generators/generatorResolvers/prisma-client-js/auto-installation/findPrismaClientDir.js +26 -0
- package/dist/get-generators/generatorResolvers/prisma-client-js/auto-installation/getPackageCmd.d.ts +9 -0
- package/dist/get-generators/generatorResolvers/prisma-client-js/auto-installation/getPackageCmd.js +26 -0
- package/dist/get-generators/generatorResolvers/prisma-client-js/auto-installation/runPackageCmd.d.ts +8 -0
- package/dist/get-generators/generatorResolvers/prisma-client-js/auto-installation/runPackageCmd.js +29 -0
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.d.ts +6 -0
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +138 -0
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/isYarnUsed.d.ts +1 -0
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/isYarnUsed.js +26 -0
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/resolve.d.ts +20 -0
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/resolve.js +26 -0
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/semverLt.d.ts +7 -0
- package/dist/{resolvePkg.js → get-generators/generatorResolvers/prisma-client-js/check-dependencies/semverLt.js} +6 -6
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/semverLt.test.d.ts +1 -0
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/semverLt.test.js +17 -0
- package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.d.ts +20 -0
- package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +139 -0
- package/dist/get-generators/getGenerators.d.ts +9 -18
- package/dist/get-generators/getGenerators.js +31 -25
- package/dist/getPackedPackage.js +3 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +60 -53
- package/dist/utils/getEnvPaths.js +28 -22
- package/dist/utils/getVersionFromPackageJson.js +3 -3
- package/dist/utils/loadEnvFile.js +28 -22
- package/dist/wasm.js +4 -4
- package/package.json +11 -10
- package/dist/resolvePkg.d.ts +0 -7
@@ -26,11 +26,14 @@ 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
|
+
checkTypeScriptVersion: () => checkTypeScriptVersion,
|
31
32
|
checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
|
33
|
+
debug: () => debug4,
|
32
34
|
forbiddenCmdWithDataProxyFlagMessage: () => forbiddenCmdWithDataProxyFlagMessage,
|
33
35
|
formatSchema: () => formatSchema,
|
36
|
+
generatorResolvers: () => generatorResolvers,
|
34
37
|
getBinaryTargetForCurrentPlatform: () => import_get_platform2.getBinaryTargetForCurrentPlatform,
|
35
38
|
getCLIPathHash: () => getCLIPathHash,
|
36
39
|
getEnvPaths: () => getEnvPaths,
|
@@ -39,41 +42,49 @@ __export(chunk_I7MGLNDS_exports, {
|
|
39
42
|
getNodeAPIName: () => import_get_platform2.getNodeAPIName,
|
40
43
|
getPrismaConfigFromPackageJson: () => getPrismaConfigFromPackageJson,
|
41
44
|
getProjectHash: () => getProjectHash,
|
45
|
+
getSchema: () => getSchema,
|
46
|
+
getSchemaDir: () => getSchemaDir,
|
42
47
|
getSchemaFromPackageJson: () => getSchemaFromPackageJson,
|
43
48
|
getSchemaWithPath: () => getSchemaWithPath,
|
44
49
|
getSchemaWithPathOptional: () => getSchemaWithPathOptional,
|
45
50
|
knownBinaryTargets: () => knownBinaryTargets,
|
46
51
|
loadEnvFile: () => loadEnvFile,
|
47
52
|
loadSchemaContext: () => loadSchemaContext,
|
48
|
-
|
53
|
+
prismaClientResolver: () => prismaClientResolver,
|
49
54
|
processSchemaResult: () => processSchemaResult,
|
50
55
|
skipIndex: () => skipIndex
|
51
56
|
});
|
52
|
-
module.exports = __toCommonJS(
|
57
|
+
module.exports = __toCommonJS(chunk_HX2VLZFY_exports);
|
58
|
+
var import_chunk_QGJH4P4N = require("./chunk-QGJH4P4N.js");
|
59
|
+
var import_chunk_GHHABGYW = require("./chunk-GHHABGYW.js");
|
60
|
+
var import_chunk_EUTJYQDW = require("./chunk-EUTJYQDW.js");
|
61
|
+
var import_chunk_EWWOTVR3 = require("./chunk-EWWOTVR3.js");
|
62
|
+
var import_chunk_72UZXEBG = require("./chunk-72UZXEBG.js");
|
53
63
|
var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
|
54
64
|
var import_chunk_EPXBOIA5 = require("./chunk-EPXBOIA5.js");
|
55
65
|
var import_chunk_RS2R7COT = require("./chunk-RS2R7COT.js");
|
56
66
|
var import_chunk_X3P4J7WW = require("./chunk-X3P4J7WW.js");
|
57
67
|
var import_chunk_LRU47BGE = require("./chunk-LRU47BGE.js");
|
58
|
-
var import_chunk_5FJ3MENK = require("./chunk-5FJ3MENK.js");
|
59
68
|
var import_chunk_UTJGRVMG = require("./chunk-UTJGRVMG.js");
|
60
|
-
var import_chunk_XLTQGAI2 = require("./chunk-XLTQGAI2.js");
|
61
69
|
var import_chunk_5V36RLCO = require("./chunk-5V36RLCO.js");
|
70
|
+
var import_chunk_5FJ3MENK = require("./chunk-5FJ3MENK.js");
|
62
71
|
var import_chunk_AZV6HVKA = require("./chunk-AZV6HVKA.js");
|
72
|
+
var import_chunk_XLTQGAI2 = require("./chunk-XLTQGAI2.js");
|
63
73
|
var import_chunk_HAGJ64PM = require("./chunk-HAGJ64PM.js");
|
64
74
|
var import_chunk_CRVLHWC5 = require("./chunk-CRVLHWC5.js");
|
65
|
-
var
|
66
|
-
var
|
67
|
-
var
|
68
|
-
var
|
69
|
-
var
|
75
|
+
var import_chunk_J77ZIDXB = require("./chunk-J77ZIDXB.js");
|
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");
|
70
81
|
var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
|
71
82
|
var import_chunk_M3GBKLGE = require("./chunk-M3GBKLGE.js");
|
72
|
-
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
73
83
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
74
|
-
var
|
84
|
+
var import_chunk_DYVL6P7F = require("./chunk-DYVL6P7F.js");
|
75
85
|
var import_chunk_IOIAK7V7 = require("./chunk-IOIAK7V7.js");
|
76
|
-
var
|
86
|
+
var import_chunk_K5W6WZ6E = require("./chunk-K5W6WZ6E.js");
|
87
|
+
var import_chunk_VVPSLVOR = require("./chunk-VVPSLVOR.js");
|
77
88
|
var import_chunk_ZJWZK45Z = require("./chunk-ZJWZK45Z.js");
|
78
89
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
79
90
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
@@ -91,20 +102,26 @@ var import_fetch_engine = require("@prisma/fetch-engine");
|
|
91
102
|
var import_get_platform = require("@prisma/get-platform");
|
92
103
|
var import_path3 = __toESM2(require("path"));
|
93
104
|
var import_debug4 = __toESM2(require("@prisma/debug"));
|
105
|
+
var import_fs2 = __toESM2(require("fs"));
|
106
|
+
var import_path4 = __toESM2(require("path"));
|
107
|
+
var import_debug5 = __toESM2(require("@prisma/debug"));
|
108
|
+
var import_fs3 = __toESM2(require("fs"));
|
109
|
+
var import_path5 = __toESM2(require("path"));
|
110
|
+
var import_debug6 = __toESM2(require("@prisma/debug"));
|
94
111
|
var import_node_path = __toESM2(require("node:path"));
|
95
112
|
var import_node_process = __toESM2(require("node:process"));
|
96
113
|
var import_node_path2 = __toESM2(require("node:path"));
|
97
114
|
var import_node_fs = __toESM2(require("node:fs"));
|
98
115
|
var import_node_url = require("node:url");
|
99
116
|
var import_node_fs2 = __toESM2(require("node:fs"));
|
100
|
-
var
|
101
|
-
var
|
117
|
+
var import_fs4 = __toESM2(require("fs"));
|
118
|
+
var import_path6 = __toESM2(require("path"));
|
102
119
|
var import_get_platform2 = require("@prisma/get-platform");
|
103
120
|
var debug = (0, import_debug2.default)("prisma:format");
|
104
121
|
async function formatSchema({ schemas }, inputFormattingOptions) {
|
105
122
|
if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
|
106
123
|
handleFormatPanic(() => {
|
107
|
-
|
124
|
+
import_chunk_LHESHKC2.prismaSchemaWasm.debug_panic();
|
108
125
|
});
|
109
126
|
}
|
110
127
|
const defaultFormattingOptions = {
|
@@ -121,10 +138,10 @@ async function formatSchema({ schemas }, inputFormattingOptions) {
|
|
121
138
|
const { formattedMultipleSchemas, lintDiagnostics } = handleFormatPanic(() => {
|
122
139
|
const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas), documentFormattingParams);
|
123
140
|
const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
|
124
|
-
const lintDiagnostics2 = (0,
|
141
|
+
const lintDiagnostics2 = (0, import_chunk_XKIMYV5V.lintSchema)({ schemas: formattedMultipleSchemas2 });
|
125
142
|
return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
|
126
143
|
});
|
127
|
-
const lintWarnings = (0,
|
144
|
+
const lintWarnings = (0, import_chunk_XKIMYV5V.getLintWarningsAsText)(lintDiagnostics);
|
128
145
|
if (lintWarnings && import_chunk_ZJWZK45Z.logger_exports.should.warn()) {
|
129
146
|
console.warn(lintWarnings);
|
130
147
|
}
|
@@ -151,7 +168,7 @@ function handleFormatPanic(tryCb) {
|
|
151
168
|
}
|
152
169
|
}
|
153
170
|
function formatWasm(schema, documentFormattingParams) {
|
154
|
-
const formattedSchema =
|
171
|
+
const formattedSchema = import_chunk_LHESHKC2.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
|
155
172
|
return formattedSchema;
|
156
173
|
}
|
157
174
|
var readFile = (0, import_util.promisify)(import_fs.default.readFile);
|
@@ -171,9 +188,6 @@ async function getSchemaWithPathOptional(schemaPathFromArgs, schemaPathFromConfi
|
|
171
188
|
}
|
172
189
|
return null;
|
173
190
|
}
|
174
|
-
function printSchemaLoadedMessage(schemaPath2) {
|
175
|
-
process.stdout.write((0, import_chunk_PG5FDKSF.dim)(`Prisma schema loaded from ${import_path.default.relative(process.cwd(), schemaPath2)}`) + "\n");
|
176
|
-
}
|
177
191
|
async function readSchemaFromSingleFile(schemaPath2) {
|
178
192
|
debug2("Reading schema from single file", schemaPath2);
|
179
193
|
const typeError = await (0, import_schema_files_loader.ensureType)(schemaPath2, "file");
|
@@ -195,7 +209,7 @@ async function readSchemaFromDirectory(schemaPath2) {
|
|
195
209
|
}
|
196
210
|
const files = await (0, import_schema_files_loader.loadSchemaFiles)(schemaPath2);
|
197
211
|
debug2("Loading config");
|
198
|
-
const config = await (0,
|
212
|
+
const config = await (0, import_chunk_MSQTODVE.getConfig)({
|
199
213
|
datamodel: files,
|
200
214
|
ignoreEnvVarErrors: true
|
201
215
|
});
|
@@ -269,16 +283,15 @@ function renderLookupError(error) {
|
|
269
283
|
function renderDefaultLookupError(error, cwd) {
|
270
284
|
const parts = [
|
271
285
|
`Could not find Prisma Schema that is required for this command.`,
|
272
|
-
`You can either provide it with ${(0, import_chunk_PG5FDKSF.green)(
|
273
|
-
|
274
|
-
|
275
|
-
`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.`,
|
276
289
|
"Checked following paths:\n"
|
277
290
|
];
|
278
291
|
const printedPaths = /* @__PURE__ */ new Set();
|
279
292
|
for (const failure of error.failures) {
|
280
|
-
const filePath = failure.path;
|
281
|
-
if (!printedPaths.has(failure.path)) {
|
293
|
+
const filePath = failure.rule.schemaPath.path;
|
294
|
+
if (!printedPaths.has(failure.rule.schemaPath.path)) {
|
282
295
|
parts.push(`${import_path.default.relative(cwd, filePath)}: ${renderLookupError(failure.error)}`);
|
283
296
|
printedPaths.add(filePath);
|
284
297
|
}
|
@@ -287,7 +300,7 @@ function renderDefaultLookupError(error, cwd) {
|
|
287
300
|
return parts.join("\n");
|
288
301
|
}
|
289
302
|
async function getPrismaConfigFromPackageJson(cwd) {
|
290
|
-
const pkgJson = await (0,
|
303
|
+
const pkgJson = await (0, import_chunk_K5W6WZ6E.readPackageUp)({ cwd, normalize: false });
|
291
304
|
const prismaPropertyFromPkgJson = pkgJson?.packageJson?.prisma;
|
292
305
|
if (!pkgJson) {
|
293
306
|
return null;
|
@@ -304,13 +317,21 @@ async function readSchemaFromPrismaConfigBasedLocation(schemaPathFromConfig) {
|
|
304
317
|
error: { kind: "PrismaConfigNotConfigured" }
|
305
318
|
};
|
306
319
|
}
|
307
|
-
|
308
|
-
if (
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
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
|
+
}
|
314
335
|
}
|
315
336
|
return schemaResult;
|
316
337
|
}
|
@@ -345,14 +366,51 @@ async function getSchemaFromPackageJson(cwd) {
|
|
345
366
|
return lookupResult;
|
346
367
|
}
|
347
368
|
async function getDefaultSchema(cwd, failures = []) {
|
348
|
-
const
|
349
|
-
|
350
|
-
|
351
|
-
|
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);
|
352
399
|
if (!schema.ok) {
|
353
|
-
failures.push({
|
400
|
+
failures.push({ rule, error: schema.error });
|
354
401
|
continue;
|
355
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
|
+
}
|
356
414
|
return schema;
|
357
415
|
}
|
358
416
|
return {
|
@@ -363,6 +421,28 @@ async function getDefaultSchema(cwd, failures = []) {
|
|
363
421
|
}
|
364
422
|
};
|
365
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
|
+
}
|
366
446
|
async function getProjectHash(schemaPathFromArgs, schemaPathFromConfig) {
|
367
447
|
const projectPath = (await getSchemaWithPath(schemaPathFromArgs, schemaPathFromConfig))?.schemaPath ?? process.cwd();
|
368
448
|
return import_crypto.default.createHash("sha256").update(projectPath).digest("hex").substring(0, 8);
|
@@ -377,35 +457,32 @@ async function loadSchemaContext({
|
|
377
457
|
printLoadMessage = true,
|
378
458
|
ignoreEnvVarErrors = false,
|
379
459
|
allowNull = false,
|
380
|
-
schemaPathArgumentName = "--schema"
|
381
|
-
cwd = process.cwd()
|
460
|
+
schemaPathArgumentName = "--schema"
|
382
461
|
} = {}) {
|
383
462
|
let schemaResult = null;
|
384
463
|
if (allowNull) {
|
385
464
|
schemaResult = await getSchemaWithPathOptional(schemaPathFromArg, schemaPathFromConfig, {
|
386
|
-
argumentName: schemaPathArgumentName
|
387
|
-
cwd
|
465
|
+
argumentName: schemaPathArgumentName
|
388
466
|
});
|
389
467
|
if (!schemaResult) return null;
|
390
468
|
} else {
|
391
469
|
schemaResult = await getSchemaWithPath(schemaPathFromArg, schemaPathFromConfig, {
|
392
|
-
argumentName: schemaPathArgumentName
|
393
|
-
cwd
|
470
|
+
argumentName: schemaPathArgumentName
|
394
471
|
});
|
395
472
|
}
|
396
|
-
return processSchemaResult({ schemaResult, printLoadMessage, ignoreEnvVarErrors
|
473
|
+
return processSchemaResult({ schemaResult, printLoadMessage, ignoreEnvVarErrors });
|
397
474
|
}
|
398
475
|
async function processSchemaResult({
|
399
476
|
schemaResult,
|
400
477
|
printLoadMessage = true,
|
401
|
-
ignoreEnvVarErrors = false
|
402
|
-
cwd = process.cwd()
|
478
|
+
ignoreEnvVarErrors = false
|
403
479
|
}) {
|
480
|
+
const cwd = process.cwd();
|
404
481
|
const loadedFromPathForLogMessages = import_path2.default.relative(cwd, schemaResult.schemaPath);
|
405
482
|
if (printLoadMessage) {
|
406
|
-
|
483
|
+
process.stdout.write((0, import_chunk_PG5FDKSF.dim)(`Prisma schema loaded from ${loadedFromPathForLogMessages}`) + "\n");
|
407
484
|
}
|
408
|
-
const configFromPsl = await (0,
|
485
|
+
const configFromPsl = await (0, import_chunk_MSQTODVE.getConfig)({ datamodel: schemaResult.schemas, ignoreEnvVarErrors });
|
409
486
|
const primaryDatasource = configFromPsl.datasources.at(0);
|
410
487
|
const schemaRootDir = schemaResult.schemaRootDir || cwd;
|
411
488
|
return {
|
@@ -427,25 +504,117 @@ function primaryDatasourceDirectory(primaryDatasource) {
|
|
427
504
|
}
|
428
505
|
return null;
|
429
506
|
}
|
430
|
-
var import_p_map = (0, import_chunk_4VNS5WPM.__toESM)((0,
|
431
|
-
var debug3 = (0,
|
432
|
-
async function
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
507
|
+
var import_p_map = (0, import_chunk_4VNS5WPM.__toESM)((0, import_chunk_K5W6WZ6E.require_p_map)());
|
508
|
+
var debug3 = (0, import_debug5.default)("prisma:generator");
|
509
|
+
async function checkTypeScriptVersion() {
|
510
|
+
const minVersion = "4.1.0";
|
511
|
+
try {
|
512
|
+
const typescriptPath = await (0, import_chunk_VVPSLVOR.resolvePkg)("typescript", {
|
513
|
+
basedir: process.cwd()
|
514
|
+
});
|
515
|
+
debug3("typescriptPath", typescriptPath);
|
516
|
+
const typescriptPkg = typescriptPath && import_path5.default.join(typescriptPath, "package.json");
|
517
|
+
if (typescriptPkg && import_fs3.default.existsSync(typescriptPkg)) {
|
518
|
+
const pjson = (0, import_chunk_4VNS5WPM.__require)(typescriptPkg);
|
519
|
+
const currentVersion = pjson.version;
|
520
|
+
if ((0, import_chunk_EUTJYQDW.semverLt)(currentVersion, minVersion)) {
|
521
|
+
import_chunk_ZJWZK45Z.logger_exports.warn(
|
522
|
+
`Prisma detected that your ${(0, import_chunk_PG5FDKSF.bold)(
|
523
|
+
"TypeScript"
|
524
|
+
)} version ${currentVersion} is outdated. If you want to use Prisma Client with TypeScript please update it to version ${(0, import_chunk_PG5FDKSF.bold)(
|
525
|
+
minVersion
|
526
|
+
)} or ${(0, import_chunk_PG5FDKSF.bold)("newer")}. ${(0, import_chunk_PG5FDKSF.dim)(`TypeScript found in: ${(0, import_chunk_PG5FDKSF.bold)(typescriptPath)}`)}`
|
527
|
+
);
|
528
|
+
}
|
529
|
+
}
|
530
|
+
} catch (e) {
|
531
|
+
}
|
532
|
+
}
|
533
|
+
var debug4 = (0, import_debug4.default)("prisma:generator");
|
534
|
+
async function prismaClientResolver(baseDir, version3) {
|
535
|
+
let prismaClientDir = await (0, import_chunk_EWWOTVR3.findPrismaClientDir)(baseDir);
|
536
|
+
debug4("baseDir", baseDir);
|
537
|
+
await checkTypeScriptVersion();
|
538
|
+
if (!prismaClientDir && !process.env.PRISMA_GENERATE_SKIP_AUTOINSTALL) {
|
539
|
+
let projectRoot = (0, import_chunk_J77ZIDXB.longestCommonPathPrefix)(baseDir, process.cwd());
|
540
|
+
debug4("projectRoot", projectRoot);
|
541
|
+
const warningTag = `${(0, import_chunk_PG5FDKSF.bold)("Warning:")} ${(0, import_chunk_PG5FDKSF.dim)("[Prisma auto-install on generate]")}`;
|
542
|
+
if (projectRoot === void 0) {
|
543
|
+
console.warn(
|
544
|
+
(0, import_chunk_PG5FDKSF.yellow)(
|
545
|
+
`${warningTag} The Prisma schema directory ${(0, import_chunk_PG5FDKSF.bold)(baseDir)} and the current working directory ${(0, import_chunk_PG5FDKSF.bold)(
|
546
|
+
process.cwd()
|
547
|
+
)} have no common ancestor. The Prisma schema directory will be used as the project root.`
|
548
|
+
)
|
549
|
+
);
|
550
|
+
projectRoot = baseDir;
|
551
|
+
}
|
552
|
+
if (!import_fs2.default.existsSync(import_path4.default.join(projectRoot, "package.json"))) {
|
553
|
+
console.warn(
|
554
|
+
(0, import_chunk_PG5FDKSF.yellow)(
|
555
|
+
`${warningTag} Prisma could not find a ${(0, import_chunk_PG5FDKSF.bold)("package.json")} file in the inferred project root ${(0, import_chunk_PG5FDKSF.bold)(
|
556
|
+
projectRoot
|
557
|
+
)}. During the next step, when an auto-install of Prisma package(s) will be attempted, it will then be created by your package manager on the appropriate level if necessary.`
|
558
|
+
)
|
559
|
+
);
|
560
|
+
}
|
561
|
+
const prismaCliDir = await (0, import_chunk_VVPSLVOR.resolvePkg)("prisma", { basedir: baseDir });
|
562
|
+
if (process.platform === "win32" && await (0, import_chunk_GHHABGYW.isYarnUsed)(baseDir)) {
|
563
|
+
const hasCli = (s) => prismaCliDir !== void 0 ? s : "";
|
564
|
+
const missingCli = (s) => prismaCliDir === void 0 ? s : "";
|
565
|
+
throw new Error(
|
566
|
+
`Could not resolve ${missingCli(`${(0, import_chunk_PG5FDKSF.bold)("prisma")} and `)}${(0, import_chunk_PG5FDKSF.bold)(
|
567
|
+
"@prisma/client"
|
568
|
+
)} in the current project. Please install ${hasCli("it")}${missingCli("them")} with ${missingCli(
|
569
|
+
`${(0, import_chunk_PG5FDKSF.bold)((0, import_chunk_PG5FDKSF.green)(`${await (0, import_chunk_72UZXEBG.getPackageCmd)(baseDir, "add", "prisma", "-D")}`))} and `
|
570
|
+
)}${(0, import_chunk_PG5FDKSF.bold)((0, import_chunk_PG5FDKSF.green)(`${await (0, import_chunk_72UZXEBG.getPackageCmd)(baseDir, "add", "@prisma/client")}`))}, and rerun ${(0, import_chunk_PG5FDKSF.bold)(
|
571
|
+
await (0, import_chunk_72UZXEBG.getPackageCmd)(baseDir, "execute", "prisma generate")
|
572
|
+
)} \u{1F64F}.`
|
573
|
+
);
|
574
|
+
}
|
575
|
+
if (!prismaCliDir) {
|
576
|
+
await (0, import_chunk_QGJH4P4N.runPackageCmd)(projectRoot, "add", `prisma@${version3 ?? "latest"}`, "-D", "--silent");
|
577
|
+
}
|
578
|
+
await (0, import_chunk_QGJH4P4N.runPackageCmd)(projectRoot, "add", `@prisma/client@${version3 ?? "latest"}`, "--silent");
|
579
|
+
prismaClientDir = await (0, import_chunk_EWWOTVR3.findPrismaClientDir)(import_path4.default.join(".", baseDir));
|
580
|
+
if (!prismaClientDir) {
|
581
|
+
throw new Error(
|
582
|
+
`Could not resolve @prisma/client despite the installation that we just tried.
|
583
|
+
Please try to install it by hand with ${(0, import_chunk_PG5FDKSF.bold)(
|
584
|
+
(0, import_chunk_PG5FDKSF.green)(`${await (0, import_chunk_72UZXEBG.getPackageCmd)(baseDir, "add", "@prisma/client")}`)
|
585
|
+
)} and rerun ${(0, import_chunk_PG5FDKSF.bold)(await (0, import_chunk_72UZXEBG.getPackageCmd)(baseDir, "execute", "prisma generate"))} \u{1F64F}.`
|
586
|
+
);
|
587
|
+
}
|
588
|
+
console.info(
|
589
|
+
`
|
590
|
+
\u2714 Installed the ${(0, import_chunk_PG5FDKSF.bold)((0, import_chunk_PG5FDKSF.green)("@prisma/client"))} and ${(0, import_chunk_PG5FDKSF.bold)((0, import_chunk_PG5FDKSF.green)("prisma"))} packages in your project`
|
443
591
|
);
|
444
592
|
}
|
593
|
+
if (!prismaClientDir) {
|
594
|
+
throw new Error(
|
595
|
+
`Could not resolve @prisma/client.
|
596
|
+
Please try to install it with ${(0, import_chunk_PG5FDKSF.bold)((0, import_chunk_PG5FDKSF.green)("npm install @prisma/client"))} and rerun ${(0, import_chunk_PG5FDKSF.bold)(
|
597
|
+
await (0, import_chunk_72UZXEBG.getPackageCmd)(baseDir, "execute", "prisma generate")
|
598
|
+
)} \u{1F64F}.`
|
599
|
+
);
|
600
|
+
}
|
601
|
+
return {
|
602
|
+
outputPath: prismaClientDir,
|
603
|
+
generatorPath: import_path4.default.resolve(prismaClientDir, "generator-build/index.js"),
|
604
|
+
isNode: true
|
605
|
+
};
|
606
|
+
}
|
607
|
+
var generatorResolvers = {
|
608
|
+
"prisma-client-js": prismaClientResolver
|
609
|
+
};
|
610
|
+
var debug5 = (0, import_debug3.default)("prisma:getGenerators");
|
611
|
+
async function getGenerators(options) {
|
445
612
|
const {
|
446
613
|
schemaPath,
|
447
|
-
|
614
|
+
providerAliases: aliases,
|
615
|
+
// do you get the pun?
|
448
616
|
version,
|
617
|
+
cliVersion,
|
449
618
|
printDownloadProgress,
|
450
619
|
overrideGenerators,
|
451
620
|
skipDownload,
|
@@ -483,7 +652,7 @@ async function getGenerators(options) {
|
|
483
652
|
}
|
484
653
|
(0, import_chunk_5FJ3MENK.printConfigWarnings)(schemaContext.warnings);
|
485
654
|
const previewFeatures = (0, import_chunk_CRVLHWC5.extractPreviewFeatures)(schemaContext.generators);
|
486
|
-
const dmmf = await (0,
|
655
|
+
const dmmf = await (0, import_chunk_GIOVJ5SL.getDMMF)({
|
487
656
|
datamodel: schemaContext.schemaFiles,
|
488
657
|
previewFeatures
|
489
658
|
});
|
@@ -499,34 +668,41 @@ async function getGenerators(options) {
|
|
499
668
|
try {
|
500
669
|
const generators = await (0, import_p_map.default)(
|
501
670
|
generatorConfigs,
|
502
|
-
async (
|
503
|
-
|
504
|
-
|
505
|
-
const
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
671
|
+
async (generator, index) => {
|
672
|
+
let generatorPath = (0, import_chunk_IOIAK7V7.parseEnvValue)(generator.provider);
|
673
|
+
let paths;
|
674
|
+
const baseDir = import_path3.default.dirname(generator.sourceFilePath ?? schemaContext.schemaRootDir);
|
675
|
+
const providerValue = (0, import_chunk_IOIAK7V7.parseEnvValue)(generator.provider);
|
676
|
+
if (aliases && aliases[providerValue]) {
|
677
|
+
generatorPath = aliases[providerValue].generatorPath;
|
678
|
+
paths = aliases[providerValue];
|
679
|
+
} else if (generatorResolvers[providerValue]) {
|
680
|
+
paths = await generatorResolvers[providerValue](baseDir, cliVersion);
|
681
|
+
generatorPath = paths.generatorPath;
|
682
|
+
}
|
683
|
+
const generatorInstance = new import_chunk_DYVL6P7F.Generator(generatorPath, generator, paths?.isNode);
|
513
684
|
await generatorInstance.init();
|
514
|
-
if (
|
515
|
-
|
516
|
-
value: import_path3.default.resolve(baseDir, (0, import_chunk_IOIAK7V7.parseEnvValue)(
|
685
|
+
if (generator.output) {
|
686
|
+
generator.output = {
|
687
|
+
value: import_path3.default.resolve(baseDir, (0, import_chunk_IOIAK7V7.parseEnvValue)(generator.output)),
|
688
|
+
fromEnvVar: null
|
689
|
+
};
|
690
|
+
generator.isCustomOutput = true;
|
691
|
+
} else if (paths) {
|
692
|
+
generator.output = {
|
693
|
+
value: paths.outputPath,
|
517
694
|
fromEnvVar: null
|
518
695
|
};
|
519
|
-
generatorConfig.isCustomOutput = true;
|
520
696
|
} else {
|
521
|
-
if (!generatorInstance.manifest
|
697
|
+
if (!generatorInstance.manifest || !generatorInstance.manifest.defaultOutput) {
|
522
698
|
throw new Error(
|
523
|
-
`Can't resolve output dir for generator ${(0, import_chunk_PG5FDKSF.bold)(
|
524
|
-
|
699
|
+
`Can't resolve output dir for generator ${(0, import_chunk_PG5FDKSF.bold)(generator.name)} with provider ${(0, import_chunk_PG5FDKSF.bold)(
|
700
|
+
generator.provider.value
|
525
701
|
)}.
|
526
|
-
|
702
|
+
The generator needs to either define the \`defaultOutput\` path in the manifest or you need to define \`output\` in the datamodel.prisma file.`
|
527
703
|
);
|
528
704
|
}
|
529
|
-
|
705
|
+
generator.output = {
|
530
706
|
value: await (0, import_chunk_2B26F5N3.resolveOutput)({
|
531
707
|
defaultOutput: generatorInstance.manifest.defaultOutput,
|
532
708
|
baseDir
|
@@ -534,12 +710,12 @@ You need to define \`output\` in the generator block in the schema file.`
|
|
534
710
|
fromEnvVar: null
|
535
711
|
};
|
536
712
|
}
|
537
|
-
const datamodel = (0,
|
538
|
-
const envPaths = await getEnvPaths(schemaContext.schemaPath, { cwd:
|
713
|
+
const datamodel = (0, import_chunk_BTWAF3S4.mergeSchemas)({ schemas: schemaContext.schemaFiles });
|
714
|
+
const envPaths = await getEnvPaths(schemaContext.schemaPath, { cwd: generator.output.value });
|
539
715
|
const options2 = {
|
540
716
|
datamodel,
|
541
717
|
datasources: schemaContext.datasources,
|
542
|
-
generator
|
718
|
+
generator,
|
543
719
|
dmmf,
|
544
720
|
otherGenerators: skipIndex(generatorConfigs, index),
|
545
721
|
schemaPath: schemaContext.schemaPath,
|
@@ -601,7 +777,7 @@ generator gen {
|
|
601
777
|
}
|
602
778
|
}
|
603
779
|
}
|
604
|
-
|
780
|
+
debug5("neededVersions", JSON.stringify(neededVersions, null, 2));
|
605
781
|
const binaryPathsByVersion = await (0, import_chunk_EPXBOIA5.getBinaryPathsByVersion)({
|
606
782
|
neededVersions,
|
607
783
|
binaryTarget,
|
@@ -615,17 +791,17 @@ generator gen {
|
|
615
791
|
const engineVersion = (0, import_chunk_X3P4J7WW.getEngineVersionForGenerator)(generator.manifest, version);
|
616
792
|
const binaryPaths = binaryPathsByVersion[engineVersion];
|
617
793
|
const generatorBinaryPaths = (0, import_chunk_5V36RLCO.pick)(binaryPaths, generator.manifest.requiresEngines);
|
618
|
-
|
794
|
+
debug5({ generatorBinaryPaths });
|
619
795
|
generator.setBinaryPaths(generatorBinaryPaths);
|
620
796
|
if (engineVersion !== version && generator.options && generator.manifest.requiresEngines.includes(queryEngineType) && generatorBinaryPaths[queryEngineType] && generatorBinaryPaths[queryEngineType]?.[binaryTarget]) {
|
621
|
-
const customDmmf = await (0,
|
797
|
+
const customDmmf = await (0, import_chunk_GIOVJ5SL.getDMMF)({
|
622
798
|
datamodel: schemaContext.schemaFiles,
|
623
799
|
previewFeatures
|
624
800
|
});
|
625
801
|
const options2 = { ...generator.options, dmmf: customDmmf };
|
626
|
-
|
627
|
-
|
628
|
-
|
802
|
+
debug5("generator.manifest.prettyName", generator.manifest.prettyName);
|
803
|
+
debug5("options", options2);
|
804
|
+
debug5("options.generator.binaryTargets", options2.generator.binaryTargets);
|
629
805
|
generator.setOptions(options2);
|
630
806
|
}
|
631
807
|
}
|
@@ -757,9 +933,9 @@ function locatePathSync(paths, {
|
|
757
933
|
}
|
758
934
|
}
|
759
935
|
}
|
760
|
-
function pathExistsSync(
|
936
|
+
function pathExistsSync(path9) {
|
761
937
|
try {
|
762
|
-
import_node_fs2.default.accessSync(
|
938
|
+
import_node_fs2.default.accessSync(path9);
|
763
939
|
return true;
|
764
940
|
} catch {
|
765
941
|
return false;
|
@@ -767,9 +943,9 @@ function pathExistsSync(path7) {
|
|
767
943
|
}
|
768
944
|
var findUpStop = Symbol("findUpStop");
|
769
945
|
function findUpMultipleSync(name, options2 = {}) {
|
770
|
-
let directory = import_node_path.default.resolve((0,
|
946
|
+
let directory = import_node_path.default.resolve((0, import_chunk_K5W6WZ6E.toPath)(options2.cwd) ?? "");
|
771
947
|
const { root } = import_node_path.default.parse(directory);
|
772
|
-
const stopAt = import_node_path.default.resolve(directory, (0,
|
948
|
+
const stopAt = import_node_path.default.resolve(directory, (0, import_chunk_K5W6WZ6E.toPath)(options2.stopAt) ?? root);
|
773
949
|
const limit = options2.limit ?? Number.POSITIVE_INFINITY;
|
774
950
|
const paths = [name].flat();
|
775
951
|
const runMatcher = (locateOptions) => {
|
@@ -802,7 +978,7 @@ function findUpSync(name, options2 = {}) {
|
|
802
978
|
const matches = findUpMultipleSync(name, { ...options2, limit: 1 });
|
803
979
|
return matches[0];
|
804
980
|
}
|
805
|
-
var
|
981
|
+
var debug6 = (0, import_debug6.default)("prisma:loadEnv");
|
806
982
|
async function getEnvPaths(schemaPath2, opts = { cwd: process.cwd() }) {
|
807
983
|
const rootEnvPath = getProjectRootEnvPath({ cwd: opts.cwd }) ?? null;
|
808
984
|
const schemaEnvPathFromArgs = schemaPathToEnvPath(schemaPath2);
|
@@ -833,16 +1009,16 @@ async function readSchemaPathFromPkgJson() {
|
|
833
1009
|
}
|
834
1010
|
function getProjectRootEnvPath(opts) {
|
835
1011
|
const pkgJsonPath = findUpSync((dir) => {
|
836
|
-
const pkgPath =
|
1012
|
+
const pkgPath = import_path6.default.join(dir, "package.json");
|
837
1013
|
if (pathExistsSync(pkgPath)) {
|
838
1014
|
try {
|
839
|
-
const pkg = JSON.parse(
|
1015
|
+
const pkg = JSON.parse(import_fs4.default.readFileSync(pkgPath, "utf8"));
|
840
1016
|
if (pkg["name"] !== ".prisma/client") {
|
841
|
-
|
1017
|
+
debug6(`project root found at ${pkgPath}`);
|
842
1018
|
return pkgPath;
|
843
1019
|
}
|
844
1020
|
} catch (e) {
|
845
|
-
|
1021
|
+
debug6(`skipping package.json at ${pkgPath}`);
|
846
1022
|
}
|
847
1023
|
}
|
848
1024
|
return void 0;
|
@@ -850,15 +1026,15 @@ function getProjectRootEnvPath(opts) {
|
|
850
1026
|
if (!pkgJsonPath) {
|
851
1027
|
return null;
|
852
1028
|
}
|
853
|
-
const candidate =
|
854
|
-
if (!
|
1029
|
+
const candidate = import_path6.default.join(import_path6.default.dirname(pkgJsonPath), ".env");
|
1030
|
+
if (!import_fs4.default.existsSync(candidate)) {
|
855
1031
|
return null;
|
856
1032
|
}
|
857
1033
|
return candidate;
|
858
1034
|
}
|
859
1035
|
function schemaPathToEnvPath(schemaPath2) {
|
860
1036
|
if (!schemaPath2) return null;
|
861
|
-
return
|
1037
|
+
return import_path6.default.join(import_path6.default.dirname(schemaPath2), ".env");
|
862
1038
|
}
|
863
1039
|
async function loadEnvFile({
|
864
1040
|
schemaPath: schemaPath2,
|
@@ -893,7 +1069,7 @@ function checkUnsupportedDataProxy({
|
|
893
1069
|
}
|
894
1070
|
}
|
895
1071
|
if (!schemaContext2?.primaryDatasource) return;
|
896
|
-
const url = (0,
|
1072
|
+
const url = (0, import_chunk_MSQTODVE.resolveUrl)((0, import_chunk_MSQTODVE.getEffectiveUrl)(schemaContext2.primaryDatasource));
|
897
1073
|
if (url?.startsWith("prisma://")) {
|
898
1074
|
throw new Error(forbiddenCmdWithDataProxyFlagMessage(cmd));
|
899
1075
|
}
|