@prisma/internals 7.1.0-integration-fix-fix-missing-cockroach-wasm.2 → 7.1.1-dev.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-V6DWK6TN.js → chunk-2GPDFPDR.js} +7 -7
- package/dist/{chunk-JHI5AFLO.js → chunk-2NSZUVML.js} +33 -40
- package/dist/{chunk-LYFOJ5NK.js → chunk-3U4QB2G3.js} +4 -6
- package/dist/{chunk-OKVM3CW4.js → chunk-42R3EIRM.js} +55 -31
- package/dist/{chunk-SYIAPRBK.js → chunk-45266XOU.js} +5 -5
- package/dist/{chunk-MWQ2Y7KM.js → chunk-5DHFYH6V.js} +7 -7
- package/dist/{chunk-HPNH7TNS.js → chunk-7K7RIULS.js} +8 -8
- package/dist/{chunk-K4IC7NPI.js → chunk-CQVWHHIJ.js} +7 -7
- package/dist/{chunk-EHC4ODP6.js → chunk-DCI7IFH4.js} +6 -6
- package/dist/{chunk-QXSCGG3B.js → chunk-DJDBBPWI.js} +5 -5
- package/dist/{chunk-FASYSGWP.js → chunk-DQWKFZPY.js} +4 -4
- package/dist/{chunk-BGMZPA2F.js → chunk-DXWYZA7B.js} +5 -5
- package/dist/{chunk-6QBIOHAP.js → chunk-EA7NPUXZ.js} +5 -5
- package/dist/{chunk-A2USANLU.js → chunk-IOUBRMAS.js} +33 -40
- package/dist/{chunk-UOKMD4DT.js → chunk-KQARZ6Q2.js} +5 -5
- package/dist/{chunk-MNP6VO5F.js → chunk-Q75TMXCR.js} +5 -5
- package/dist/{chunk-BNU7VLWS.js → chunk-QKCH5L2O.js} +5 -5
- package/dist/{chunk-D3USTTQA.js → chunk-SBIVIXEF.js} +8 -8
- package/dist/{chunk-67VG7D7O.js → chunk-TAXSI6L6.js} +5 -5
- package/dist/{chunk-GL7OANR6.js → chunk-TCDF53CN.js} +6 -6
- package/dist/{chunk-VNIE2AZB.js → chunk-TQCLUNM2.js} +4 -4
- package/dist/{chunk-BENPILNZ.js → chunk-TVTVO7BZ.js} +8 -8
- package/dist/{chunk-F337MPOC.js → chunk-VLNU66QF.js} +5 -5
- package/dist/{chunk-V7KWPZT2.js → chunk-VTJBF462.js} +8 -8
- package/dist/{chunk-RNNI23IA.js → chunk-VX75P7BL.js} +8 -8
- package/dist/{chunk-OJNWNV3P.js → chunk-WFSL5MRY.js} +5 -5
- package/dist/{chunk-N4D5LHSX.js → chunk-WKN2CXST.js} +7 -7
- package/dist/{chunk-Y4HP7ICO.js → chunk-X4HAZCOA.js} +8 -8
- package/dist/{chunk-S26FTO4G.js → chunk-XCPAWJOU.js} +5 -5
- package/dist/{chunk-TRAG7WPX.js → chunk-YJVCIN4F.js} +6 -8
- package/dist/cli/checkUnsupportedDataProxy.js +28 -29
- package/dist/cli/getSchema.d.ts +27 -5
- package/dist/cli/getSchema.js +7 -4
- package/dist/cli/hashes.d.ts +2 -1
- package/dist/cli/hashes.js +4 -4
- package/dist/cli/schemaContext.d.ts +2 -2
- package/dist/cli/schemaContext.js +29 -30
- 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 +27 -28
- package/dist/engine-commands/getConfig.js +7 -7
- package/dist/engine-commands/getDmmf.js +7 -7
- package/dist/engine-commands/getEngineVersion.js +5 -5
- package/dist/engine-commands/getEnginesInfo.js +6 -6
- package/dist/engine-commands/index.js +37 -38
- 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 +30 -31
- package/dist/highlight/highlight.js +5 -5
- package/dist/index.d.ts +1 -2
- package/dist/index.js +66 -66
- package/dist/resolveBinary.js +7 -7
- package/dist/schemaEngineCommands.js +8 -8
- package/dist/utils/getVersionFromPackageJson.js +3 -3
- package/dist/utils/missingDatasource.js +4 -4
- package/dist/utils/missingGeneratorMessage.js +6 -6
- package/dist/wasm.js +5 -5
- package/package.json +13 -13
- package/dist/chunk-HW5RCZSE.js +0 -1
- package/dist/tracing/types.d.ts +0 -54
- package/dist/tracing/types.js +0 -2
|
@@ -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 = {
|
|
@@ -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_2NSZUVML_exports = {};
|
|
30
|
+
__export(chunk_2NSZUVML_exports, {
|
|
31
31
|
checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
|
|
32
32
|
forbiddenCmdWithDataProxyFlagMessage: () => forbiddenCmdWithDataProxyFlagMessage,
|
|
33
33
|
formatSchema: () => formatSchema,
|
|
@@ -40,23 +40,23 @@ __export(chunk_JHI5AFLO_exports, {
|
|
|
40
40
|
processSchemaResult: () => processSchemaResult,
|
|
41
41
|
skipIndex: () => skipIndex
|
|
42
42
|
});
|
|
43
|
-
module.exports = __toCommonJS(
|
|
43
|
+
module.exports = __toCommonJS(chunk_2NSZUVML_exports);
|
|
44
44
|
var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
|
|
45
45
|
var import_chunk_PKOQQT7I = require("./chunk-PKOQQT7I.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_5FJ3MENK = require("./chunk-5FJ3MENK.js");
|
|
49
|
-
var import_chunk_K4IC7NPI = require("./chunk-K4IC7NPI.js");
|
|
50
48
|
var import_chunk_GXW4NTU2 = require("./chunk-GXW4NTU2.js");
|
|
51
|
-
var
|
|
49
|
+
var import_chunk_5FJ3MENK = require("./chunk-5FJ3MENK.js");
|
|
50
|
+
var import_chunk_DXWYZA7B = require("./chunk-DXWYZA7B.js");
|
|
51
|
+
var import_chunk_CQVWHHIJ = require("./chunk-CQVWHHIJ.js");
|
|
52
52
|
var import_chunk_I6WLABB2 = require("./chunk-I6WLABB2.js");
|
|
53
53
|
var import_chunk_CRVLHWC5 = require("./chunk-CRVLHWC5.js");
|
|
54
|
-
var
|
|
55
|
-
var
|
|
56
|
-
var
|
|
57
|
-
var
|
|
58
|
-
var
|
|
59
|
-
var
|
|
54
|
+
var import_chunk_QKCH5L2O = require("./chunk-QKCH5L2O.js");
|
|
55
|
+
var import_chunk_5DHFYH6V = require("./chunk-5DHFYH6V.js");
|
|
56
|
+
var import_chunk_VX75P7BL = require("./chunk-VX75P7BL.js");
|
|
57
|
+
var import_chunk_VTJBF462 = require("./chunk-VTJBF462.js");
|
|
58
|
+
var import_chunk_VLNU66QF = require("./chunk-VLNU66QF.js");
|
|
59
|
+
var import_chunk_42R3EIRM = require("./chunk-42R3EIRM.js");
|
|
60
60
|
var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
|
|
61
61
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
|
62
62
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.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_VLNU66QF.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_QKCH5L2O.lintSchema)({ schemas: formattedMultipleSchemas2 });
|
|
98
98
|
return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
|
|
99
99
|
});
|
|
100
|
-
const lintWarnings = (0,
|
|
100
|
+
const lintWarnings = (0, import_chunk_QKCH5L2O.getLintWarningsAsText)(lintDiagnostics);
|
|
101
101
|
if (lintWarnings && import_chunk_ZJWZK45Z.logger_exports.should.warn()) {
|
|
102
102
|
console.warn(lintWarnings);
|
|
103
103
|
}
|
|
@@ -124,29 +124,22 @@ function handleFormatPanic(tryCb) {
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
function formatWasm(schema, documentFormattingParams) {
|
|
127
|
-
const formattedSchema =
|
|
127
|
+
const formattedSchema = import_chunk_VLNU66QF.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
|
|
128
128
|
return formattedSchema;
|
|
129
129
|
}
|
|
130
|
-
async function loadSchemaContext({
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
} = {}) {
|
|
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
|
+
}) {
|
|
138
137
|
let schemaResult = null;
|
|
139
138
|
if (allowNull) {
|
|
140
|
-
schemaResult = await (0,
|
|
141
|
-
argumentName: schemaPathArgumentName,
|
|
142
|
-
cwd
|
|
143
|
-
});
|
|
139
|
+
schemaResult = await (0, import_chunk_42R3EIRM.getSchemaWithPathOptional)({ schemaPath, cwd, argumentName: schemaPathArgumentName });
|
|
144
140
|
if (!schemaResult) return null;
|
|
145
141
|
} else {
|
|
146
|
-
schemaResult = await (0,
|
|
147
|
-
argumentName: schemaPathArgumentName,
|
|
148
|
-
cwd
|
|
149
|
-
});
|
|
142
|
+
schemaResult = await (0, import_chunk_42R3EIRM.getSchemaWithPath)({ schemaPath, cwd, argumentName: schemaPathArgumentName });
|
|
150
143
|
}
|
|
151
144
|
return processSchemaResult({ schemaResult, printLoadMessage, cwd });
|
|
152
145
|
}
|
|
@@ -158,9 +151,9 @@ async function processSchemaResult({
|
|
|
158
151
|
const loadedFromPathForLogMessages = import_node_path.default.relative(cwd, schemaResult.schemaPath);
|
|
159
152
|
const schemaRootDir = schemaResult.schemaRootDir || cwd;
|
|
160
153
|
if (printLoadMessage) {
|
|
161
|
-
(0,
|
|
154
|
+
(0, import_chunk_42R3EIRM.printSchemaLoadedMessage)(loadedFromPathForLogMessages);
|
|
162
155
|
}
|
|
163
|
-
const configFromPsl = await (0,
|
|
156
|
+
const configFromPsl = await (0, import_chunk_VX75P7BL.getConfig)({ datamodel: schemaResult.schemas });
|
|
164
157
|
const primaryDatasource = configFromPsl.datasources.at(0);
|
|
165
158
|
return {
|
|
166
159
|
schemaFiles: schemaResult.schemas,
|
|
@@ -206,24 +199,24 @@ async function getGenerators(options) {
|
|
|
206
199
|
allowNoModels = true,
|
|
207
200
|
typedSql
|
|
208
201
|
} = options;
|
|
209
|
-
const schemaContext = !options.schemaContext && schemaPath ? await loadSchemaContext({
|
|
202
|
+
const schemaContext = !options.schemaContext && schemaPath ? await loadSchemaContext({ schemaPath: { cliProvidedPath: schemaPath } }) : options.schemaContext;
|
|
210
203
|
if (!schemaContext) {
|
|
211
204
|
throw new Error(`no schema provided for getGenerators`);
|
|
212
205
|
}
|
|
213
206
|
if (!schemaContext.primaryDatasource) {
|
|
214
|
-
throw new Error(
|
|
207
|
+
throw new Error(import_chunk_DXWYZA7B.missingDatasource);
|
|
215
208
|
}
|
|
216
209
|
(0, import_chunk_5FJ3MENK.printConfigWarnings)(schemaContext.warnings);
|
|
217
210
|
const previewFeatures = (0, import_chunk_CRVLHWC5.extractPreviewFeatures)(schemaContext.generators);
|
|
218
|
-
const dmmf = await (0,
|
|
211
|
+
const dmmf = await (0, import_chunk_VTJBF462.getDMMF)({
|
|
219
212
|
datamodel: schemaContext.schemaFiles,
|
|
220
213
|
previewFeatures
|
|
221
214
|
});
|
|
222
215
|
if (dmmf.datamodel.models.length === 0 && !allowNoModels) {
|
|
223
216
|
if (schemaContext.primaryDatasource.provider === "mongodb") {
|
|
224
|
-
throw new Error(
|
|
217
|
+
throw new Error(import_chunk_CQVWHHIJ.missingModelMessageMongoDB);
|
|
225
218
|
}
|
|
226
|
-
throw new Error(
|
|
219
|
+
throw new Error(import_chunk_CQVWHHIJ.missingModelMessage);
|
|
227
220
|
}
|
|
228
221
|
const generatorConfigs = filterGenerators(overrideGenerators || schemaContext.generators, generatorNames);
|
|
229
222
|
await validateGenerators(generatorConfigs);
|
|
@@ -266,7 +259,7 @@ You need to define \`output\` in the generator block in the schema file.`
|
|
|
266
259
|
fromEnvVar: null
|
|
267
260
|
};
|
|
268
261
|
}
|
|
269
|
-
const datamodel = (0,
|
|
262
|
+
const datamodel = (0, import_chunk_5DHFYH6V.mergeSchemas)({ schemas: schemaContext.schemaFiles });
|
|
270
263
|
const options2 = {
|
|
271
264
|
datamodel,
|
|
272
265
|
datasources: schemaContext.datasources,
|
|
@@ -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;
|
|
@@ -26,13 +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_42R3EIRM_exports = {};
|
|
30
|
+
__export(chunk_42R3EIRM_exports, {
|
|
31
|
+
createSchemaPathInput: () => createSchemaPathInput,
|
|
32
|
+
getCliProvidedSchemaFile: () => getCliProvidedSchemaFile,
|
|
33
|
+
getConfigProvidedSchemaFile: () => getConfigProvidedSchemaFile,
|
|
31
34
|
getSchemaWithPath: () => getSchemaWithPath,
|
|
32
35
|
getSchemaWithPathOptional: () => getSchemaWithPathOptional,
|
|
33
36
|
printSchemaLoadedMessage: () => printSchemaLoadedMessage
|
|
34
37
|
});
|
|
35
|
-
module.exports = __toCommonJS(
|
|
38
|
+
module.exports = __toCommonJS(chunk_42R3EIRM_exports);
|
|
36
39
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
37
40
|
var import_debug = require("@prisma/debug");
|
|
38
41
|
var import_schema_files_loader = require("@prisma/schema-files-loader");
|
|
@@ -42,15 +45,30 @@ var import_util = require("util");
|
|
|
42
45
|
var readFile = (0, import_util.promisify)(import_fs.default.readFile);
|
|
43
46
|
var stat = (0, import_util.promisify)(import_fs.default.stat);
|
|
44
47
|
var debug = (0, import_debug.Debug)("prisma:getSchema");
|
|
45
|
-
|
|
46
|
-
|
|
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 });
|
|
47
61
|
if (result.ok) {
|
|
48
62
|
return result.schema;
|
|
49
63
|
}
|
|
50
64
|
throw new Error(renderDefaultLookupError(result.error, cwd));
|
|
51
65
|
}
|
|
52
|
-
async function getSchemaWithPathOptional(
|
|
53
|
-
|
|
66
|
+
async function getSchemaWithPathOptional({
|
|
67
|
+
schemaPath,
|
|
68
|
+
cwd = process.cwd(),
|
|
69
|
+
argumentName = "--schema"
|
|
70
|
+
}) {
|
|
71
|
+
const result = await getSchemaWithPathInternal({ schemaPath, cwd, argumentName });
|
|
54
72
|
if (result.ok) {
|
|
55
73
|
return result.schema;
|
|
56
74
|
}
|
|
@@ -99,25 +117,24 @@ async function readSchemaFromFileOrDirectory(schemaPath) {
|
|
|
99
117
|
}
|
|
100
118
|
return { ok: false, error: { kind: "WrongType", path: schemaPath, expectedTypes: ["file", "directory"] } };
|
|
101
119
|
}
|
|
102
|
-
async function getSchemaWithPathInternal(
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
return customSchemaResult;
|
|
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
|
+
};
|
|
115
130
|
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
131
|
+
if ("configProvidedPath" in schemaPath) {
|
|
132
|
+
return {
|
|
133
|
+
ok: true,
|
|
134
|
+
schema: await getConfigProvidedSchemaFile(schemaPath.configProvidedPath)
|
|
135
|
+
};
|
|
119
136
|
}
|
|
120
|
-
const defaultResult = await getDefaultSchema(
|
|
137
|
+
const defaultResult = await getDefaultSchema(schemaPath.baseDir);
|
|
121
138
|
if (defaultResult.ok) {
|
|
122
139
|
return defaultResult;
|
|
123
140
|
}
|
|
@@ -156,13 +173,20 @@ function renderDefaultLookupError(error, cwd) {
|
|
|
156
173
|
parts.push("\nSee also https://pris.ly/d/prisma-schema-location");
|
|
157
174
|
return parts.join("\n");
|
|
158
175
|
}
|
|
159
|
-
async function
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
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
|
+
);
|
|
165
186
|
}
|
|
187
|
+
return customSchemaResult.schema;
|
|
188
|
+
}
|
|
189
|
+
async function getConfigProvidedSchemaFile(schemaPathFromConfig) {
|
|
166
190
|
const schemaResult = await readSchemaFromFileOrDirectory(schemaPathFromConfig);
|
|
167
191
|
if (!schemaResult.ok) {
|
|
168
192
|
throw new Error(
|
|
@@ -171,7 +195,7 @@ async function readSchemaFromPrismaConfigBasedLocation(schemaPathFromConfig) {
|
|
|
171
195
|
)}`
|
|
172
196
|
);
|
|
173
197
|
}
|
|
174
|
-
return schemaResult;
|
|
198
|
+
return schemaResult.schema;
|
|
175
199
|
}
|
|
176
200
|
async function getDefaultSchema(cwd, failures = []) {
|
|
177
201
|
const lookupPaths = [import_path.default.join(cwd, "schema.prisma"), import_path.default.join(cwd, "prisma", "schema.prisma")];
|
|
@@ -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_45266XOU_exports = {};
|
|
20
|
+
__export(chunk_45266XOU_exports, {
|
|
21
21
|
addVersionDetailsToErrorMessage: () => addVersionDetailsToErrorMessage
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_45266XOU_exports);
|
|
24
|
+
var import_chunk_XCPAWJOU = require("./chunk-XCPAWJOU.js");
|
|
24
25
|
var import_chunk_QN6PSQY7 = require("./chunk-QN6PSQY7.js");
|
|
25
|
-
var import_chunk_UOKMD4DT = require("./chunk-UOKMD4DT.js");
|
|
26
26
|
function addVersionDetailsToErrorMessage(message) {
|
|
27
|
-
const rows = [["Prisma CLI Version",
|
|
27
|
+
const rows = [["Prisma CLI Version", import_chunk_XCPAWJOU.version]];
|
|
28
28
|
return `${message}
|
|
29
29
|
|
|
30
30
|
${(0, import_chunk_QN6PSQY7.formatTable)(rows)}`;
|
|
@@ -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_5DHFYH6V_exports = {};
|
|
30
|
+
__export(chunk_5DHFYH6V_exports, {
|
|
31
31
|
MergeSchemasError: () => MergeSchemasError,
|
|
32
32
|
mergeSchemas: () => mergeSchemas
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(chunk_5DHFYH6V_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_WFSL5MRY = require("./chunk-WFSL5MRY.js");
|
|
39
|
+
var import_chunk_VLNU66QF = require("./chunk-VLNU66QF.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_WFSL5MRY.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_VLNU66QF.prismaSchemaWasm.merge_schemas(params);
|
|
76
76
|
},
|
|
77
77
|
(e) => ({
|
|
78
78
|
type: "wasm-error",
|
|
@@ -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_7K7RIULS_exports = {};
|
|
30
|
+
__export(chunk_7K7RIULS_exports, {
|
|
31
31
|
GetDmmfError: () => GetDmmfError,
|
|
32
32
|
getDMMF: () => getDMMF
|
|
33
33
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
34
|
+
module.exports = __toCommonJS(chunk_7K7RIULS_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_45266XOU = require("./chunk-45266XOU.js");
|
|
38
|
+
var import_chunk_TAXSI6L6 = require("./chunk-TAXSI6L6.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_45266XOU.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_TAXSI6L6.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_TAXSI6L6.prismaSchemaWasm.get_dmmf(params);
|
|
80
80
|
return data;
|
|
81
81
|
},
|
|
82
82
|
(e) => ({
|
|
@@ -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_CQVWHHIJ_exports = {};
|
|
20
|
+
__export(chunk_CQVWHHIJ_exports, {
|
|
21
21
|
missingGeneratorMessage: () => missingGeneratorMessage,
|
|
22
22
|
missingModelMessage: () => missingModelMessage,
|
|
23
23
|
missingModelMessageMongoDB: () => missingModelMessageMongoDB
|
|
24
24
|
});
|
|
25
|
-
module.exports = __toCommonJS(
|
|
25
|
+
module.exports = __toCommonJS(chunk_CQVWHHIJ_exports);
|
|
26
26
|
var import_chunk_I6WLABB2 = require("./chunk-I6WLABB2.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,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_DCI7IFH4_exports = {};
|
|
20
|
+
__export(chunk_DCI7IFH4_exports, {
|
|
21
21
|
require_package: () => require_package
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_DCI7IFH4_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: "7.1.
|
|
29
|
+
version: "7.1.1-dev.1",
|
|
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",
|
|
@@ -107,8 +107,8 @@ var require_package = (0, import_chunk_4VNS5WPM.__commonJS)({
|
|
|
107
107
|
"@prisma/generator": "workspace:*",
|
|
108
108
|
"@prisma/generator-helper": "workspace:*",
|
|
109
109
|
"@prisma/get-platform": "workspace:*",
|
|
110
|
-
"@prisma/prisma-schema-wasm": "7.1.
|
|
111
|
-
"@prisma/schema-engine-wasm": "7.1.
|
|
110
|
+
"@prisma/prisma-schema-wasm": "7.1.1-1.a90ee980e3abdf12c7066f7466393bcff91da762",
|
|
111
|
+
"@prisma/schema-engine-wasm": "7.1.1-1.a90ee980e3abdf12c7066f7466393bcff91da762",
|
|
112
112
|
"@prisma/schema-files-loader": "workspace:*",
|
|
113
113
|
arg: "5.0.2",
|
|
114
114
|
prompts: "2.4.2"
|
|
@@ -16,11 +16,11 @@ 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_DJDBBPWI_exports = {};
|
|
20
|
+
__export(chunk_DJDBBPWI_exports, {
|
|
21
21
|
require_package: () => require_package
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_DJDBBPWI_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) {
|
|
@@ -107,8 +107,8 @@ var require_package = (0, import_chunk_4VNS5WPM.__commonJS)({
|
|
|
107
107
|
"@prisma/generator": "workspace:*",
|
|
108
108
|
"@prisma/generator-helper": "workspace:*",
|
|
109
109
|
"@prisma/get-platform": "workspace:*",
|
|
110
|
-
"@prisma/prisma-schema-wasm": "7.1.
|
|
111
|
-
"@prisma/schema-engine-wasm": "7.1.
|
|
110
|
+
"@prisma/prisma-schema-wasm": "7.1.1-1.a90ee980e3abdf12c7066f7466393bcff91da762",
|
|
111
|
+
"@prisma/schema-engine-wasm": "7.1.1-1.a90ee980e3abdf12c7066f7466393bcff91da762",
|
|
112
112
|
"@prisma/schema-files-loader": "workspace:*",
|
|
113
113
|
arg: "5.0.2",
|
|
114
114
|
prompts: "2.4.2"
|
|
@@ -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_DQWKFZPY_exports = {};
|
|
30
|
+
__export(chunk_DQWKFZPY_exports, {
|
|
31
31
|
BinaryType: () => import_fetch_engine.BinaryType,
|
|
32
32
|
engineEnvVarMap: () => import_fetch_engine.engineEnvVarMap,
|
|
33
33
|
maybeCopyToTmp: () => maybeCopyToTmp,
|
|
34
34
|
resolveBinary: () => resolveBinary,
|
|
35
35
|
safeResolveBinary: () => safeResolveBinary
|
|
36
36
|
});
|
|
37
|
-
module.exports = __toCommonJS(
|
|
38
|
-
var import_chunk_M3GBKLGE = require("./chunk-M3GBKLGE.js");
|
|
37
|
+
module.exports = __toCommonJS(chunk_DQWKFZPY_exports);
|
|
39
38
|
var import_chunk_IDINCQMN = require("./chunk-IDINCQMN.js");
|
|
39
|
+
var import_chunk_M3GBKLGE = require("./chunk-M3GBKLGE.js");
|
|
40
40
|
var import_chunk_TWSLDIFL = require("./chunk-TWSLDIFL.js");
|
|
41
41
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
|
42
42
|
var import_chunk_5VQNKCKW = require("./chunk-5VQNKCKW.js");
|
|
@@ -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_DXWYZA7B_exports = {};
|
|
20
|
+
__export(chunk_DXWYZA7B_exports, {
|
|
21
21
|
missingDatasource: () => missingDatasource
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_DXWYZA7B_exports);
|
|
24
24
|
var import_chunk_I6WLABB2 = require("./chunk-I6WLABB2.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
|
)}
|