@prisma/internals 6.6.0-dev.42 → 6.6.0-dev.50
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 +1 -1
- package/dist/{chunk-GEGMYJ7Y.js → chunk-2A2DVAFZ.js} +50 -111
- package/dist/{chunk-PUZXQDYP.js → chunk-2FV6HEOU.js} +8 -8
- package/dist/{chunk-TV34NMBZ.js → chunk-2H6XXXKO.js} +15 -12
- package/dist/{chunk-RKTHINSX.js → chunk-3TSSYJO2.js} +50 -111
- package/dist/{chunk-TWF5HAZ7.js → chunk-5FVVC4L4.js} +5 -5
- package/dist/{chunk-MNPLA23F.js → chunk-75AJJ2SV.js} +5 -5
- package/dist/{chunk-XWWRHR2Z.js → chunk-ABTIXQDX.js} +5 -3
- package/dist/{chunk-TTOY2EQP.js → chunk-AZWZO6OY.js} +5 -5
- package/dist/{chunk-EQVDLWDC.js → chunk-BTWAF3S4.js} +7 -7
- package/dist/{chunk-STFGL3KL.js → chunk-C7OA725J.js} +7 -7
- package/dist/{chunk-AN22HV4Y.js → chunk-CEST7ZUQ.js} +6 -4
- package/dist/{chunk-NGRZYX3I.js → chunk-GIOVJ5SL.js} +8 -8
- package/dist/{chunk-XUCSINP6.js → chunk-I4O7TXOG.js} +8 -8
- package/dist/{chunk-3ZFPLC2O.js → chunk-ISAD3N6L.js} +5 -5
- package/dist/{chunk-L5NNYEH3.js → chunk-LHESHKC2.js} +5 -5
- package/dist/{chunk-CPF2U6TN.js → chunk-MSQTODVE.js} +8 -8
- package/dist/{chunk-6WCZGQH5.js → chunk-PQE76XRR.js} +5 -5
- package/dist/{chunk-DQTWQONJ.js → chunk-V52H2SR4.js} +5 -5
- package/dist/{chunk-GLCSJAWZ.js → chunk-XKIMYV5V.js} +5 -5
- package/dist/{chunk-Z6ZBU4HL.js → chunk-XQSHUIJ5.js} +8 -8
- package/dist/{chunk-UYCSSJQD.js → chunk-XQYC6RGR.js} +8 -8
- package/dist/cli/checkUnsupportedDataProxy.js +13 -13
- package/dist/cli/directoryConfig.d.ts +1 -1
- package/dist/cli/directoryConfig.js +2 -2
- package/dist/cli/getSchema.d.ts +3 -28
- package/dist/cli/getSchema.js +16 -17
- package/dist/cli/hashes.d.ts +1 -2
- package/dist/cli/hashes.js +13 -13
- package/dist/cli/schemaContext.d.ts +5 -4
- package/dist/cli/schemaContext.js +13 -13
- package/dist/client/getClientEngineType.d.ts +1 -1
- package/dist/convertCredentials.d.ts +1 -1
- package/dist/engine-commands/errorHelpers.js +4 -4
- package/dist/engine-commands/formatSchema.js +12 -12
- package/dist/engine-commands/getConfig.d.ts +1 -1
- package/dist/engine-commands/getConfig.js +10 -10
- package/dist/engine-commands/getDmmf.d.ts +2 -1
- package/dist/engine-commands/getDmmf.js +7 -7
- package/dist/engine-commands/index.js +21 -21
- package/dist/engine-commands/lintSchema.js +8 -8
- package/dist/engine-commands/mergeSchemas.js +7 -7
- package/dist/engine-commands/validate.js +7 -7
- package/dist/get-generators/generatorResolvers/generatorResolvers.js +12 -12
- package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +12 -12
- package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +13 -13
- package/dist/get-generators/getGenerators.d.ts +1 -1
- package/dist/get-generators/getGenerators.js +15 -15
- package/dist/get-generators/utils/binaryTypeToEngineType.d.ts +1 -1
- package/dist/get-generators/utils/engineTypeToBinaryType.d.ts +1 -1
- package/dist/get-generators/utils/fixBinaryTargets.d.ts +1 -1
- package/dist/get-generators/utils/getBinaryPathsByVersion.d.ts +1 -1
- package/dist/get-generators/utils/getEngineVersionForGenerator.d.ts +1 -1
- package/dist/get-generators/utils/printGeneratorConfig.d.ts +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +40 -41
- package/dist/types.d.ts +1 -1
- package/dist/utils/extractPreviewFeatures.d.ts +1 -1
- package/dist/utils/getEnvPaths.d.ts +1 -1
- package/dist/utils/getEnvPaths.js +12 -12
- package/dist/utils/getVersionFromPackageJson.js +3 -3
- package/dist/utils/loadEnvFile.js +12 -12
- package/dist/utils/parseEnvValue.d.ts +1 -1
- package/dist/wasm.js +4 -4
- package/package.json +10 -8
package/dist/Generator.d.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { BinaryPaths, GeneratorConfig, GeneratorManifest, GeneratorOptions } from '@prisma/generator
|
1
|
+
import type { BinaryPaths, GeneratorConfig, GeneratorManifest, GeneratorOptions } from '@prisma/generator';
|
2
2
|
export declare class Generator {
|
3
3
|
private generatorProcess;
|
4
4
|
manifest: GeneratorManifest | null;
|
@@ -26,8 +26,8 @@ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__g
|
|
26
26
|
mod
|
27
27
|
));
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
29
|
-
var
|
30
|
-
__export(
|
29
|
+
var chunk_2A2DVAFZ_exports = {};
|
30
|
+
__export(chunk_2A2DVAFZ_exports, {
|
31
31
|
checkTypeScriptVersion: () => checkTypeScriptVersion,
|
32
32
|
checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
|
33
33
|
debug: () => debug4,
|
@@ -42,19 +42,18 @@ __export(chunk_GEGMYJ7Y_exports, {
|
|
42
42
|
getNodeAPIName: () => import_get_platform2.getNodeAPIName,
|
43
43
|
getPrismaConfigFromPackageJson: () => getPrismaConfigFromPackageJson,
|
44
44
|
getProjectHash: () => getProjectHash,
|
45
|
-
getSchema: () => getSchema,
|
46
|
-
getSchemaDir: () => getSchemaDir,
|
47
45
|
getSchemaFromPackageJson: () => getSchemaFromPackageJson,
|
48
46
|
getSchemaWithPath: () => getSchemaWithPath,
|
49
47
|
getSchemaWithPathOptional: () => getSchemaWithPathOptional,
|
50
48
|
knownBinaryTargets: () => knownBinaryTargets,
|
51
49
|
loadEnvFile: () => loadEnvFile,
|
52
50
|
loadSchemaContext: () => loadSchemaContext,
|
51
|
+
printSchemaLoadedMessage: () => printSchemaLoadedMessage,
|
53
52
|
prismaClientResolver: () => prismaClientResolver,
|
54
53
|
processSchemaResult: () => processSchemaResult,
|
55
54
|
skipIndex: () => skipIndex
|
56
55
|
});
|
57
|
-
module.exports = __toCommonJS(
|
56
|
+
module.exports = __toCommonJS(chunk_2A2DVAFZ_exports);
|
58
57
|
var import_chunk_QGJH4P4N = require("./chunk-QGJH4P4N.js");
|
59
58
|
var import_chunk_GHHABGYW = require("./chunk-GHHABGYW.js");
|
60
59
|
var import_chunk_EUTJYQDW = require("./chunk-EUTJYQDW.js");
|
@@ -73,11 +72,11 @@ var import_chunk_XLTQGAI2 = require("./chunk-XLTQGAI2.js");
|
|
73
72
|
var import_chunk_HAGJ64PM = require("./chunk-HAGJ64PM.js");
|
74
73
|
var import_chunk_CRVLHWC5 = require("./chunk-CRVLHWC5.js");
|
75
74
|
var import_chunk_J77ZIDXB = require("./chunk-J77ZIDXB.js");
|
76
|
-
var
|
77
|
-
var
|
78
|
-
var
|
79
|
-
var
|
80
|
-
var
|
75
|
+
var import_chunk_5FVVC4L4 = require("./chunk-5FVVC4L4.js");
|
76
|
+
var import_chunk_C7OA725J = require("./chunk-C7OA725J.js");
|
77
|
+
var import_chunk_2FV6HEOU = require("./chunk-2FV6HEOU.js");
|
78
|
+
var import_chunk_XQYC6RGR = require("./chunk-XQYC6RGR.js");
|
79
|
+
var import_chunk_ISAD3N6L = require("./chunk-ISAD3N6L.js");
|
81
80
|
var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
|
82
81
|
var import_chunk_M3GBKLGE = require("./chunk-M3GBKLGE.js");
|
83
82
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
@@ -121,7 +120,7 @@ var debug = (0, import_debug2.default)("prisma:format");
|
|
121
120
|
async function formatSchema({ schemas }, inputFormattingOptions) {
|
122
121
|
if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
|
123
122
|
handleFormatPanic(() => {
|
124
|
-
|
123
|
+
import_chunk_ISAD3N6L.prismaSchemaWasm.debug_panic();
|
125
124
|
});
|
126
125
|
}
|
127
126
|
const defaultFormattingOptions = {
|
@@ -138,10 +137,10 @@ async function formatSchema({ schemas }, inputFormattingOptions) {
|
|
138
137
|
const { formattedMultipleSchemas, lintDiagnostics } = handleFormatPanic(() => {
|
139
138
|
const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas), documentFormattingParams);
|
140
139
|
const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
|
141
|
-
const lintDiagnostics2 = (0,
|
140
|
+
const lintDiagnostics2 = (0, import_chunk_5FVVC4L4.lintSchema)({ schemas: formattedMultipleSchemas2 });
|
142
141
|
return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
|
143
142
|
});
|
144
|
-
const lintWarnings = (0,
|
143
|
+
const lintWarnings = (0, import_chunk_5FVVC4L4.getLintWarningsAsText)(lintDiagnostics);
|
145
144
|
if (lintWarnings && import_chunk_ZJWZK45Z.logger_exports.should.warn()) {
|
146
145
|
console.warn(lintWarnings);
|
147
146
|
}
|
@@ -168,7 +167,7 @@ function handleFormatPanic(tryCb) {
|
|
168
167
|
}
|
169
168
|
}
|
170
169
|
function formatWasm(schema, documentFormattingParams) {
|
171
|
-
const formattedSchema =
|
170
|
+
const formattedSchema = import_chunk_ISAD3N6L.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
|
172
171
|
return formattedSchema;
|
173
172
|
}
|
174
173
|
var readFile = (0, import_util.promisify)(import_fs.default.readFile);
|
@@ -188,6 +187,9 @@ async function getSchemaWithPathOptional(schemaPathFromArgs, schemaPathFromConfi
|
|
188
187
|
}
|
189
188
|
return null;
|
190
189
|
}
|
190
|
+
function printSchemaLoadedMessage(schemaPath2) {
|
191
|
+
process.stdout.write((0, import_chunk_PG5FDKSF.dim)(`Prisma schema loaded from ${import_path.default.relative(process.cwd(), schemaPath2)}`) + "\n");
|
192
|
+
}
|
191
193
|
async function readSchemaFromSingleFile(schemaPath2) {
|
192
194
|
debug2("Reading schema from single file", schemaPath2);
|
193
195
|
const typeError = await (0, import_schema_files_loader.ensureType)(schemaPath2, "file");
|
@@ -209,7 +211,7 @@ async function readSchemaFromDirectory(schemaPath2) {
|
|
209
211
|
}
|
210
212
|
const files = await (0, import_schema_files_loader.loadSchemaFiles)(schemaPath2);
|
211
213
|
debug2("Loading config");
|
212
|
-
const config = await (0,
|
214
|
+
const config = await (0, import_chunk_2FV6HEOU.getConfig)({
|
213
215
|
datamodel: files,
|
214
216
|
ignoreEnvVarErrors: true
|
215
217
|
});
|
@@ -283,15 +285,16 @@ function renderLookupError(error) {
|
|
283
285
|
function renderDefaultLookupError(error, cwd) {
|
284
286
|
const parts = [
|
285
287
|
`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
|
-
|
288
|
+
`You can either provide it with ${(0, import_chunk_PG5FDKSF.green)("`--schema`")} argument,`,
|
289
|
+
`set it in your ${(0, import_chunk_PG5FDKSF.green)("`prisma.config.ts`")},`,
|
290
|
+
`set it as ${(0, import_chunk_PG5FDKSF.green)("`prisma.schema`")} in your ${(0, import_chunk_PG5FDKSF.green)("package.json")},`,
|
291
|
+
`or put it into the default location (${(0, import_chunk_PG5FDKSF.green)("`./prisma/schema.prisma`")}, or ${(0, import_chunk_PG5FDKSF.green)("`./schema.prisma`")}.`,
|
289
292
|
"Checked following paths:\n"
|
290
293
|
];
|
291
294
|
const printedPaths = /* @__PURE__ */ new Set();
|
292
295
|
for (const failure of error.failures) {
|
293
|
-
const filePath = failure.
|
294
|
-
if (!printedPaths.has(failure.
|
296
|
+
const filePath = failure.path;
|
297
|
+
if (!printedPaths.has(failure.path)) {
|
295
298
|
parts.push(`${import_path.default.relative(cwd, filePath)}: ${renderLookupError(failure.error)}`);
|
296
299
|
printedPaths.add(filePath);
|
297
300
|
}
|
@@ -317,21 +320,13 @@ async function readSchemaFromPrismaConfigBasedLocation(schemaPathFromConfig) {
|
|
317
320
|
error: { kind: "PrismaConfigNotConfigured" }
|
318
321
|
};
|
319
322
|
}
|
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
|
-
}
|
323
|
+
const schemaResult = await readSchemaFromFileOrDirectory(schemaPathFromConfig);
|
324
|
+
if (!schemaResult.ok) {
|
325
|
+
throw new Error(
|
326
|
+
`Could not load schema from \`${schemaPathFromConfig}\` provided by "prisma.config.ts"\`: ${renderLookupError(
|
327
|
+
schemaResult.error
|
328
|
+
)}`
|
329
|
+
);
|
335
330
|
}
|
336
331
|
return schemaResult;
|
337
332
|
}
|
@@ -366,51 +361,14 @@ async function getSchemaFromPackageJson(cwd) {
|
|
366
361
|
return lookupResult;
|
367
362
|
}
|
368
363
|
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);
|
364
|
+
const lookupPaths = [import_path.default.join(cwd, "schema.prisma"), import_path.default.join(cwd, "prisma", "schema.prisma")];
|
365
|
+
for (const path9 of lookupPaths) {
|
366
|
+
debug2(`Checking existence of ${path9}`);
|
367
|
+
const schema = await readSchemaFromSingleFile(path9);
|
399
368
|
if (!schema.ok) {
|
400
|
-
failures.push({
|
369
|
+
failures.push({ path: path9, error: schema.error });
|
401
370
|
continue;
|
402
371
|
}
|
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
372
|
return schema;
|
415
373
|
}
|
416
374
|
return {
|
@@ -421,28 +379,6 @@ async function getDefaultSchema(cwd, failures = []) {
|
|
421
379
|
}
|
422
380
|
};
|
423
381
|
}
|
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
382
|
async function getProjectHash(schemaPathFromArgs, schemaPathFromConfig) {
|
447
383
|
const projectPath = (await getSchemaWithPath(schemaPathFromArgs, schemaPathFromConfig))?.schemaPath ?? process.cwd();
|
448
384
|
return import_crypto.default.createHash("sha256").update(projectPath).digest("hex").substring(0, 8);
|
@@ -457,32 +393,35 @@ async function loadSchemaContext({
|
|
457
393
|
printLoadMessage = true,
|
458
394
|
ignoreEnvVarErrors = false,
|
459
395
|
allowNull = false,
|
460
|
-
schemaPathArgumentName = "--schema"
|
396
|
+
schemaPathArgumentName = "--schema",
|
397
|
+
cwd = process.cwd()
|
461
398
|
} = {}) {
|
462
399
|
let schemaResult = null;
|
463
400
|
if (allowNull) {
|
464
401
|
schemaResult = await getSchemaWithPathOptional(schemaPathFromArg, schemaPathFromConfig, {
|
465
|
-
argumentName: schemaPathArgumentName
|
402
|
+
argumentName: schemaPathArgumentName,
|
403
|
+
cwd
|
466
404
|
});
|
467
405
|
if (!schemaResult) return null;
|
468
406
|
} else {
|
469
407
|
schemaResult = await getSchemaWithPath(schemaPathFromArg, schemaPathFromConfig, {
|
470
|
-
argumentName: schemaPathArgumentName
|
408
|
+
argumentName: schemaPathArgumentName,
|
409
|
+
cwd
|
471
410
|
});
|
472
411
|
}
|
473
|
-
return processSchemaResult({ schemaResult, printLoadMessage, ignoreEnvVarErrors });
|
412
|
+
return processSchemaResult({ schemaResult, printLoadMessage, ignoreEnvVarErrors, cwd });
|
474
413
|
}
|
475
414
|
async function processSchemaResult({
|
476
415
|
schemaResult,
|
477
416
|
printLoadMessage = true,
|
478
|
-
ignoreEnvVarErrors = false
|
417
|
+
ignoreEnvVarErrors = false,
|
418
|
+
cwd = process.cwd()
|
479
419
|
}) {
|
480
|
-
const cwd = process.cwd();
|
481
420
|
const loadedFromPathForLogMessages = import_path2.default.relative(cwd, schemaResult.schemaPath);
|
482
421
|
if (printLoadMessage) {
|
483
|
-
|
422
|
+
printSchemaLoadedMessage(loadedFromPathForLogMessages);
|
484
423
|
}
|
485
|
-
const configFromPsl = await (0,
|
424
|
+
const configFromPsl = await (0, import_chunk_2FV6HEOU.getConfig)({ datamodel: schemaResult.schemas, ignoreEnvVarErrors });
|
486
425
|
const primaryDatasource = configFromPsl.datasources.at(0);
|
487
426
|
const schemaRootDir = schemaResult.schemaRootDir || cwd;
|
488
427
|
return {
|
@@ -652,7 +591,7 @@ async function getGenerators(options) {
|
|
652
591
|
}
|
653
592
|
(0, import_chunk_5FJ3MENK.printConfigWarnings)(schemaContext.warnings);
|
654
593
|
const previewFeatures = (0, import_chunk_CRVLHWC5.extractPreviewFeatures)(schemaContext.generators);
|
655
|
-
const dmmf = await (0,
|
594
|
+
const dmmf = await (0, import_chunk_XQYC6RGR.getDMMF)({
|
656
595
|
datamodel: schemaContext.schemaFiles,
|
657
596
|
previewFeatures
|
658
597
|
});
|
@@ -710,7 +649,7 @@ The generator needs to either define the \`defaultOutput\` path in the manifest
|
|
710
649
|
fromEnvVar: null
|
711
650
|
};
|
712
651
|
}
|
713
|
-
const datamodel = (0,
|
652
|
+
const datamodel = (0, import_chunk_C7OA725J.mergeSchemas)({ schemas: schemaContext.schemaFiles });
|
714
653
|
const envPaths = await getEnvPaths(schemaContext.schemaPath, { cwd: generator.output.value });
|
715
654
|
const options2 = {
|
716
655
|
datamodel,
|
@@ -794,7 +733,7 @@ generator gen {
|
|
794
733
|
debug5({ generatorBinaryPaths });
|
795
734
|
generator.setBinaryPaths(generatorBinaryPaths);
|
796
735
|
if (engineVersion !== version && generator.options && generator.manifest.requiresEngines.includes(queryEngineType) && generatorBinaryPaths[queryEngineType] && generatorBinaryPaths[queryEngineType]?.[binaryTarget]) {
|
797
|
-
const customDmmf = await (0,
|
736
|
+
const customDmmf = await (0, import_chunk_XQYC6RGR.getDMMF)({
|
798
737
|
datamodel: schemaContext.schemaFiles,
|
799
738
|
previewFeatures
|
800
739
|
});
|
@@ -1069,7 +1008,7 @@ function checkUnsupportedDataProxy({
|
|
1069
1008
|
}
|
1070
1009
|
}
|
1071
1010
|
if (!schemaContext2?.primaryDatasource) return;
|
1072
|
-
const url = (0,
|
1011
|
+
const url = (0, import_chunk_2FV6HEOU.resolveUrl)((0, import_chunk_2FV6HEOU.getEffectiveUrl)(schemaContext2.primaryDatasource));
|
1073
1012
|
if (url?.startsWith("prisma://")) {
|
1074
1013
|
throw new Error(forbiddenCmdWithDataProxyFlagMessage(cmd));
|
1075
1014
|
}
|
@@ -26,20 +26,20 @@ 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_2FV6HEOU_exports = {};
|
30
|
+
__export(chunk_2FV6HEOU_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_2FV6HEOU_exports);
|
38
38
|
var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
|
39
39
|
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
40
40
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
41
|
-
var
|
42
|
-
var
|
41
|
+
var import_chunk_V52H2SR4 = require("./chunk-V52H2SR4.js");
|
42
|
+
var import_chunk_ISAD3N6L = require("./chunk-ISAD3N6L.js");
|
43
43
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
44
44
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
45
45
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
@@ -64,7 +64,7 @@ ${detailsHeader} ${message}`;
|
|
64
64
|
}).exhaustive();
|
65
65
|
const errorMessageWithContext = `${constructedErrorMessage}
|
66
66
|
[Context: getConfig]`;
|
67
|
-
super((0,
|
67
|
+
super((0, import_chunk_V52H2SR4.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
68
68
|
this.name = "GetConfigError";
|
69
69
|
}
|
70
70
|
};
|
@@ -89,7 +89,7 @@ async function getConfig(options) {
|
|
89
89
|
() => {
|
90
90
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_CONFIG) {
|
91
91
|
debug("Triggering a Rust panic...");
|
92
|
-
|
92
|
+
import_chunk_ISAD3N6L.prismaSchemaWasm.debug_panic();
|
93
93
|
}
|
94
94
|
const params = JSON.stringify({
|
95
95
|
prismaSchema: options.datamodel,
|
@@ -97,7 +97,7 @@ async function getConfig(options) {
|
|
97
97
|
ignoreEnvVarErrors: options.ignoreEnvVarErrors ?? false,
|
98
98
|
env: process.env
|
99
99
|
});
|
100
|
-
const data =
|
100
|
+
const data = import_chunk_ISAD3N6L.prismaSchemaWasm.get_config(params);
|
101
101
|
return data;
|
102
102
|
},
|
103
103
|
(e) => ({
|
@@ -26,21 +26,24 @@ 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_2H6XXXKO_exports = {};
|
30
|
+
__export(chunk_2H6XXXKO_exports, {
|
31
31
|
inferDirectoryConfig: () => inferDirectoryConfig
|
32
32
|
});
|
33
|
-
module.exports = __toCommonJS(
|
33
|
+
module.exports = __toCommonJS(chunk_2H6XXXKO_exports);
|
34
34
|
var import_path = __toESM(require("path"));
|
35
|
-
function inferDirectoryConfig(schemaContext) {
|
36
|
-
const
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
35
|
+
function inferDirectoryConfig(schemaContext, cwd = process.cwd()) {
|
36
|
+
const baseDir = (
|
37
|
+
// All default paths are relative to the `schema.prisma` file that contains the primary datasource.
|
38
|
+
// That schema file should usually be the users "root" aka main schema file.
|
39
|
+
schemaContext?.primaryDatasourceDirectory ?? // If no primary datasource exists we use the schemaRootDir.
|
40
|
+
// `schemaRootDir` is either the directory the user supplied as schemaPath or the directory the single schema file is in.
|
41
|
+
schemaContext?.schemaRootDir ?? // Should also that not be defined because there is no schema yet we fallback to CWD + `/prisma`.
|
42
|
+
import_path.default.join(cwd, "prisma")
|
43
|
+
);
|
41
44
|
return {
|
42
|
-
viewsDirPath,
|
43
|
-
typedSqlDirPath: import_path.default.join(
|
44
|
-
migrationsDirPath
|
45
|
+
viewsDirPath: import_path.default.join(baseDir, "views"),
|
46
|
+
typedSqlDirPath: import_path.default.join(baseDir, "sql"),
|
47
|
+
migrationsDirPath: import_path.default.join(baseDir, "migrations")
|
45
48
|
};
|
46
49
|
}
|