@prisma/internals 7.3.0-integration-prisma6-fix-cloudflare-engine.2 → 7.3.0-integration-engines-7-3-0-10-fix-fix-mapped-enum-issue-0b7e6564db7dc3dac7f9312aa84e9ed81d805521.1
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-EYVG6XQS.js → chunk-2BXDHSSY.js} +56 -68
- package/dist/{chunk-GMW36QQF.js → chunk-2GPDFPDR.js} +7 -7
- package/dist/{chunk-656EKQL7.js → chunk-334ZBKRR.js} +5 -5
- package/dist/{chunk-EBHY7SKQ.js → chunk-3PNJ6ZQE.js} +58 -146
- package/dist/{chunk-LYFOJ5NK.js → chunk-3U4QB2G3.js} +4 -6
- package/dist/{chunk-MS7PP4WD.js → chunk-4A2DO32A.js} +11 -11
- package/dist/{chunk-2HX6D6UC.js → chunk-4UM3NWZ3.js} +12 -12
- package/dist/{chunk-TQFONRJP.js → chunk-5BRXEOYH.js} +5 -5
- package/dist/{chunk-RS2R7COT.js → chunk-5I4ERIIY.js} +3 -9
- package/dist/{chunk-E2QTLJH5.js → chunk-5X46R434.js} +13 -13
- package/dist/{chunk-QPQF4VGD.js → chunk-6ZQTRCHC.js} +12 -12
- package/dist/{chunk-DE5KNXS3.js → chunk-7IBWXVWK.js} +5 -5
- package/dist/{chunk-WFNB7VRA.js → chunk-ARC7TW3L.js} +4 -14
- package/dist/{chunk-MS5VOWI6.js → chunk-AYPKO22A.js} +16 -38
- package/dist/{chunk-BVJP43JS.js → chunk-BXIKQUP5.js} +7 -7
- package/dist/{chunk-AX5N26KG.js → chunk-CQVWHHIJ.js} +11 -6
- package/dist/{chunk-FYZCPL2Z.js → chunk-DQWKFZPY.js} +4 -7
- package/dist/{chunk-7QC5VORA.js → chunk-DXWYZA7B.js} +3 -4
- package/dist/{chunk-WDPDHAFW.js → chunk-ECN6H47Y.js} +5 -5
- package/dist/{chunk-F2OZV76L.js → chunk-GH2WAX5Y.js} +7 -7
- package/dist/{chunk-4CGPN5SR.js → chunk-GJSFP4V4.js} +3 -9
- package/dist/{chunk-W6J5YFD2.js → chunk-IAKPRMGI.js} +5 -5
- package/dist/{chunk-THADADEM.js → chunk-JB7YT5XG.js} +7 -9
- package/dist/{chunk-4JCVHBYR.js → chunk-KAH2NIWC.js} +6 -6
- package/dist/{chunk-262R2PBW.js → chunk-KOBX6GKI.js} +5 -5
- package/dist/{chunk-HMBK4NVB.js → chunk-MOW746GL.js} +5 -5
- package/dist/{chunk-BCQZ6JQE.js → chunk-NBWRGVYR.js} +4 -6
- package/dist/{chunk-UQUWZJVN.js → chunk-NYNXYKR4.js} +7 -7
- package/dist/{chunk-QLOP3Z4E.js → chunk-OVRS2CD6.js} +16 -38
- package/dist/{chunk-OPLMJ5WZ.js → chunk-P3F2U57W.js} +58 -146
- package/dist/{chunk-3MG7RNJJ.js → chunk-PRGRB27V.js} +5 -5
- package/dist/{chunk-75BIJ5PX.js → chunk-Q5XW7CMJ.js} +9 -9
- package/dist/{chunk-OAT7ZJED.js → chunk-Q75TMXCR.js} +7 -20
- package/dist/{chunk-GK4L4FGH.js → chunk-QDIUK75K.js} +8 -10
- package/dist/chunk-QKQKSUQO.js +46 -0
- package/dist/{chunk-FCYHZHVW.js → chunk-R3J2O23S.js} +4 -4
- package/dist/{chunk-OSHZ4P3G.js → chunk-SP2ETLT2.js} +5 -5
- package/dist/{chunk-EMFA7GJU.js → chunk-SZXZZWNK.js} +13 -13
- package/dist/{chunk-6WQJFBF5.js → chunk-T7XMJ6KH.js} +5 -5
- package/dist/{chunk-KH7FI42S.js → chunk-VPLQF2ZV.js} +11 -11
- package/dist/{chunk-TZJROXB3.js → chunk-WSZXPLJQ.js} +4 -4
- package/dist/{chunk-UHI6VYFX.js → chunk-YJVCIN4F.js} +16 -14
- package/dist/{chunk-JOIIWB3U.js → chunk-YV4IFLW4.js} +128 -129
- package/dist/{chunk-HFFWZTVM.js → chunk-YXCPS3WU.js} +5 -15
- package/dist/cli/checkUnsupportedDataProxy.d.ts +7 -9
- package/dist/cli/checkUnsupportedDataProxy.js +53 -65
- package/dist/cli/directoryConfig.d.ts +5 -2
- package/dist/cli/directoryConfig.js +2 -2
- package/dist/cli/getGeneratorSuccessMessage.js +2 -3
- package/dist/cli/getSchema.d.ts +28 -20
- package/dist/cli/getSchema.js +7 -5
- package/dist/cli/hashes.d.ts +2 -1
- package/dist/cli/hashes.js +4 -4
- package/dist/cli/schemaContext.d.ts +5 -22
- package/dist/cli/schemaContext.js +54 -65
- package/dist/cli/types.d.ts +1 -1
- package/dist/convertCredentials.js +4 -4
- package/dist/engine-commands/errorHelpers.js +4 -4
- package/dist/engine-commands/formatSchema.js +52 -64
- package/dist/engine-commands/getConfig.d.ts +1 -5
- package/dist/engine-commands/getConfig.js +10 -13
- package/dist/engine-commands/getDmmf.js +10 -10
- package/dist/engine-commands/getEngineVersion.js +5 -9
- package/dist/engine-commands/getEnginesInfo.d.ts +0 -1
- package/dist/engine-commands/getEnginesInfo.js +6 -9
- package/dist/engine-commands/index.d.ts +1 -1
- package/dist/engine-commands/index.js +62 -76
- package/dist/engine-commands/lintSchema.js +9 -9
- package/dist/engine-commands/mergeSchemas.js +10 -10
- package/dist/engine-commands/queryEngineCommons.js +6 -6
- package/dist/engine-commands/validate.js +10 -10
- package/dist/get-generators/getGenerators.d.ts +0 -2
- package/dist/get-generators/getGenerators.js +55 -67
- package/dist/get-generators/utils/binaryTypeToEngineType.js +2 -2
- package/dist/get-generators/utils/engineTypeToBinaryType.js +2 -2
- package/dist/get-generators/utils/getBinaryPathsByVersion.js +4 -4
- package/dist/getPackedPackage.js +3 -3
- package/dist/index.d.ts +5 -19
- package/dist/index.js +99 -125
- package/dist/resolveBinary.js +7 -7
- package/dist/schemaEngineCommands.js +8 -8
- package/dist/sendPanic.js +2 -3
- package/dist/types.d.ts +15 -0
- package/dist/utils/canPrompt.js +3 -3
- package/dist/utils/fs-functional.js +10 -10
- package/dist/utils/fs-utils.js +8 -8
- package/dist/utils/getVersionFromPackageJson.js +3 -3
- package/dist/utils/handlePanic.js +6 -7
- package/dist/utils/missingDatasource.js +2 -2
- package/dist/utils/missingGeneratorMessage.js +4 -4
- package/dist/utils/toSchemasContainer.d.ts +1 -1
- package/dist/utils/toSchemasContainer.js +3 -3
- package/dist/utils/validatePrismaConfigWithDatasource.d.ts +17 -0
- package/dist/utils/{handleEngineLoadingErrors.js → validatePrismaConfigWithDatasource.js} +7 -6
- package/dist/wasm.js +5 -5
- package/package.json +15 -17
- package/dist/chunk-3FP46GUV.js +0 -471
- package/dist/chunk-46ABODUM.js +0 -186
- package/dist/chunk-6TTRTZXU.js +0 -37
- package/dist/chunk-D4VDA2TZ.js +0 -66
- package/dist/chunk-DZYINYAA.js +0 -68
- package/dist/chunk-ERSH2BQA.js +0 -58
- package/dist/chunk-HO5HRHFZ.js +0 -30
- package/dist/chunk-HW5RCZSE.js +0 -1
- package/dist/chunk-KDHESRKE.js +0 -49
- package/dist/chunk-L6KOIJJ5.js +0 -125
- package/dist/chunk-PZMRR772.js +0 -41
- package/dist/chunk-RFB2U4GQ.js +0 -41
- package/dist/chunk-T2PM5TKT.js +0 -55
- package/dist/cli/checkUnsupportedSchemaEngineWasm.d.ts +0 -22
- package/dist/cli/checkUnsupportedSchemaEngineWasm.js +0 -135
- package/dist/client/getClientEngineType.d.ts +0 -7
- package/dist/client/getClientEngineType.js +0 -26
- package/dist/dotenvExpand.d.ts +0 -35
- package/dist/dotenvExpand.js +0 -25
- package/dist/tracing/types.d.ts +0 -54
- package/dist/tracing/types.js +0 -2
- package/dist/utils/__tests__/maskSchema.test.js +0 -23
- package/dist/utils/byline.d.ts +0 -4
- package/dist/utils/byline.js +0 -28
- package/dist/utils/cloudflareD1.d.ts +0 -5
- package/dist/utils/cloudflareD1.js +0 -27
- package/dist/utils/getEnvPaths.d.ts +0 -14
- package/dist/utils/getEnvPaths.js +0 -29
- package/dist/utils/getMigrateConfigDir.d.ts +0 -2
- package/dist/utils/getMigrateConfigDir.js +0 -25
- package/dist/utils/handleEngineLoadingErrors.d.ts +0 -8
- package/dist/utils/load.d.ts +0 -6
- package/dist/utils/load.js +0 -28
- package/dist/utils/loadEnvFile.d.ts +0 -10
- package/dist/utils/loadEnvFile.js +0 -30
- package/dist/utils/maskSchema.d.ts +0 -4
- package/dist/utils/maskSchema.js +0 -27
- package/dist/utils/serializeQueryEngineName.d.ts +0 -4
- package/dist/utils/serializeQueryEngineName.js +0 -25
- package/dist/utils/tryLoadEnvs.d.ts +0 -25
- package/dist/utils/tryLoadEnvs.js +0 -30
|
@@ -26,16 +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(
|
|
31
|
-
|
|
29
|
+
var chunk_2BXDHSSY_exports = {};
|
|
30
|
+
__export(chunk_2BXDHSSY_exports, {
|
|
31
|
+
createSchemaPathInput: () => createSchemaPathInput,
|
|
32
|
+
getCliProvidedSchemaFile: () => getCliProvidedSchemaFile,
|
|
33
|
+
getConfigProvidedSchemaFile: () => getConfigProvidedSchemaFile,
|
|
32
34
|
getSchemaWithPath: () => getSchemaWithPath,
|
|
33
35
|
getSchemaWithPathOptional: () => getSchemaWithPathOptional,
|
|
34
36
|
printSchemaLoadedMessage: () => printSchemaLoadedMessage
|
|
35
37
|
});
|
|
36
|
-
module.exports = __toCommonJS(
|
|
38
|
+
module.exports = __toCommonJS(chunk_2BXDHSSY_exports);
|
|
37
39
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
38
|
-
var import_config = require("@prisma/config");
|
|
39
40
|
var import_debug = require("@prisma/debug");
|
|
40
41
|
var import_schema_files_loader = require("@prisma/schema-files-loader");
|
|
41
42
|
var import_fs = __toESM(require("fs"));
|
|
@@ -44,22 +45,37 @@ var import_util = require("util");
|
|
|
44
45
|
var readFile = (0, import_util.promisify)(import_fs.default.readFile);
|
|
45
46
|
var stat = (0, import_util.promisify)(import_fs.default.stat);
|
|
46
47
|
var debug = (0, import_debug.Debug)("prisma:getSchema");
|
|
47
|
-
|
|
48
|
-
|
|
48
|
+
function createSchemaPathInput({
|
|
49
|
+
schemaPathFromArgs,
|
|
50
|
+
schemaPathFromConfig,
|
|
51
|
+
baseDir
|
|
52
|
+
}) {
|
|
53
|
+
return schemaPathFromArgs ? { cliProvidedPath: schemaPathFromArgs } : schemaPathFromConfig ? { configProvidedPath: schemaPathFromConfig } : { baseDir };
|
|
54
|
+
}
|
|
55
|
+
async function getSchemaWithPath({
|
|
56
|
+
schemaPath,
|
|
57
|
+
cwd = process.cwd(),
|
|
58
|
+
argumentName = "--schema"
|
|
59
|
+
}) {
|
|
60
|
+
const result = await getSchemaWithPathInternal({ schemaPath, cwd, argumentName });
|
|
49
61
|
if (result.ok) {
|
|
50
62
|
return result.schema;
|
|
51
63
|
}
|
|
52
64
|
throw new Error(renderDefaultLookupError(result.error, cwd));
|
|
53
65
|
}
|
|
54
|
-
async function getSchemaWithPathOptional(
|
|
55
|
-
|
|
66
|
+
async function getSchemaWithPathOptional({
|
|
67
|
+
schemaPath,
|
|
68
|
+
cwd = process.cwd(),
|
|
69
|
+
argumentName = "--schema"
|
|
70
|
+
}) {
|
|
71
|
+
const result = await getSchemaWithPathInternal({ schemaPath, cwd, argumentName });
|
|
56
72
|
if (result.ok) {
|
|
57
73
|
return result.schema;
|
|
58
74
|
}
|
|
59
75
|
return null;
|
|
60
76
|
}
|
|
61
77
|
function printSchemaLoadedMessage(schemaPath) {
|
|
62
|
-
process.
|
|
78
|
+
process.stderr.write((0, import_chunk_PG5FDKSF.dim)(`Prisma schema loaded from ${import_path.default.relative(process.cwd(), schemaPath)}.`) + "\n");
|
|
63
79
|
}
|
|
64
80
|
async function readSchemaFromSingleFile(schemaPath) {
|
|
65
81
|
debug("Reading schema from single file", schemaPath);
|
|
@@ -101,29 +117,24 @@ async function readSchemaFromFileOrDirectory(schemaPath) {
|
|
|
101
117
|
}
|
|
102
118
|
return { ok: false, error: { kind: "WrongType", path: schemaPath, expectedTypes: ["file", "directory"] } };
|
|
103
119
|
}
|
|
104
|
-
async function getSchemaWithPathInternal(
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
);
|
|
115
|
-
}
|
|
116
|
-
return customSchemaResult;
|
|
117
|
-
}
|
|
118
|
-
const prismaConfigResult = await readSchemaFromPrismaConfigBasedLocation(schemaPathFromConfig);
|
|
119
|
-
if (prismaConfigResult.ok) {
|
|
120
|
-
return prismaConfigResult;
|
|
120
|
+
async function getSchemaWithPathInternal({
|
|
121
|
+
schemaPath,
|
|
122
|
+
cwd,
|
|
123
|
+
argumentName
|
|
124
|
+
}) {
|
|
125
|
+
if ("cliProvidedPath" in schemaPath) {
|
|
126
|
+
return {
|
|
127
|
+
ok: true,
|
|
128
|
+
schema: await getCliProvidedSchemaFile(schemaPath.cliProvidedPath, cwd, argumentName)
|
|
129
|
+
};
|
|
121
130
|
}
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
131
|
+
if ("configProvidedPath" in schemaPath) {
|
|
132
|
+
return {
|
|
133
|
+
ok: true,
|
|
134
|
+
schema: await getConfigProvidedSchemaFile(schemaPath.configProvidedPath)
|
|
135
|
+
};
|
|
125
136
|
}
|
|
126
|
-
const defaultResult = await getDefaultSchema(
|
|
137
|
+
const defaultResult = await getDefaultSchema(schemaPath.baseDir);
|
|
127
138
|
if (defaultResult.ok) {
|
|
128
139
|
return defaultResult;
|
|
129
140
|
}
|
|
@@ -162,13 +173,20 @@ function renderDefaultLookupError(error, cwd) {
|
|
|
162
173
|
parts.push("\nSee also https://pris.ly/d/prisma-schema-location");
|
|
163
174
|
return parts.join("\n");
|
|
164
175
|
}
|
|
165
|
-
async function
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
176
|
+
async function getCliProvidedSchemaFile(schemaPathFromArgs, cwd = process.cwd(), argumentName = "--schema") {
|
|
177
|
+
const absPath = import_path.default.resolve(cwd, schemaPathFromArgs);
|
|
178
|
+
const customSchemaResult = await readSchemaFromFileOrDirectory(absPath);
|
|
179
|
+
if (!customSchemaResult.ok) {
|
|
180
|
+
const relPath = import_path.default.relative(cwd, absPath);
|
|
181
|
+
throw new Error(
|
|
182
|
+
`Could not load \`${argumentName}\` from provided path \`${relPath}\`: ${renderLookupError(
|
|
183
|
+
customSchemaResult.error
|
|
184
|
+
)}`
|
|
185
|
+
);
|
|
171
186
|
}
|
|
187
|
+
return customSchemaResult.schema;
|
|
188
|
+
}
|
|
189
|
+
async function getConfigProvidedSchemaFile(schemaPathFromConfig) {
|
|
172
190
|
const schemaResult = await readSchemaFromFileOrDirectory(schemaPathFromConfig);
|
|
173
191
|
if (!schemaResult.ok) {
|
|
174
192
|
throw new Error(
|
|
@@ -177,37 +195,7 @@ async function readSchemaFromPrismaConfigBasedLocation(schemaPathFromConfig) {
|
|
|
177
195
|
)}`
|
|
178
196
|
);
|
|
179
197
|
}
|
|
180
|
-
return schemaResult;
|
|
181
|
-
}
|
|
182
|
-
async function getSchemaFromPackageJson(cwd) {
|
|
183
|
-
const prismaConfig = await (0, import_config.loadConfigFromPackageJson)(cwd);
|
|
184
|
-
debug("prismaConfig", prismaConfig);
|
|
185
|
-
if (!prismaConfig || !prismaConfig.config?.schema) {
|
|
186
|
-
return { ok: false, error: { kind: "PackageJsonNotConfigured" } };
|
|
187
|
-
}
|
|
188
|
-
const schemaPathFromPkgJson = prismaConfig.config.schema;
|
|
189
|
-
if (typeof schemaPathFromPkgJson !== "string") {
|
|
190
|
-
throw new Error(
|
|
191
|
-
`Provided schema path \`${schemaPathFromPkgJson}\` from \`${import_path.default.relative(
|
|
192
|
-
cwd,
|
|
193
|
-
prismaConfig.loadedFromFile
|
|
194
|
-
)}\` must be of type string`
|
|
195
|
-
);
|
|
196
|
-
}
|
|
197
|
-
const absoluteSchemaPath = import_path.default.isAbsolute(schemaPathFromPkgJson) ? schemaPathFromPkgJson : import_path.default.resolve(import_path.default.dirname(prismaConfig.loadedFromFile), schemaPathFromPkgJson);
|
|
198
|
-
const lookupResult = await readSchemaFromFileOrDirectory(absoluteSchemaPath);
|
|
199
|
-
if (!lookupResult.ok) {
|
|
200
|
-
throw new Error(
|
|
201
|
-
`Could not load schema from \`${import_path.default.relative(
|
|
202
|
-
cwd,
|
|
203
|
-
absoluteSchemaPath
|
|
204
|
-
)}\` provided by "prisma.schema" config of \`${import_path.default.relative(
|
|
205
|
-
cwd,
|
|
206
|
-
prismaConfig.loadedFromFile
|
|
207
|
-
)}\`: ${renderLookupError(lookupResult.error)}`
|
|
208
|
-
);
|
|
209
|
-
}
|
|
210
|
-
return lookupResult;
|
|
198
|
+
return schemaResult.schema;
|
|
211
199
|
}
|
|
212
200
|
async function getDefaultSchema(cwd, failures = []) {
|
|
213
201
|
const lookupPaths = [import_path.default.join(cwd, "schema.prisma"), import_path.default.join(cwd, "prisma", "schema.prisma")];
|
|
@@ -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_2GPDFPDR_exports = {};
|
|
30
|
+
__export(chunk_2GPDFPDR_exports, {
|
|
31
31
|
getEnginesInfo: () => getEnginesInfo,
|
|
32
32
|
resolveEngine: () => resolveEngine
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
35
|
-
var
|
|
34
|
+
module.exports = __toCommonJS(chunk_2GPDFPDR_exports);
|
|
35
|
+
var import_chunk_Q75TMXCR = require("./chunk-Q75TMXCR.js");
|
|
36
36
|
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
|
37
|
-
var
|
|
37
|
+
var import_chunk_DQWKFZPY = require("./chunk-DQWKFZPY.js");
|
|
38
38
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
|
39
39
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
|
40
40
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
|
@@ -131,7 +131,7 @@ async function resolveEngine(binaryName) {
|
|
|
131
131
|
const enginePathEither = await (0, import_function2.pipe)(
|
|
132
132
|
pathFromEnvOption,
|
|
133
133
|
fold(
|
|
134
|
-
() => (0,
|
|
134
|
+
() => (0, import_chunk_DQWKFZPY.safeResolveBinary)(binaryName),
|
|
135
135
|
(pathFromEnv) => (0, import_chunk_5DBOS77Y.right2)(pathFromEnv.path)
|
|
136
136
|
)
|
|
137
137
|
)();
|
|
@@ -139,7 +139,7 @@ async function resolveEngine(binaryName) {
|
|
|
139
139
|
enginePathEither,
|
|
140
140
|
import_chunk_5DBOS77Y.fromEither,
|
|
141
141
|
(0, import_chunk_5DBOS77Y.chain)((enginePath) => {
|
|
142
|
-
return (0,
|
|
142
|
+
return (0, import_chunk_Q75TMXCR.safeGetEngineVersion)(enginePath, binaryName);
|
|
143
143
|
})
|
|
144
144
|
)();
|
|
145
145
|
const engineInfo = {
|
|
@@ -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_334ZBKRR_exports = {};
|
|
20
|
+
__export(chunk_334ZBKRR_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_334ZBKRR_exports);
|
|
28
|
+
var import_chunk_KOBX6GKI = require("./chunk-KOBX6GKI.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_KOBX6GKI.prismaSchemaWasm.lint(JSON.stringify(schemas));
|
|
33
33
|
const lintDiagnostics = JSON.parse(lintResult);
|
|
34
34
|
return lintDiagnostics;
|
|
35
35
|
}
|
|
@@ -26,83 +26,58 @@ 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_3PNJ6ZQE_exports = {};
|
|
30
|
+
__export(chunk_3PNJ6ZQE_exports, {
|
|
31
31
|
checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
|
|
32
|
-
checkUnsupportedSchemaEngineWasm: () => checkUnsupportedSchemaEngineWasm,
|
|
33
|
-
forbiddenCmdFlagWithSchemaEngineWasm: () => forbiddenCmdFlagWithSchemaEngineWasm,
|
|
34
32
|
forbiddenCmdWithDataProxyFlagMessage: () => forbiddenCmdWithDataProxyFlagMessage,
|
|
35
33
|
formatSchema: () => formatSchema,
|
|
36
34
|
getBinaryTargetForCurrentPlatform: () => import_get_platform2.getBinaryTargetForCurrentPlatform,
|
|
37
35
|
getGenerator: () => getGenerator,
|
|
38
36
|
getGenerators: () => getGenerators,
|
|
39
|
-
|
|
37
|
+
getSchemaDatasourceProvider: () => getSchemaDatasourceProvider,
|
|
40
38
|
knownBinaryTargets: () => knownBinaryTargets,
|
|
41
39
|
loadSchemaContext: () => loadSchemaContext,
|
|
42
40
|
processSchemaResult: () => processSchemaResult,
|
|
43
41
|
skipIndex: () => skipIndex
|
|
44
42
|
});
|
|
45
|
-
module.exports = __toCommonJS(
|
|
43
|
+
module.exports = __toCommonJS(chunk_3PNJ6ZQE_exports);
|
|
44
|
+
var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
|
|
45
|
+
var import_chunk_GH2WAX5Y = require("./chunk-GH2WAX5Y.js");
|
|
46
46
|
var import_chunk_X3P4J7WW = require("./chunk-X3P4J7WW.js");
|
|
47
47
|
var import_chunk_LRU47BGE = require("./chunk-LRU47BGE.js");
|
|
48
|
-
var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
|
|
49
|
-
var import_chunk_F2OZV76L = require("./chunk-F2OZV76L.js");
|
|
50
|
-
var import_chunk_RS2R7COT = require("./chunk-RS2R7COT.js");
|
|
51
48
|
var import_chunk_GXW4NTU2 = require("./chunk-GXW4NTU2.js");
|
|
52
49
|
var import_chunk_5FJ3MENK = require("./chunk-5FJ3MENK.js");
|
|
53
|
-
var
|
|
54
|
-
var
|
|
55
|
-
var import_chunk_46ABODUM = require("./chunk-46ABODUM.js");
|
|
50
|
+
var import_chunk_DXWYZA7B = require("./chunk-DXWYZA7B.js");
|
|
51
|
+
var import_chunk_CQVWHHIJ = require("./chunk-CQVWHHIJ.js");
|
|
56
52
|
var import_chunk_I6WLABB2 = require("./chunk-I6WLABB2.js");
|
|
57
53
|
var import_chunk_CRVLHWC5 = require("./chunk-CRVLHWC5.js");
|
|
58
|
-
var
|
|
59
|
-
var
|
|
60
|
-
var
|
|
61
|
-
var
|
|
62
|
-
var
|
|
63
|
-
var
|
|
64
|
-
var import_chunk_ZJWZK45Z = require("./chunk-ZJWZK45Z.js");
|
|
54
|
+
var import_chunk_PRGRB27V = require("./chunk-PRGRB27V.js");
|
|
55
|
+
var import_chunk_4A2DO32A = require("./chunk-4A2DO32A.js");
|
|
56
|
+
var import_chunk_AYPKO22A = require("./chunk-AYPKO22A.js");
|
|
57
|
+
var import_chunk_4UM3NWZ3 = require("./chunk-4UM3NWZ3.js");
|
|
58
|
+
var import_chunk_T7XMJ6KH = require("./chunk-T7XMJ6KH.js");
|
|
59
|
+
var import_chunk_2BXDHSSY = require("./chunk-2BXDHSSY.js");
|
|
65
60
|
var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
|
|
66
61
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
|
67
62
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
68
63
|
var import_chunk_BPDMLM32 = require("./chunk-BPDMLM32.js");
|
|
69
64
|
var import_chunk_IOIAK7V7 = require("./chunk-IOIAK7V7.js");
|
|
65
|
+
var import_chunk_BXIKQUP5 = require("./chunk-BXIKQUP5.js");
|
|
66
|
+
var import_chunk_ZJWZK45Z = require("./chunk-ZJWZK45Z.js");
|
|
70
67
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
71
|
-
var import_chunk_BVJP43JS = require("./chunk-BVJP43JS.js");
|
|
72
68
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
|
73
|
-
var
|
|
69
|
+
var import_node_path = __toESM(require("node:path"));
|
|
74
70
|
var import_debug = __toESM(require("@prisma/debug"));
|
|
75
71
|
var import_debug2 = __toESM(require("@prisma/debug"));
|
|
76
72
|
var import_engines = require("@prisma/engines");
|
|
77
73
|
var import_get_platform = require("@prisma/get-platform");
|
|
78
|
-
var
|
|
74
|
+
var import_path = __toESM(require("path"));
|
|
79
75
|
var import_get_platform2 = require("@prisma/get-platform");
|
|
80
|
-
var forbiddenCmdFlagWithSchemaEngineWasm = ({ cmd, flag }) => `
|
|
81
|
-
Passing the ${(0, import_chunk_PG5FDKSF.green)(`${flag}`)} flag to the ${(0, import_chunk_PG5FDKSF.green)(`prisma ${cmd}`)} command is not supported when
|
|
82
|
-
defining an ${(0, import_chunk_PG5FDKSF.green)(`adapter`)} in Prisma config file (e.g., ${(0, import_chunk_PG5FDKSF.green)(`\`prisma.config.ts\``)}).
|
|
83
|
-
|
|
84
|
-
More information about this limitation: ${(0, import_chunk_I6WLABB2.link)("https://pris.ly/d/schema-engine-limitations")}
|
|
85
|
-
`;
|
|
86
|
-
function checkUnsupportedSchemaEngineWasm({
|
|
87
|
-
cmd,
|
|
88
|
-
config,
|
|
89
|
-
args,
|
|
90
|
-
flags
|
|
91
|
-
}) {
|
|
92
|
-
if (config.engine !== "js") {
|
|
93
|
-
return;
|
|
94
|
-
}
|
|
95
|
-
for (const flag of flags) {
|
|
96
|
-
if (args[flag] !== void 0) {
|
|
97
|
-
throw new Error(forbiddenCmdFlagWithSchemaEngineWasm({ cmd, flag }));
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
76
|
var debug = (0, import_debug.default)("prisma:format");
|
|
102
77
|
async function formatSchema({ schemas }, inputFormattingOptions) {
|
|
103
78
|
if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
|
|
104
79
|
handleFormatPanic(() => {
|
|
105
|
-
|
|
80
|
+
import_chunk_T7XMJ6KH.prismaSchemaWasm.debug_panic();
|
|
106
81
|
});
|
|
107
82
|
}
|
|
108
83
|
const defaultFormattingOptions = {
|
|
@@ -119,10 +94,10 @@ async function formatSchema({ schemas }, inputFormattingOptions) {
|
|
|
119
94
|
const { formattedMultipleSchemas, lintDiagnostics } = handleFormatPanic(() => {
|
|
120
95
|
const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas), documentFormattingParams);
|
|
121
96
|
const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
|
|
122
|
-
const lintDiagnostics2 = (0,
|
|
97
|
+
const lintDiagnostics2 = (0, import_chunk_PRGRB27V.lintSchema)({ schemas: formattedMultipleSchemas2 });
|
|
123
98
|
return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
|
|
124
99
|
});
|
|
125
|
-
const lintWarnings = (0,
|
|
100
|
+
const lintWarnings = (0, import_chunk_PRGRB27V.getLintWarningsAsText)(lintDiagnostics);
|
|
126
101
|
if (lintWarnings && import_chunk_ZJWZK45Z.logger_exports.should.warn()) {
|
|
127
102
|
console.warn(lintWarnings);
|
|
128
103
|
}
|
|
@@ -149,60 +124,37 @@ function handleFormatPanic(tryCb) {
|
|
|
149
124
|
}
|
|
150
125
|
}
|
|
151
126
|
function formatWasm(schema, documentFormattingParams) {
|
|
152
|
-
const formattedSchema =
|
|
127
|
+
const formattedSchema = import_chunk_T7XMJ6KH.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
|
|
153
128
|
return formattedSchema;
|
|
154
129
|
}
|
|
155
|
-
async function loadSchemaContext({
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
schemaPathArgumentName = "--schema",
|
|
163
|
-
cwd = process.cwd()
|
|
164
|
-
} = {}) {
|
|
130
|
+
async function loadSchemaContext({ schemaPath, printLoadMessage, allowNull, schemaPathArgumentName, cwd } = {
|
|
131
|
+
schemaPath: { baseDir: process.cwd() },
|
|
132
|
+
printLoadMessage: true,
|
|
133
|
+
allowNull: false,
|
|
134
|
+
schemaPathArgumentName: "--schema",
|
|
135
|
+
cwd: process.cwd()
|
|
136
|
+
}) {
|
|
165
137
|
let schemaResult = null;
|
|
166
138
|
if (allowNull) {
|
|
167
|
-
schemaResult = await (0,
|
|
168
|
-
argumentName: schemaPathArgumentName,
|
|
169
|
-
cwd
|
|
170
|
-
});
|
|
139
|
+
schemaResult = await (0, import_chunk_2BXDHSSY.getSchemaWithPathOptional)({ schemaPath, cwd, argumentName: schemaPathArgumentName });
|
|
171
140
|
if (!schemaResult) return null;
|
|
172
141
|
} else {
|
|
173
|
-
schemaResult = await (0,
|
|
174
|
-
argumentName: schemaPathArgumentName,
|
|
175
|
-
cwd
|
|
176
|
-
});
|
|
142
|
+
schemaResult = await (0, import_chunk_2BXDHSSY.getSchemaWithPath)({ schemaPath, cwd, argumentName: schemaPathArgumentName });
|
|
177
143
|
}
|
|
178
|
-
return processSchemaResult({ schemaResult,
|
|
144
|
+
return processSchemaResult({ schemaResult, printLoadMessage, cwd });
|
|
179
145
|
}
|
|
180
146
|
async function processSchemaResult({
|
|
181
147
|
schemaResult,
|
|
182
|
-
schemaEngineConfig,
|
|
183
148
|
printLoadMessage = true,
|
|
184
|
-
ignoreEnvVarErrors = false,
|
|
185
149
|
cwd = process.cwd()
|
|
186
150
|
}) {
|
|
187
|
-
const loadedFromPathForLogMessages =
|
|
151
|
+
const loadedFromPathForLogMessages = import_node_path.default.relative(cwd, schemaResult.schemaPath);
|
|
188
152
|
const schemaRootDir = schemaResult.schemaRootDir || cwd;
|
|
189
153
|
if (printLoadMessage) {
|
|
190
|
-
(0,
|
|
154
|
+
(0, import_chunk_2BXDHSSY.printSchemaLoadedMessage)(loadedFromPathForLogMessages);
|
|
191
155
|
}
|
|
192
|
-
const configFromPsl = await (0,
|
|
193
|
-
const
|
|
194
|
-
const primaryDatasource = (0, import_chunk_XKZ6CBLA.z)(schemaEngineConfig).with({ engine: "classic" }, ({ datasource }) => {
|
|
195
|
-
const { url, directUrl, shadowDatabaseUrl } = datasource;
|
|
196
|
-
const primaryDatasource2 = {
|
|
197
|
-
...datasourceFromPsl,
|
|
198
|
-
url: { fromEnvVar: null, value: url },
|
|
199
|
-
directUrl: directUrl ? { fromEnvVar: null, value: directUrl } : void 0,
|
|
200
|
-
shadowDatabaseUrl: shadowDatabaseUrl ? { fromEnvVar: null, value: shadowDatabaseUrl } : void 0,
|
|
201
|
-
[Symbol.for("engine.classic")]: true
|
|
202
|
-
};
|
|
203
|
-
return primaryDatasource2;
|
|
204
|
-
}).otherwise(() => datasourceFromPsl);
|
|
205
|
-
const primaryDatasourceDirectory = getPrimaryDatasourceDirectory(datasourceFromPsl) || schemaRootDir;
|
|
156
|
+
const configFromPsl = await (0, import_chunk_AYPKO22A.getConfig)({ datamodel: schemaResult.schemas });
|
|
157
|
+
const primaryDatasource = configFromPsl.datasources.at(0);
|
|
206
158
|
return {
|
|
207
159
|
schemaFiles: schemaResult.schemas,
|
|
208
160
|
schemaPath: schemaResult.schemaPath,
|
|
@@ -210,19 +162,17 @@ async function processSchemaResult({
|
|
|
210
162
|
datasources: configFromPsl.datasources,
|
|
211
163
|
generators: configFromPsl.generators,
|
|
212
164
|
primaryDatasource,
|
|
213
|
-
primaryDatasourceDirectory,
|
|
214
165
|
warnings: configFromPsl.warnings,
|
|
215
166
|
loadedFromPathForLogMessages
|
|
216
167
|
};
|
|
217
168
|
}
|
|
218
|
-
function
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
return import_path.default.dirname(datasourcePath);
|
|
169
|
+
function getSchemaDatasourceProvider(schemaContext) {
|
|
170
|
+
if (schemaContext.primaryDatasource === void 0) {
|
|
171
|
+
throw new Error("Schema must contain a datasource block");
|
|
222
172
|
}
|
|
223
|
-
return
|
|
173
|
+
return schemaContext.primaryDatasource.activeProvider;
|
|
224
174
|
}
|
|
225
|
-
var import_p_map = (0, import_chunk_4VNS5WPM.__toESM)((0,
|
|
175
|
+
var import_p_map = (0, import_chunk_4VNS5WPM.__toESM)((0, import_chunk_BXIKQUP5.require_p_map)());
|
|
226
176
|
var debug2 = (0, import_debug2.default)("prisma:getGenerators");
|
|
227
177
|
async function getGenerators(options) {
|
|
228
178
|
if (options.registry === void 0 && options.providerAliases !== void 0) {
|
|
@@ -246,29 +196,27 @@ async function getGenerators(options) {
|
|
|
246
196
|
skipDownload,
|
|
247
197
|
binaryPathsOverride,
|
|
248
198
|
generatorNames = [],
|
|
249
|
-
postinstall,
|
|
250
|
-
noEngine,
|
|
251
199
|
allowNoModels = true,
|
|
252
200
|
typedSql
|
|
253
201
|
} = options;
|
|
254
|
-
const schemaContext = !options.schemaContext && schemaPath ? await loadSchemaContext({
|
|
202
|
+
const schemaContext = !options.schemaContext && schemaPath ? await loadSchemaContext({ schemaPath: { cliProvidedPath: schemaPath } }) : options.schemaContext;
|
|
255
203
|
if (!schemaContext) {
|
|
256
204
|
throw new Error(`no schema provided for getGenerators`);
|
|
257
205
|
}
|
|
258
206
|
if (!schemaContext.primaryDatasource) {
|
|
259
|
-
throw new Error(
|
|
207
|
+
throw new Error(import_chunk_DXWYZA7B.missingDatasource);
|
|
260
208
|
}
|
|
261
209
|
(0, import_chunk_5FJ3MENK.printConfigWarnings)(schemaContext.warnings);
|
|
262
210
|
const previewFeatures = (0, import_chunk_CRVLHWC5.extractPreviewFeatures)(schemaContext.generators);
|
|
263
|
-
const dmmf = await (0,
|
|
211
|
+
const dmmf = await (0, import_chunk_4UM3NWZ3.getDMMF)({
|
|
264
212
|
datamodel: schemaContext.schemaFiles,
|
|
265
213
|
previewFeatures
|
|
266
214
|
});
|
|
267
215
|
if (dmmf.datamodel.models.length === 0 && !allowNoModels) {
|
|
268
216
|
if (schemaContext.primaryDatasource.provider === "mongodb") {
|
|
269
|
-
throw new Error(
|
|
217
|
+
throw new Error(import_chunk_CQVWHHIJ.missingModelMessageMongoDB);
|
|
270
218
|
}
|
|
271
|
-
throw new Error(
|
|
219
|
+
throw new Error(import_chunk_CQVWHHIJ.missingModelMessage);
|
|
272
220
|
}
|
|
273
221
|
const generatorConfigs = filterGenerators(overrideGenerators || schemaContext.generators, generatorNames);
|
|
274
222
|
await validateGenerators(generatorConfigs);
|
|
@@ -277,7 +225,7 @@ async function getGenerators(options) {
|
|
|
277
225
|
const generators = await (0, import_p_map.default)(
|
|
278
226
|
generatorConfigs,
|
|
279
227
|
async (generatorConfig, index) => {
|
|
280
|
-
const baseDir =
|
|
228
|
+
const baseDir = import_path.default.dirname(generatorConfig.sourceFilePath ?? schemaContext.schemaRootDir);
|
|
281
229
|
const providerValue = (0, import_chunk_IOIAK7V7.parseEnvValue)(generatorConfig.provider);
|
|
282
230
|
const generatorDefinition = registry[providerValue] ?? {
|
|
283
231
|
type: "rpc",
|
|
@@ -290,7 +238,7 @@ async function getGenerators(options) {
|
|
|
290
238
|
await generatorInstance.init();
|
|
291
239
|
if (generatorConfig.output) {
|
|
292
240
|
generatorConfig.output = {
|
|
293
|
-
value:
|
|
241
|
+
value: import_path.default.resolve(baseDir, (0, import_chunk_IOIAK7V7.parseEnvValue)(generatorConfig.output)),
|
|
294
242
|
fromEnvVar: null
|
|
295
243
|
};
|
|
296
244
|
generatorConfig.isCustomOutput = true;
|
|
@@ -311,8 +259,7 @@ You need to define \`output\` in the generator block in the schema file.`
|
|
|
311
259
|
fromEnvVar: null
|
|
312
260
|
};
|
|
313
261
|
}
|
|
314
|
-
const datamodel = (0,
|
|
315
|
-
const envPaths = await (0, import_chunk_46ABODUM.getEnvPaths)(schemaContext.schemaPath, { cwd: generatorConfig.output.value });
|
|
262
|
+
const datamodel = (0, import_chunk_4A2DO32A.mergeSchemas)({ schemas: schemaContext.schemaFiles });
|
|
316
263
|
const options2 = {
|
|
317
264
|
datamodel,
|
|
318
265
|
datasources: schemaContext.datasources,
|
|
@@ -323,10 +270,7 @@ You need to define \`output\` in the generator block in the schema file.`
|
|
|
323
270
|
// TODO:(schemaPath) can we get rid of schema path passing here?
|
|
324
271
|
version: version2 || import_engines.enginesVersion,
|
|
325
272
|
// this version makes no sense anymore and should be ignored
|
|
326
|
-
postinstall,
|
|
327
|
-
noEngine,
|
|
328
273
|
allowNoModels,
|
|
329
|
-
envPaths,
|
|
330
274
|
typedSql
|
|
331
275
|
};
|
|
332
276
|
generatorInstance.setOptions(options2);
|
|
@@ -370,18 +314,16 @@ generator gen {
|
|
|
370
314
|
}
|
|
371
315
|
const generatorBinaryTargets = g.options?.generator?.binaryTargets;
|
|
372
316
|
if (generatorBinaryTargets && generatorBinaryTargets.length > 0) {
|
|
373
|
-
for (const
|
|
374
|
-
if (!neededVersions[neededVersion].binaryTargets.find((object) => object.value ===
|
|
375
|
-
neededVersions[neededVersion].binaryTargets.push(
|
|
317
|
+
for (const binaryTarget of generatorBinaryTargets) {
|
|
318
|
+
if (!neededVersions[neededVersion].binaryTargets.find((object) => object.value === binaryTarget.value)) {
|
|
319
|
+
neededVersions[neededVersion].binaryTargets.push(binaryTarget);
|
|
376
320
|
}
|
|
377
321
|
}
|
|
378
322
|
}
|
|
379
323
|
}
|
|
380
324
|
}
|
|
381
|
-
const queryEngineBinaryType = (0, import_engines.getCliQueryEngineBinaryType)();
|
|
382
|
-
const queryEngineType = (0, import_chunk_RS2R7COT.binaryTypeToEngineType)(queryEngineBinaryType);
|
|
383
325
|
debug2("neededVersions", JSON.stringify(neededVersions, null, 2));
|
|
384
|
-
const { binaryPathsByVersion
|
|
326
|
+
const { binaryPathsByVersion } = await (0, import_chunk_GH2WAX5Y.getBinaryPathsByVersion)({
|
|
385
327
|
neededVersions,
|
|
386
328
|
// We're lazily computing the binary target here, to avoid printing the
|
|
387
329
|
// `Prisma failed to detect the libssl/openssl version to use` warning
|
|
@@ -402,17 +344,6 @@ generator gen {
|
|
|
402
344
|
const generatorBinaryPaths = (0, import_chunk_GXW4NTU2.pick)(binaryPaths ?? {}, generator.manifest.requiresEngines);
|
|
403
345
|
debug2({ generatorBinaryPaths });
|
|
404
346
|
generator.setBinaryPaths(generatorBinaryPaths);
|
|
405
|
-
if (engineVersion !== version2 && generator.options && generator.manifest.requiresEngines.includes(queryEngineType) && generatorBinaryPaths[queryEngineType] && generatorBinaryPaths[queryEngineType]?.[binaryTarget]) {
|
|
406
|
-
const customDmmf = await (0, import_chunk_2HX6D6UC.getDMMF)({
|
|
407
|
-
datamodel: schemaContext.schemaFiles,
|
|
408
|
-
previewFeatures
|
|
409
|
-
});
|
|
410
|
-
const options2 = { ...generator.options, dmmf: customDmmf };
|
|
411
|
-
debug2("generator.manifest.prettyName", generator.manifest.prettyName);
|
|
412
|
-
debug2("options", options2);
|
|
413
|
-
debug2("options.generator.binaryTargets", options2.generator.binaryTargets);
|
|
414
|
-
generator.setOptions(options2);
|
|
415
|
-
}
|
|
416
347
|
}
|
|
417
348
|
}
|
|
418
349
|
return generators;
|
|
@@ -437,17 +368,6 @@ var oldToNewBinaryTargetsMapping = {
|
|
|
437
368
|
async function validateGenerators(generators) {
|
|
438
369
|
const binaryTarget = await (0, import_get_platform.getBinaryTargetForCurrentPlatform)();
|
|
439
370
|
for (const generator of generators) {
|
|
440
|
-
if (generator.config.platforms) {
|
|
441
|
-
throw new Error(
|
|
442
|
-
`The \`platforms\` field on the generator definition is deprecated. Please rename it to \`binaryTargets\`.`
|
|
443
|
-
);
|
|
444
|
-
}
|
|
445
|
-
if (generator.config.pinnedBinaryTargets) {
|
|
446
|
-
throw new Error(
|
|
447
|
-
`The \`pinnedBinaryTargets\` field on the generator definition is deprecated.
|
|
448
|
-
Please use the PRISMA_QUERY_ENGINE_BINARY env var instead to pin the binary target.`
|
|
449
|
-
);
|
|
450
|
-
}
|
|
451
371
|
if (generator.binaryTargets) {
|
|
452
372
|
const binaryTargets2 = generator.binaryTargets && generator.binaryTargets.length > 0 ? generator.binaryTargets : [{ fromEnvVar: null, value: "native" }];
|
|
453
373
|
const resolvedBinaryTargets = binaryTargets2.flatMap((object) => (0, import_chunk_IOIAK7V7.parseBinaryTargetsEnvValue)(object)).map((p) => p === "native" ? binaryTarget : p);
|
|
@@ -507,25 +427,17 @@ function filterGenerators(generators, generatorNames) {
|
|
|
507
427
|
}
|
|
508
428
|
return filtered;
|
|
509
429
|
}
|
|
510
|
-
var forbiddenCmdWithDataProxyFlagMessage = (
|
|
511
|
-
Using an Accelerate URL is not supported for this CLI command ${(0, import_chunk_PG5FDKSF.green)(`prisma ${
|
|
512
|
-
Please use a direct connection to your database
|
|
430
|
+
var forbiddenCmdWithDataProxyFlagMessage = (cmd) => `
|
|
431
|
+
Using an Accelerate URL is not supported for this CLI command ${(0, import_chunk_PG5FDKSF.green)(`prisma ${cmd}`)} yet.
|
|
432
|
+
Please use a direct connection to your database in \`prisma.config.ts\`.
|
|
513
433
|
|
|
514
434
|
More information about this limitation: ${(0, import_chunk_I6WLABB2.link)("https://pris.ly/d/accelerate-limitations")}
|
|
515
435
|
`;
|
|
516
436
|
function checkUnsupportedDataProxy({
|
|
517
437
|
cmd,
|
|
518
|
-
|
|
519
|
-
urls = []
|
|
438
|
+
validatedConfig
|
|
520
439
|
}) {
|
|
521
|
-
|
|
522
|
-
if (url2 && url2.includes("prisma://")) {
|
|
523
|
-
throw new Error(forbiddenCmdWithDataProxyFlagMessage(cmd));
|
|
524
|
-
}
|
|
525
|
-
}
|
|
526
|
-
if (!schemaContext?.primaryDatasource) return;
|
|
527
|
-
const url = (0, import_chunk_MS5VOWI6.resolveUrl)((0, import_chunk_MS5VOWI6.getEffectiveUrl)(schemaContext.primaryDatasource));
|
|
528
|
-
if (url?.startsWith("prisma://")) {
|
|
440
|
+
if (validatedConfig.datasource.url.startsWith("prisma://")) {
|
|
529
441
|
throw new Error(forbiddenCmdWithDataProxyFlagMessage(cmd));
|
|
530
442
|
}
|
|
531
443
|
}
|
|
@@ -26,13 +26,13 @@ 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_3U4QB2G3_exports = {};
|
|
30
|
+
__export(chunk_3U4QB2G3_exports, {
|
|
31
31
|
credentialsToUri: () => credentialsToUri,
|
|
32
32
|
protocolToConnectorType: () => protocolToConnectorType,
|
|
33
33
|
uriToCredentials: () => uriToCredentials
|
|
34
34
|
});
|
|
35
|
-
module.exports = __toCommonJS(
|
|
35
|
+
module.exports = __toCommonJS(chunk_3U4QB2G3_exports);
|
|
36
36
|
var import_chunk_LPNBWFQ3 = require("./chunk-LPNBWFQ3.js");
|
|
37
37
|
var import_path = __toESM(require("path"));
|
|
38
38
|
var NodeURL = __toESM(require("url"));
|
|
@@ -91,9 +91,7 @@ function uriToCredentials(connectionString) {
|
|
|
91
91
|
try {
|
|
92
92
|
uri = new NodeURL.URL(connectionString);
|
|
93
93
|
} catch (e) {
|
|
94
|
-
throw new Error(
|
|
95
|
-
"Invalid data source URL, see https://www.prisma.io/docs/reference/database-reference/connection-urls"
|
|
96
|
-
);
|
|
94
|
+
throw new Error("Invalid data source URL, see https://pris.ly/d/config-url");
|
|
97
95
|
}
|
|
98
96
|
const type = protocolToConnectorType(uri.protocol);
|
|
99
97
|
const exists = (str) => str && str.length > 0;
|