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