@prisma/internals 6.20.0-integration-next.4 → 6.20.0-integration-next.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-E4PYP2ZV.js → chunk-4YZTUZQX.js} +5 -5
- package/dist/chunk-5SAWCTGN.js +46 -0
- package/dist/{chunk-YJSJK7EC.js → chunk-6AE3ZTJ6.js} +8 -8
- package/dist/{chunk-3D4RRUYX.js → chunk-6INUGSFR.js} +28 -27
- package/dist/{chunk-TQZ7VRPF.js → chunk-BTE2BLVE.js} +5 -5
- package/dist/{chunk-OSMLJTQN.js → chunk-CGDIZWKV.js} +4 -4
- package/dist/{chunk-7SF6QSKE.js → chunk-ER4RE4VE.js} +5 -5
- package/dist/{chunk-H4QG5ONG.js → chunk-MVXWH6SD.js} +8 -8
- package/dist/{chunk-Q5EKGHVB.js → chunk-OXD2JEEF.js} +5 -5
- package/dist/{chunk-65KNJHQS.js → chunk-QIFU7FBS.js} +8 -8
- package/dist/{chunk-J757IEPK.js → chunk-R5OZXPSF.js} +16 -15
- package/dist/{chunk-X6TWTGK6.js → chunk-TCASXHTD.js} +7 -7
- package/dist/{chunk-CIGXHXCG.js → chunk-TGA7DC5A.js} +7 -7
- package/dist/{chunk-VNIE2AZB.js → chunk-TQCLUNM2.js} +4 -4
- package/dist/{chunk-7X4RB4O5.js → chunk-WXZ6MOHE.js} +5 -5
- package/dist/cli/checkUnsupportedDataProxy.d.ts +7 -8
- package/dist/cli/checkUnsupportedDataProxy.js +17 -16
- package/dist/cli/directoryConfig.d.ts +5 -2
- package/dist/cli/schemaContext.d.ts +0 -2
- package/dist/cli/schemaContext.js +18 -17
- package/dist/engine-commands/errorHelpers.js +4 -4
- package/dist/engine-commands/formatSchema.js +16 -15
- package/dist/engine-commands/getConfig.js +7 -7
- package/dist/engine-commands/getDmmf.js +7 -7
- package/dist/engine-commands/index.js +23 -22
- 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.js +19 -18
- package/dist/highlight/highlight.js +5 -5
- package/dist/index.d.ts +2 -1
- package/dist/index.js +37 -35
- package/dist/types.d.ts +15 -0
- package/dist/utils/getVersionFromPackageJson.js +3 -3
- package/dist/utils/missingDatasource.js +4 -4
- package/dist/utils/missingGeneratorMessage.js +6 -6
- package/dist/utils/validatePrismaConfigWithDatasource.d.ts +15 -0
- package/dist/utils/validatePrismaConfigWithDatasource.js +28 -0
- package/dist/wasm.js +5 -5
- package/package.json +11 -11
|
@@ -16,20 +16,20 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_4YZTUZQX_exports = {};
|
|
20
|
+
__export(chunk_4YZTUZQX_exports, {
|
|
21
21
|
getLintWarnings: () => getLintWarnings,
|
|
22
22
|
getLintWarningsAsText: () => getLintWarningsAsText,
|
|
23
23
|
handleLintPanic: () => handleLintPanic,
|
|
24
24
|
lintSchema: () => lintSchema,
|
|
25
25
|
warningToString: () => warningToString
|
|
26
26
|
});
|
|
27
|
-
module.exports = __toCommonJS(
|
|
28
|
-
var
|
|
27
|
+
module.exports = __toCommonJS(chunk_4YZTUZQX_exports);
|
|
28
|
+
var import_chunk_OXD2JEEF = require("./chunk-OXD2JEEF.js");
|
|
29
29
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
30
30
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
31
31
|
function lintSchema({ schemas }) {
|
|
32
|
-
const lintResult =
|
|
32
|
+
const lintResult = import_chunk_OXD2JEEF.prismaSchemaWasm.lint(JSON.stringify(schemas));
|
|
33
33
|
const lintDiagnostics = JSON.parse(lintResult);
|
|
34
34
|
return lintDiagnostics;
|
|
35
35
|
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var chunk_5SAWCTGN_exports = {};
|
|
20
|
+
__export(chunk_5SAWCTGN_exports, {
|
|
21
|
+
ConfigValidationError: () => ConfigValidationError,
|
|
22
|
+
validatePrismaConfigWithDatasource: () => validatePrismaConfigWithDatasource
|
|
23
|
+
});
|
|
24
|
+
module.exports = __toCommonJS(chunk_5SAWCTGN_exports);
|
|
25
|
+
var import_chunk_ANU3HEGF = require("./chunk-ANU3HEGF.js");
|
|
26
|
+
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
27
|
+
var ConfigValidationError = class extends Error {
|
|
28
|
+
constructor(message) {
|
|
29
|
+
super(message);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
(0, import_chunk_ANU3HEGF.setClassName)(ConfigValidationError, "ConfigValidationError");
|
|
33
|
+
function isValidPrismaConfig(prismaConfig) {
|
|
34
|
+
return prismaConfig.datasource !== void 0;
|
|
35
|
+
}
|
|
36
|
+
function validatePrismaConfigWithDatasource({
|
|
37
|
+
config,
|
|
38
|
+
cmd
|
|
39
|
+
}) {
|
|
40
|
+
if (!isValidPrismaConfig(config)) {
|
|
41
|
+
throw new ConfigValidationError(
|
|
42
|
+
`The ${(0, import_chunk_PG5FDKSF.red)(`datasource`)} property is required in your Prisma config file when using ${(0, import_chunk_PG5FDKSF.green)(`prisma ${cmd}`)}.`
|
|
43
|
+
);
|
|
44
|
+
}
|
|
45
|
+
return config;
|
|
46
|
+
}
|
|
@@ -26,17 +26,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_6AE3ZTJ6_exports = {};
|
|
30
|
+
__export(chunk_6AE3ZTJ6_exports, {
|
|
31
31
|
GetConfigError: () => GetConfigError,
|
|
32
32
|
getConfig: () => getConfig
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(chunk_6AE3ZTJ6_exports);
|
|
35
35
|
var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
|
|
36
36
|
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
|
37
37
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
|
38
|
-
var
|
|
39
|
-
var
|
|
38
|
+
var import_chunk_BTE2BLVE = require("./chunk-BTE2BLVE.js");
|
|
39
|
+
var import_chunk_OXD2JEEF = require("./chunk-OXD2JEEF.js");
|
|
40
40
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
|
41
41
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
|
42
42
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
@@ -61,7 +61,7 @@ ${detailsHeader} ${message}`;
|
|
|
61
61
|
}).exhaustive();
|
|
62
62
|
const errorMessageWithContext = `${constructedErrorMessage}
|
|
63
63
|
[Context: getConfig]`;
|
|
64
|
-
super((0,
|
|
64
|
+
super((0, import_chunk_BTE2BLVE.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
|
65
65
|
this.name = "GetConfigError";
|
|
66
66
|
}
|
|
67
67
|
};
|
|
@@ -73,10 +73,10 @@ async function getConfig(options) {
|
|
|
73
73
|
() => {
|
|
74
74
|
if (process.env.FORCE_PANIC_GET_CONFIG) {
|
|
75
75
|
debug("Triggering a Rust panic...");
|
|
76
|
-
|
|
76
|
+
import_chunk_OXD2JEEF.prismaSchemaWasm.debug_panic();
|
|
77
77
|
}
|
|
78
78
|
const params = JSON.stringify({ prismaSchema: options.datamodel });
|
|
79
|
-
return
|
|
79
|
+
return import_chunk_OXD2JEEF.prismaSchemaWasm.get_config(params);
|
|
80
80
|
},
|
|
81
81
|
(e) => ({
|
|
82
82
|
type: "wasm-error",
|
|
@@ -26,8 +26,8 @@ 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_6INUGSFR_exports = {};
|
|
30
|
+
__export(chunk_6INUGSFR_exports, {
|
|
31
31
|
checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
|
|
32
32
|
forbiddenCmdWithDataProxyFlagMessage: () => forbiddenCmdWithDataProxyFlagMessage,
|
|
33
33
|
formatSchema: () => formatSchema,
|
|
@@ -40,22 +40,22 @@ __export(chunk_3D4RRUYX_exports, {
|
|
|
40
40
|
processSchemaResult: () => processSchemaResult,
|
|
41
41
|
skipIndex: () => skipIndex
|
|
42
42
|
});
|
|
43
|
-
module.exports = __toCommonJS(
|
|
43
|
+
module.exports = __toCommonJS(chunk_6INUGSFR_exports);
|
|
44
44
|
var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
|
|
45
45
|
var import_chunk_5MHUYAV3 = require("./chunk-5MHUYAV3.js");
|
|
46
46
|
var import_chunk_X3P4J7WW = require("./chunk-X3P4J7WW.js");
|
|
47
47
|
var import_chunk_LRU47BGE = require("./chunk-LRU47BGE.js");
|
|
48
48
|
var import_chunk_GXW4NTU2 = require("./chunk-GXW4NTU2.js");
|
|
49
49
|
var import_chunk_5FJ3MENK = require("./chunk-5FJ3MENK.js");
|
|
50
|
-
var
|
|
51
|
-
var
|
|
50
|
+
var import_chunk_ER4RE4VE = require("./chunk-ER4RE4VE.js");
|
|
51
|
+
var import_chunk_TGA7DC5A = require("./chunk-TGA7DC5A.js");
|
|
52
52
|
var import_chunk_3WXUQZS7 = require("./chunk-3WXUQZS7.js");
|
|
53
53
|
var import_chunk_CRVLHWC5 = require("./chunk-CRVLHWC5.js");
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var
|
|
57
|
-
var
|
|
58
|
-
var
|
|
54
|
+
var import_chunk_4YZTUZQX = require("./chunk-4YZTUZQX.js");
|
|
55
|
+
var import_chunk_TCASXHTD = require("./chunk-TCASXHTD.js");
|
|
56
|
+
var import_chunk_6AE3ZTJ6 = require("./chunk-6AE3ZTJ6.js");
|
|
57
|
+
var import_chunk_MVXWH6SD = require("./chunk-MVXWH6SD.js");
|
|
58
|
+
var import_chunk_OXD2JEEF = require("./chunk-OXD2JEEF.js");
|
|
59
59
|
var import_chunk_OKVM3CW4 = require("./chunk-OKVM3CW4.js");
|
|
60
60
|
var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
|
|
61
61
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
|
@@ -77,7 +77,7 @@ var debug = (0, import_debug.default)("prisma:format");
|
|
|
77
77
|
async function formatSchema({ schemas }, inputFormattingOptions) {
|
|
78
78
|
if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
|
|
79
79
|
handleFormatPanic(() => {
|
|
80
|
-
|
|
80
|
+
import_chunk_OXD2JEEF.prismaSchemaWasm.debug_panic();
|
|
81
81
|
});
|
|
82
82
|
}
|
|
83
83
|
const defaultFormattingOptions = {
|
|
@@ -94,10 +94,10 @@ async function formatSchema({ schemas }, inputFormattingOptions) {
|
|
|
94
94
|
const { formattedMultipleSchemas, lintDiagnostics } = handleFormatPanic(() => {
|
|
95
95
|
const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas), documentFormattingParams);
|
|
96
96
|
const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
|
|
97
|
-
const lintDiagnostics2 = (0,
|
|
97
|
+
const lintDiagnostics2 = (0, import_chunk_4YZTUZQX.lintSchema)({ schemas: formattedMultipleSchemas2 });
|
|
98
98
|
return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
|
|
99
99
|
});
|
|
100
|
-
const lintWarnings = (0,
|
|
100
|
+
const lintWarnings = (0, import_chunk_4YZTUZQX.getLintWarningsAsText)(lintDiagnostics);
|
|
101
101
|
if (lintWarnings && import_chunk_ZJWZK45Z.logger_exports.should.warn()) {
|
|
102
102
|
console.warn(lintWarnings);
|
|
103
103
|
}
|
|
@@ -124,7 +124,7 @@ function handleFormatPanic(tryCb) {
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
function formatWasm(schema, documentFormattingParams) {
|
|
127
|
-
const formattedSchema =
|
|
127
|
+
const formattedSchema = import_chunk_OXD2JEEF.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
|
|
128
128
|
return formattedSchema;
|
|
129
129
|
}
|
|
130
130
|
async function loadSchemaContext({
|
|
@@ -160,7 +160,7 @@ async function processSchemaResult({
|
|
|
160
160
|
if (printLoadMessage) {
|
|
161
161
|
(0, import_chunk_OKVM3CW4.printSchemaLoadedMessage)(loadedFromPathForLogMessages);
|
|
162
162
|
}
|
|
163
|
-
const configFromPsl = await (0,
|
|
163
|
+
const configFromPsl = await (0, import_chunk_6AE3ZTJ6.getConfig)({ datamodel: schemaResult.schemas });
|
|
164
164
|
const primaryDatasource = configFromPsl.datasources.at(0);
|
|
165
165
|
const primaryDatasourceDirectory = getPrimaryDatasourceDirectory(primaryDatasource) || schemaRootDir;
|
|
166
166
|
return {
|
|
@@ -220,19 +220,19 @@ async function getGenerators(options) {
|
|
|
220
220
|
throw new Error(`no schema provided for getGenerators`);
|
|
221
221
|
}
|
|
222
222
|
if (!schemaContext.primaryDatasource) {
|
|
223
|
-
throw new Error(
|
|
223
|
+
throw new Error(import_chunk_ER4RE4VE.missingDatasource);
|
|
224
224
|
}
|
|
225
225
|
(0, import_chunk_5FJ3MENK.printConfigWarnings)(schemaContext.warnings);
|
|
226
226
|
const previewFeatures = (0, import_chunk_CRVLHWC5.extractPreviewFeatures)(schemaContext.generators);
|
|
227
|
-
const dmmf = await (0,
|
|
227
|
+
const dmmf = await (0, import_chunk_MVXWH6SD.getDMMF)({
|
|
228
228
|
datamodel: schemaContext.schemaFiles,
|
|
229
229
|
previewFeatures
|
|
230
230
|
});
|
|
231
231
|
if (dmmf.datamodel.models.length === 0 && !allowNoModels) {
|
|
232
232
|
if (schemaContext.primaryDatasource.provider === "mongodb") {
|
|
233
|
-
throw new Error(
|
|
233
|
+
throw new Error(import_chunk_TGA7DC5A.missingModelMessageMongoDB);
|
|
234
234
|
}
|
|
235
|
-
throw new Error(
|
|
235
|
+
throw new Error(import_chunk_TGA7DC5A.missingModelMessage);
|
|
236
236
|
}
|
|
237
237
|
const generatorConfigs = filterGenerators(overrideGenerators || schemaContext.generators, generatorNames);
|
|
238
238
|
await validateGenerators(generatorConfigs);
|
|
@@ -275,7 +275,7 @@ You need to define \`output\` in the generator block in the schema file.`
|
|
|
275
275
|
fromEnvVar: null
|
|
276
276
|
};
|
|
277
277
|
}
|
|
278
|
-
const datamodel = (0,
|
|
278
|
+
const datamodel = (0, import_chunk_TCASXHTD.mergeSchemas)({ schemas: schemaContext.schemaFiles });
|
|
279
279
|
const options2 = {
|
|
280
280
|
datamodel,
|
|
281
281
|
datasources: schemaContext.datasources,
|
|
@@ -443,16 +443,17 @@ function filterGenerators(generators, generatorNames) {
|
|
|
443
443
|
}
|
|
444
444
|
return filtered;
|
|
445
445
|
}
|
|
446
|
-
var forbiddenCmdWithDataProxyFlagMessage = (
|
|
447
|
-
Using an Accelerate URL is not supported for this CLI command ${(0, import_chunk_PG5FDKSF.green)(`prisma ${
|
|
446
|
+
var forbiddenCmdWithDataProxyFlagMessage = (cmd) => `
|
|
447
|
+
Using an Accelerate URL is not supported for this CLI command ${(0, import_chunk_PG5FDKSF.green)(`prisma ${cmd}`)} yet.
|
|
448
448
|
Please use a direct connection to your database in \`prisma.config.ts\`.
|
|
449
449
|
|
|
450
450
|
More information about this limitation: ${(0, import_chunk_3WXUQZS7.link)("https://pris.ly/d/accelerate-limitations")}
|
|
451
451
|
`;
|
|
452
|
-
function checkUnsupportedDataProxy({
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
452
|
+
function checkUnsupportedDataProxy({
|
|
453
|
+
cmd,
|
|
454
|
+
validatedConfig
|
|
455
|
+
}) {
|
|
456
|
+
if (validatedConfig.datasource.url.startsWith("prisma://")) {
|
|
457
|
+
throw new Error(forbiddenCmdWithDataProxyFlagMessage(cmd));
|
|
457
458
|
}
|
|
458
459
|
}
|
|
@@ -16,15 +16,15 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_BTE2BLVE_exports = {};
|
|
20
|
+
__export(chunk_BTE2BLVE_exports, {
|
|
21
21
|
addVersionDetailsToErrorMessage: () => addVersionDetailsToErrorMessage
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_BTE2BLVE_exports);
|
|
24
24
|
var import_chunk_QN6PSQY7 = require("./chunk-QN6PSQY7.js");
|
|
25
|
-
var
|
|
25
|
+
var import_chunk_WXZ6MOHE = require("./chunk-WXZ6MOHE.js");
|
|
26
26
|
function addVersionDetailsToErrorMessage(message) {
|
|
27
|
-
const rows = [["Prisma CLI Version",
|
|
27
|
+
const rows = [["Prisma CLI Version", import_chunk_WXZ6MOHE.version]];
|
|
28
28
|
return `${message}
|
|
29
29
|
|
|
30
30
|
${(0, import_chunk_QN6PSQY7.formatTable)(rows)}`;
|
|
@@ -16,17 +16,17 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_CGDIZWKV_exports = {};
|
|
20
|
+
__export(chunk_CGDIZWKV_exports, {
|
|
21
21
|
require_package: () => require_package
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_CGDIZWKV_exports);
|
|
24
24
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
|
25
25
|
var require_package = (0, import_chunk_4VNS5WPM.__commonJS)({
|
|
26
26
|
"package.json"(exports, module2) {
|
|
27
27
|
module2.exports = {
|
|
28
28
|
name: "@prisma/internals",
|
|
29
|
-
version: "6.20.0-integration-next.
|
|
29
|
+
version: "6.20.0-integration-next.6",
|
|
30
30
|
description: "This package is intended for Prisma's internal use",
|
|
31
31
|
main: "dist/index.js",
|
|
32
32
|
types: "dist/index.d.ts",
|
|
@@ -16,20 +16,20 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_ER4RE4VE_exports = {};
|
|
20
|
+
__export(chunk_ER4RE4VE_exports, {
|
|
21
21
|
missingDatasource: () => missingDatasource
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_ER4RE4VE_exports);
|
|
24
24
|
var import_chunk_3WXUQZS7 = require("./chunk-3WXUQZS7.js");
|
|
25
|
-
var
|
|
25
|
+
var import_chunk_TQCLUNM2 = require("./chunk-TQCLUNM2.js");
|
|
26
26
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
27
27
|
var missingDatasource = `
|
|
28
28
|
You don't have any ${(0, import_chunk_PG5FDKSF.bold)("datasource")} defined in your ${(0, import_chunk_PG5FDKSF.bold)("schema.prisma")}.
|
|
29
29
|
You can define a datasource like this:
|
|
30
30
|
|
|
31
31
|
${(0, import_chunk_PG5FDKSF.bold)(
|
|
32
|
-
(0,
|
|
32
|
+
(0, import_chunk_TQCLUNM2.highlightDatamodel)(`datasource db {
|
|
33
33
|
provider = "postgresql"
|
|
34
34
|
}`)
|
|
35
35
|
)}
|
|
@@ -26,16 +26,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_MVXWH6SD_exports = {};
|
|
30
|
+
__export(chunk_MVXWH6SD_exports, {
|
|
31
31
|
GetDmmfError: () => GetDmmfError,
|
|
32
32
|
getDMMF: () => getDMMF
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(chunk_MVXWH6SD_exports);
|
|
35
35
|
var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
|
|
36
36
|
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
|
37
|
-
var
|
|
38
|
-
var
|
|
37
|
+
var import_chunk_BTE2BLVE = require("./chunk-BTE2BLVE.js");
|
|
38
|
+
var import_chunk_OXD2JEEF = require("./chunk-OXD2JEEF.js");
|
|
39
39
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
|
40
40
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
|
41
41
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
@@ -58,7 +58,7 @@ ${detailsHeader} ${message}`;
|
|
|
58
58
|
}).exhaustive();
|
|
59
59
|
const errorMessageWithContext = `${constructedErrorMessage}
|
|
60
60
|
[Context: getDmmf]`;
|
|
61
|
-
super((0,
|
|
61
|
+
super((0, import_chunk_BTE2BLVE.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
|
62
62
|
this.name = "GetDmmfError";
|
|
63
63
|
}
|
|
64
64
|
};
|
|
@@ -70,13 +70,13 @@ async function getDMMF(options) {
|
|
|
70
70
|
() => {
|
|
71
71
|
if (process.env.FORCE_PANIC_GET_DMMF) {
|
|
72
72
|
debug("Triggering a Rust panic...");
|
|
73
|
-
|
|
73
|
+
import_chunk_OXD2JEEF.prismaSchemaWasm.debug_panic();
|
|
74
74
|
}
|
|
75
75
|
const params = JSON.stringify({
|
|
76
76
|
prismaSchema: options.datamodel,
|
|
77
77
|
noColor: Boolean(process.env.NO_COLOR)
|
|
78
78
|
});
|
|
79
|
-
const data =
|
|
79
|
+
const data = import_chunk_OXD2JEEF.prismaSchemaWasm.get_dmmf(params);
|
|
80
80
|
return data;
|
|
81
81
|
},
|
|
82
82
|
(e) => ({
|
|
@@ -26,15 +26,15 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_OXD2JEEF_exports = {};
|
|
30
|
+
__export(chunk_OXD2JEEF_exports, {
|
|
31
31
|
prismaSchemaWasm: () => import_prisma_schema_wasm.default,
|
|
32
32
|
prismaSchemaWasmVersion: () => prismaSchemaWasmVersion,
|
|
33
33
|
schemaEngineWasmVersion: () => schemaEngineWasmVersion,
|
|
34
34
|
wasm_exports: () => wasm_exports
|
|
35
35
|
});
|
|
36
|
-
module.exports = __toCommonJS(
|
|
37
|
-
var
|
|
36
|
+
module.exports = __toCommonJS(chunk_OXD2JEEF_exports);
|
|
37
|
+
var import_chunk_CGDIZWKV = require("./chunk-CGDIZWKV.js");
|
|
38
38
|
var import_chunk_WXRVYSYN = require("./chunk-WXRVYSYN.js");
|
|
39
39
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
|
40
40
|
var import_prisma_schema_wasm = __toESM(require("@prisma/prisma-schema-wasm"));
|
|
@@ -46,6 +46,6 @@ var wasm_exports = {};
|
|
|
46
46
|
});
|
|
47
47
|
var globalWithPanicRegistry = globalThis;
|
|
48
48
|
globalWithPanicRegistry.PRISMA_WASM_PANIC_REGISTRY = new import_chunk_WXRVYSYN.WasmPanicRegistry();
|
|
49
|
-
var { dependencies } = (0,
|
|
49
|
+
var { dependencies } = (0, import_chunk_CGDIZWKV.require_package)();
|
|
50
50
|
var prismaSchemaWasmVersion = dependencies["@prisma/prisma-schema-wasm"];
|
|
51
51
|
var schemaEngineWasmVersion = dependencies["@prisma/schema-engine-wasm"];
|
|
@@ -26,17 +26,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_QIFU7FBS_exports = {};
|
|
30
|
+
__export(chunk_QIFU7FBS_exports, {
|
|
31
31
|
ValidateError: () => ValidateError,
|
|
32
32
|
validate: () => validate
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(chunk_QIFU7FBS_exports);
|
|
35
35
|
var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
|
|
36
36
|
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
|
37
37
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
|
38
|
-
var
|
|
39
|
-
var
|
|
38
|
+
var import_chunk_BTE2BLVE = require("./chunk-BTE2BLVE.js");
|
|
39
|
+
var import_chunk_OXD2JEEF = require("./chunk-OXD2JEEF.js");
|
|
40
40
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
|
41
41
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
|
42
42
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
@@ -59,7 +59,7 @@ ${detailsHeader} ${message}`;
|
|
|
59
59
|
}).exhaustive();
|
|
60
60
|
const errorMessageWithContext = `${constructedErrorMessage}
|
|
61
61
|
[Context: validate]`;
|
|
62
|
-
super((0,
|
|
62
|
+
super((0, import_chunk_BTE2BLVE.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
|
63
63
|
this.name = "ValidateError";
|
|
64
64
|
}
|
|
65
65
|
};
|
|
@@ -71,13 +71,13 @@ function validate(options) {
|
|
|
71
71
|
() => {
|
|
72
72
|
if (process.env.FORCE_PANIC_GET_DMMF) {
|
|
73
73
|
debug("Triggering a Rust panic...");
|
|
74
|
-
|
|
74
|
+
import_chunk_OXD2JEEF.prismaSchemaWasm.debug_panic();
|
|
75
75
|
}
|
|
76
76
|
const params = JSON.stringify({
|
|
77
77
|
prismaSchema: options.schemas,
|
|
78
78
|
noColor: Boolean(process.env.NO_COLOR)
|
|
79
79
|
});
|
|
80
|
-
|
|
80
|
+
import_chunk_OXD2JEEF.prismaSchemaWasm.validate(params);
|
|
81
81
|
},
|
|
82
82
|
(e) => ({
|
|
83
83
|
type: "wasm-error",
|
|
@@ -26,8 +26,8 @@ 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_R5OZXPSF_exports = {};
|
|
30
|
+
__export(chunk_R5OZXPSF_exports, {
|
|
31
31
|
checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
|
|
32
32
|
forbiddenCmdWithDataProxyFlagMessage: () => forbiddenCmdWithDataProxyFlagMessage,
|
|
33
33
|
formatSchema: () => formatSchema,
|
|
@@ -40,15 +40,15 @@ __export(chunk_J757IEPK_exports, {
|
|
|
40
40
|
processSchemaResult: () => processSchemaResult,
|
|
41
41
|
skipIndex: () => skipIndex
|
|
42
42
|
});
|
|
43
|
-
module.exports = __toCommonJS(
|
|
43
|
+
module.exports = __toCommonJS(chunk_R5OZXPSF_exports);
|
|
44
44
|
var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
|
|
45
45
|
var import_chunk_5MHUYAV3 = require("./chunk-5MHUYAV3.js");
|
|
46
46
|
var import_chunk_X3P4J7WW = require("./chunk-X3P4J7WW.js");
|
|
47
47
|
var import_chunk_LRU47BGE = require("./chunk-LRU47BGE.js");
|
|
48
48
|
var import_chunk_GXW4NTU2 = require("./chunk-GXW4NTU2.js");
|
|
49
49
|
var import_chunk_5FJ3MENK = require("./chunk-5FJ3MENK.js");
|
|
50
|
-
var
|
|
51
|
-
var
|
|
50
|
+
var import_chunk_ER4RE4VE = require("./chunk-ER4RE4VE.js");
|
|
51
|
+
var import_chunk_TGA7DC5A = require("./chunk-TGA7DC5A.js");
|
|
52
52
|
var import_chunk_3WXUQZS7 = require("./chunk-3WXUQZS7.js");
|
|
53
53
|
var import_chunk_CRVLHWC5 = require("./chunk-CRVLHWC5.js");
|
|
54
54
|
var import_chunk_2Z7PH5WX = require("./chunk-2Z7PH5WX.js");
|
|
@@ -220,7 +220,7 @@ async function getGenerators(options) {
|
|
|
220
220
|
throw new Error(`no schema provided for getGenerators`);
|
|
221
221
|
}
|
|
222
222
|
if (!schemaContext.primaryDatasource) {
|
|
223
|
-
throw new Error(
|
|
223
|
+
throw new Error(import_chunk_ER4RE4VE.missingDatasource);
|
|
224
224
|
}
|
|
225
225
|
(0, import_chunk_5FJ3MENK.printConfigWarnings)(schemaContext.warnings);
|
|
226
226
|
const previewFeatures = (0, import_chunk_CRVLHWC5.extractPreviewFeatures)(schemaContext.generators);
|
|
@@ -230,9 +230,9 @@ async function getGenerators(options) {
|
|
|
230
230
|
});
|
|
231
231
|
if (dmmf.datamodel.models.length === 0 && !allowNoModels) {
|
|
232
232
|
if (schemaContext.primaryDatasource.provider === "mongodb") {
|
|
233
|
-
throw new Error(
|
|
233
|
+
throw new Error(import_chunk_TGA7DC5A.missingModelMessageMongoDB);
|
|
234
234
|
}
|
|
235
|
-
throw new Error(
|
|
235
|
+
throw new Error(import_chunk_TGA7DC5A.missingModelMessage);
|
|
236
236
|
}
|
|
237
237
|
const generatorConfigs = filterGenerators(overrideGenerators || schemaContext.generators, generatorNames);
|
|
238
238
|
await validateGenerators(generatorConfigs);
|
|
@@ -443,16 +443,17 @@ function filterGenerators(generators, generatorNames) {
|
|
|
443
443
|
}
|
|
444
444
|
return filtered;
|
|
445
445
|
}
|
|
446
|
-
var forbiddenCmdWithDataProxyFlagMessage = (
|
|
447
|
-
Using an Accelerate URL is not supported for this CLI command ${(0, import_chunk_PG5FDKSF.green)(`prisma ${
|
|
446
|
+
var forbiddenCmdWithDataProxyFlagMessage = (cmd) => `
|
|
447
|
+
Using an Accelerate URL is not supported for this CLI command ${(0, import_chunk_PG5FDKSF.green)(`prisma ${cmd}`)} yet.
|
|
448
448
|
Please use a direct connection to your database in \`prisma.config.ts\`.
|
|
449
449
|
|
|
450
450
|
More information about this limitation: ${(0, import_chunk_3WXUQZS7.link)("https://pris.ly/d/accelerate-limitations")}
|
|
451
451
|
`;
|
|
452
|
-
function checkUnsupportedDataProxy({
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
452
|
+
function checkUnsupportedDataProxy({
|
|
453
|
+
cmd,
|
|
454
|
+
validatedConfig
|
|
455
|
+
}) {
|
|
456
|
+
if (validatedConfig.datasource.url.startsWith("prisma://")) {
|
|
457
|
+
throw new Error(forbiddenCmdWithDataProxyFlagMessage(cmd));
|
|
457
458
|
}
|
|
458
459
|
}
|
|
@@ -26,17 +26,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_TCASXHTD_exports = {};
|
|
30
|
+
__export(chunk_TCASXHTD_exports, {
|
|
31
31
|
MergeSchemasError: () => MergeSchemasError,
|
|
32
32
|
mergeSchemas: () => mergeSchemas
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(chunk_TCASXHTD_exports);
|
|
35
35
|
var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
|
|
36
36
|
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
|
37
37
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
|
38
|
-
var
|
|
39
|
-
var
|
|
38
|
+
var import_chunk_BTE2BLVE = require("./chunk-BTE2BLVE.js");
|
|
39
|
+
var import_chunk_OXD2JEEF = require("./chunk-OXD2JEEF.js");
|
|
40
40
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
|
41
41
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
|
42
42
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
@@ -59,7 +59,7 @@ ${detailsHeader} ${message}`;
|
|
|
59
59
|
}).exhaustive();
|
|
60
60
|
const errorMessageWithContext = `${constructedErrorMessage}
|
|
61
61
|
[Context: mergeSchemas]`;
|
|
62
|
-
super((0,
|
|
62
|
+
super((0, import_chunk_BTE2BLVE.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
|
63
63
|
this.name = "MergeSchemasError";
|
|
64
64
|
}
|
|
65
65
|
};
|
|
@@ -72,7 +72,7 @@ function mergeSchemas(options) {
|
|
|
72
72
|
const params = JSON.stringify({
|
|
73
73
|
schema: options.schemas
|
|
74
74
|
});
|
|
75
|
-
return
|
|
75
|
+
return import_chunk_OXD2JEEF.prismaSchemaWasm.merge_schemas(params);
|
|
76
76
|
},
|
|
77
77
|
(e) => ({
|
|
78
78
|
type: "wasm-error",
|
|
@@ -16,15 +16,15 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_TGA7DC5A_exports = {};
|
|
20
|
+
__export(chunk_TGA7DC5A_exports, {
|
|
21
21
|
missingGeneratorMessage: () => missingGeneratorMessage,
|
|
22
22
|
missingModelMessage: () => missingModelMessage,
|
|
23
23
|
missingModelMessageMongoDB: () => missingModelMessageMongoDB
|
|
24
24
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
25
|
+
module.exports = __toCommonJS(chunk_TGA7DC5A_exports);
|
|
26
26
|
var import_chunk_3WXUQZS7 = require("./chunk-3WXUQZS7.js");
|
|
27
|
-
var
|
|
27
|
+
var import_chunk_TQCLUNM2 = require("./chunk-TQCLUNM2.js");
|
|
28
28
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
29
29
|
var missingGeneratorMessage = `
|
|
30
30
|
${(0, import_chunk_PG5FDKSF.blue)("info")} You don't have any generators defined in your ${(0, import_chunk_PG5FDKSF.bold)(
|
|
@@ -33,7 +33,7 @@ ${(0, import_chunk_PG5FDKSF.blue)("info")} You don't have any generators defined
|
|
|
33
33
|
Add the Prisma Client generator like this:
|
|
34
34
|
|
|
35
35
|
${(0, import_chunk_PG5FDKSF.bold)(
|
|
36
|
-
(0,
|
|
36
|
+
(0, import_chunk_TQCLUNM2.highlightDatamodel)(`generator client {
|
|
37
37
|
provider = "prisma-client"
|
|
38
38
|
output = "../src/generated/prisma"
|
|
39
39
|
}`)
|
|
@@ -49,7 +49,7 @@ You don't have any ${(0, import_chunk_PG5FDKSF.bold)("models")} defined in your
|
|
|
49
49
|
You can define a model like this:
|
|
50
50
|
|
|
51
51
|
${(0, import_chunk_PG5FDKSF.bold)(
|
|
52
|
-
(0,
|
|
52
|
+
(0, import_chunk_TQCLUNM2.highlightDatamodel)(`model User {
|
|
53
53
|
id Int @id @default(autoincrement())
|
|
54
54
|
email String @unique
|
|
55
55
|
name String?
|
|
@@ -66,7 +66,7 @@ You don't have any ${(0, import_chunk_PG5FDKSF.bold)("models")} defined in your
|
|
|
66
66
|
You can define a model like this:
|
|
67
67
|
|
|
68
68
|
${(0, import_chunk_PG5FDKSF.bold)(
|
|
69
|
-
(0,
|
|
69
|
+
(0, import_chunk_TQCLUNM2.highlightDatamodel)(`model User {
|
|
70
70
|
id String @id @default(auto()) @map("_id") @db.ObjectId
|
|
71
71
|
email String @unique
|
|
72
72
|
name String?
|
|
@@ -16,15 +16,15 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
16
|
return to;
|
|
17
17
|
};
|
|
18
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var
|
|
20
|
-
__export(
|
|
19
|
+
var chunk_TQCLUNM2_exports = {};
|
|
20
|
+
__export(chunk_TQCLUNM2_exports, {
|
|
21
21
|
highlightDatamodel: () => highlightDatamodel,
|
|
22
22
|
highlightSql: () => highlightSql,
|
|
23
23
|
highlightTS: () => highlightTS
|
|
24
24
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
26
|
-
var import_chunk_CYAS6B5N = require("./chunk-CYAS6B5N.js");
|
|
25
|
+
module.exports = __toCommonJS(chunk_TQCLUNM2_exports);
|
|
27
26
|
var import_chunk_OIVPX3BR = require("./chunk-OIVPX3BR.js");
|
|
27
|
+
var import_chunk_CYAS6B5N = require("./chunk-CYAS6B5N.js");
|
|
28
28
|
var import_chunk_HPVMQFIY = require("./chunk-HPVMQFIY.js");
|
|
29
29
|
function highlightDatamodel(str) {
|
|
30
30
|
return highlight(str, import_chunk_OIVPX3BR.dml);
|