@prisma/internals 6.19.0 → 6.20.0-integration-next.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-GMW36QQF.js → chunk-22HIO2UL.js} +7 -7
- package/dist/{chunk-C7SAKLK2.js → chunk-24ZPBDBI.js} +11 -11
- package/dist/{chunk-D7OTFXCP.js → chunk-2Q43C56O.js} +5 -5
- package/dist/{chunk-TBR6SNKL.js → chunk-3L2WF742.js} +5 -5
- package/dist/{chunk-I6WLABB2.js → chunk-3WXUQZS7.js} +14 -5
- package/dist/{chunk-Y7XBA7JY.js → chunk-3ZWEK4N6.js} +5 -5
- package/dist/{chunk-RS2R7COT.js → chunk-5I4ERIIY.js} +3 -9
- package/dist/{chunk-F2OZV76L.js → chunk-5MHUYAV3.js} +9 -9
- package/dist/{chunk-HO5HRHFZ.js → chunk-5W3BSMTH.js} +3 -6
- package/dist/{chunk-FGU7IK4W.js → chunk-6AA7BHPW.js} +8 -9
- package/dist/{chunk-E6MOBIU5.js → chunk-73HXEN2A.js} +5 -5
- package/dist/{chunk-LU7NT333.js → chunk-7FBMZKZS.js} +11 -11
- package/dist/{chunk-WFNB7VRA.js → chunk-ARC7TW3L.js} +4 -14
- package/dist/{chunk-CCLAMTCA.js → chunk-B2BNIZB2.js} +7 -8
- package/dist/{chunk-UQUWZJVN.js → chunk-BM3JIFQT.js} +7 -7
- package/dist/{chunk-HFFWZTVM.js → chunk-BUQN4WLU.js} +7 -9
- package/dist/{chunk-AP3F7M3T.js → chunk-C5YUUOQW.js} +12 -12
- package/dist/{chunk-HHG4DGHC.js → chunk-CGLLQXZE.js} +11 -12
- package/dist/{chunk-LV27YCGC.js → chunk-DQV64JMK.js} +11 -11
- package/dist/chunk-DYV47NUW.js +796 -0
- package/dist/{chunk-IDINCQMN.js → chunk-FF7OLLBP.js} +12 -784
- package/dist/{chunk-JTS4UPHJ.js → chunk-GH4UGGRD.js} +5 -5
- package/dist/{chunk-4CGPN5SR.js → chunk-GJSFP4V4.js} +3 -9
- package/dist/{chunk-4JCVHBYR.js → chunk-GL7OANR6.js} +5 -5
- package/dist/{chunk-OAT7ZJED.js → chunk-H5STSTVK.js} +7 -20
- package/dist/{chunk-FYZCPL2Z.js → chunk-HNRMSI3R.js} +5 -8
- package/dist/{chunk-2GUGGLPK.js → chunk-KGES6NIS.js} +38 -94
- package/dist/{chunk-NVNI2SRU.js → chunk-KNNTV7IN.js} +687 -213
- package/dist/{chunk-SOKSKSEX.js → chunk-LA5QBRTU.js} +14 -20
- package/dist/{chunk-5AI4FIZ3.js → chunk-MEOOYUIZ.js} +10 -10
- package/dist/{chunk-FHZ5QJLR.js → chunk-MGIYZQLY.js} +5 -5
- package/dist/{chunk-TQFONRJP.js → chunk-MLFKBBDL.js} +5 -5
- package/dist/{chunk-7QC5VORA.js → chunk-MYLPCGTT.js} +5 -5
- package/dist/{chunk-EYVG6XQS.js → chunk-OKVM3CW4.js} +3 -39
- package/dist/{chunk-JOIIWB3U.js → chunk-QOZ7USPD.js} +193 -159
- package/dist/{chunk-BVJP43JS.js → chunk-QSVWJ2S2.js} +13 -784
- package/dist/{chunk-QJ3QPUM5.js → chunk-RHMWJEBL.js} +5 -5
- package/dist/{chunk-75BIJ5PX.js → chunk-SMJRM3EM.js} +9 -9
- package/dist/{chunk-AX5N26KG.js → chunk-TGA7DC5A.js} +14 -9
- package/dist/{chunk-LFFCR67R.js → chunk-UR5IPQXA.js} +14 -20
- package/dist/{chunk-5IQ5L5E4.js → chunk-VFU3QB5Z.js} +38 -94
- package/dist/{chunk-PHFQSMQF.js → chunk-VFZCLI5X.js} +5 -5
- package/dist/{chunk-E4H6V3Z4.js → chunk-VHE2A7YV.js} +11 -11
- package/dist/{chunk-UHI6VYFX.js → chunk-WJKBKH3Y.js} +5 -5
- package/dist/{chunk-TZJROXB3.js → chunk-WSZXPLJQ.js} +4 -4
- package/dist/{chunk-WYQJ4JWO.js → chunk-ZUKCLMNA.js} +12 -12
- package/dist/cli/checkUnsupportedDataProxy.js +53 -60
- package/dist/cli/getGeneratorSuccessMessage.js +2 -3
- package/dist/cli/getSchema.d.ts +1 -15
- package/dist/cli/getSchema.js +4 -5
- package/dist/cli/hashes.js +4 -4
- package/dist/cli/schemaContext.d.ts +1 -3
- package/dist/cli/schemaContext.js +53 -60
- package/dist/engine-commands/errorHelpers.js +4 -4
- package/dist/engine-commands/formatSchema.js +52 -59
- package/dist/engine-commands/getConfig.d.ts +0 -1
- package/dist/engine-commands/getConfig.js +13 -13
- package/dist/engine-commands/getDmmf.js +10 -10
- package/dist/engine-commands/getEngineVersion.js +6 -9
- package/dist/engine-commands/getEnginesInfo.d.ts +0 -1
- package/dist/engine-commands/getEnginesInfo.js +7 -9
- package/dist/engine-commands/index.js +64 -71
- 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/errorReporting.js +6 -6
- package/dist/get-generators/getGenerators.d.ts +0 -1
- package/dist/get-generators/getGenerators.js +55 -62
- 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 +6 -5
- package/dist/getPackedPackage.js +4 -3
- package/dist/index.d.ts +1 -10
- package/dist/index.js +95 -112
- package/dist/{multipart-parser-3AFJFP6K.js → multipart-parser-UV3WZSWW.js} +6 -6
- package/dist/resolveBinary.js +8 -7
- package/dist/schemaEngineCommands.js +9 -8
- package/dist/sendPanic.js +4 -4
- package/dist/utils/drawBox.js +2 -2
- 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 -6
- package/dist/utils/link.js +2 -2
- package/dist/utils/missingDatasource.js +3 -3
- package/dist/utils/missingGeneratorMessage.js +5 -5
- package/dist/utils/serializeQueryEngineName.js +2 -2
- package/dist/wasm.js +5 -5
- package/package.json +15 -16
- 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-PZMRR772.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/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/handleEngineLoadingErrors.d.ts +0 -8
- package/dist/utils/handleEngineLoadingErrors.js +0 -27
- 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/tryLoadEnvs.d.ts +0 -25
- package/dist/utils/tryLoadEnvs.js +0 -30
|
@@ -26,20 +26,20 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
26
26
|
mod
|
|
27
27
|
));
|
|
28
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var
|
|
30
|
-
__export(
|
|
29
|
+
var chunk_LA5QBRTU_exports = {};
|
|
30
|
+
__export(chunk_LA5QBRTU_exports, {
|
|
31
31
|
GetConfigError: () => GetConfigError,
|
|
32
32
|
getConfig: () => getConfig,
|
|
33
33
|
getDirectUrl: () => getDirectUrl,
|
|
34
34
|
getEffectiveUrl: () => getEffectiveUrl,
|
|
35
35
|
resolveUrl: () => resolveUrl
|
|
36
36
|
});
|
|
37
|
-
module.exports = __toCommonJS(
|
|
38
|
-
var
|
|
39
|
-
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
|
37
|
+
module.exports = __toCommonJS(chunk_LA5QBRTU_exports);
|
|
38
|
+
var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
|
|
40
39
|
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
|
41
|
-
var
|
|
42
|
-
var
|
|
40
|
+
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
|
41
|
+
var import_chunk_2Q43C56O = require("./chunk-2Q43C56O.js");
|
|
42
|
+
var import_chunk_3ZWEK4N6 = require("./chunk-3ZWEK4N6.js");
|
|
43
43
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
|
44
44
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
|
45
45
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
@@ -64,7 +64,7 @@ ${detailsHeader} ${message}`;
|
|
|
64
64
|
}).exhaustive();
|
|
65
65
|
const errorMessageWithContext = `${constructedErrorMessage}
|
|
66
66
|
[Context: getConfig]`;
|
|
67
|
-
super((0,
|
|
67
|
+
super((0, import_chunk_2Q43C56O.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
|
68
68
|
this.name = "GetConfigError";
|
|
69
69
|
}
|
|
70
70
|
};
|
|
@@ -82,23 +82,17 @@ function resolveUrl(envValue) {
|
|
|
82
82
|
return urlFromValue ?? urlEnvVarValue;
|
|
83
83
|
}
|
|
84
84
|
async function getConfig(options) {
|
|
85
|
-
const debugErrorType = (0,
|
|
85
|
+
const debugErrorType = (0, import_chunk_WSZXPLJQ.createDebugErrorType)(debug, "getConfigWasm");
|
|
86
86
|
debug(`Using getConfig Wasm`);
|
|
87
87
|
const configEither = (0, import_function.pipe)(
|
|
88
88
|
(0, import_chunk_5DBOS77Y.tryCatch)(
|
|
89
89
|
() => {
|
|
90
90
|
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_CONFIG) {
|
|
91
91
|
debug("Triggering a Rust panic...");
|
|
92
|
-
|
|
92
|
+
import_chunk_3ZWEK4N6.prismaSchemaWasm.debug_panic();
|
|
93
93
|
}
|
|
94
|
-
const params = JSON.stringify({
|
|
95
|
-
|
|
96
|
-
datasourceOverrides: {},
|
|
97
|
-
ignoreEnvVarErrors: options.ignoreEnvVarErrors ?? false,
|
|
98
|
-
env: process.env
|
|
99
|
-
});
|
|
100
|
-
const data = import_chunk_FHZ5QJLR.prismaSchemaWasm.get_config(params);
|
|
101
|
-
return data;
|
|
94
|
+
const params = JSON.stringify({ prismaSchema: options.datamodel });
|
|
95
|
+
return import_chunk_3ZWEK4N6.prismaSchemaWasm.get_config(params);
|
|
102
96
|
},
|
|
103
97
|
(e) => ({
|
|
104
98
|
type: "wasm-error",
|
|
@@ -156,12 +150,12 @@ async function getConfig(options) {
|
|
|
156
150
|
return panic;
|
|
157
151
|
}
|
|
158
152
|
const errorOutput = e.error.message;
|
|
159
|
-
return new GetConfigError((0,
|
|
153
|
+
return new GetConfigError((0, import_chunk_WSZXPLJQ.parseQueryEngineError)({ errorOutput, reason: e.reason }));
|
|
160
154
|
}).with({ type: "validation-error" }, (e) => {
|
|
161
155
|
return new GetConfigError({
|
|
162
156
|
_tag: "parsed",
|
|
163
157
|
errorCode: SCHEMA_VALIDATION_ERROR_CODE,
|
|
164
|
-
reason: (0,
|
|
158
|
+
reason: (0, import_chunk_WSZXPLJQ.createSchemaValidationError)(e.reason),
|
|
165
159
|
message: formatErrors(e.error)
|
|
166
160
|
});
|
|
167
161
|
}).otherwise((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_MEOOYUIZ_exports = {};
|
|
30
|
+
__export(chunk_MEOOYUIZ_exports, {
|
|
31
31
|
ErrorKind: () => ErrorKind,
|
|
32
32
|
createErrorReport: () => createErrorReport,
|
|
33
33
|
makeErrorReportCompleted: () => makeErrorReportCompleted,
|
|
34
34
|
uploadZip: () => uploadZip
|
|
35
35
|
});
|
|
36
|
-
module.exports = __toCommonJS(
|
|
37
|
-
var
|
|
36
|
+
module.exports = __toCommonJS(chunk_MEOOYUIZ_exports);
|
|
37
|
+
var import_chunk_KNNTV7IN = require("./chunk-KNNTV7IN.js");
|
|
38
38
|
var import_fetch_engine = require("@prisma/fetch-engine");
|
|
39
39
|
var import_node_http = __toESM(require("node:http"));
|
|
40
40
|
var import_node_https = __toESM(require("node:https"));
|
|
@@ -151,8 +151,8 @@ var Body = class {
|
|
|
151
151
|
} else if (ArrayBuffer.isView(body)) {
|
|
152
152
|
body = import_node_buffer2.Buffer.from(body.buffer, body.byteOffset, body.byteLength);
|
|
153
153
|
} else if (body instanceof import_node_stream2.default) {
|
|
154
|
-
} else if (body instanceof
|
|
155
|
-
body = (0,
|
|
154
|
+
} else if (body instanceof import_chunk_KNNTV7IN.FormData) {
|
|
155
|
+
body = (0, import_chunk_KNNTV7IN.formDataToBlob)(body);
|
|
156
156
|
boundary = body.type.split("=")[1];
|
|
157
157
|
} else {
|
|
158
158
|
body = import_node_buffer2.Buffer.from(String(body));
|
|
@@ -196,14 +196,14 @@ var Body = class {
|
|
|
196
196
|
async formData() {
|
|
197
197
|
const ct = this.headers.get("content-type");
|
|
198
198
|
if (ct.startsWith("application/x-www-form-urlencoded")) {
|
|
199
|
-
const formData = new
|
|
199
|
+
const formData = new import_chunk_KNNTV7IN.FormData();
|
|
200
200
|
const parameters = new URLSearchParams(await this.text());
|
|
201
201
|
for (const [name, value] of parameters) {
|
|
202
202
|
formData.append(name, value);
|
|
203
203
|
}
|
|
204
204
|
return formData;
|
|
205
205
|
}
|
|
206
|
-
const { toFormData } = await import("./multipart-parser-
|
|
206
|
+
const { toFormData } = await import("./multipart-parser-UV3WZSWW.js");
|
|
207
207
|
return toFormData(this.body, ct);
|
|
208
208
|
}
|
|
209
209
|
/**
|
|
@@ -214,7 +214,7 @@ var Body = class {
|
|
|
214
214
|
async blob() {
|
|
215
215
|
const ct = this.headers && this.headers.get("content-type") || this[INTERNALS].body && this[INTERNALS].body.type || "";
|
|
216
216
|
const buf = await this.arrayBuffer();
|
|
217
|
-
return new
|
|
217
|
+
return new import_chunk_KNNTV7IN.fetch_blob_default([buf], {
|
|
218
218
|
type: ct
|
|
219
219
|
});
|
|
220
220
|
}
|
|
@@ -342,7 +342,7 @@ var extractContentType = (body, request2) => {
|
|
|
342
342
|
if (import_node_buffer2.Buffer.isBuffer(body) || import_node_util.types.isAnyArrayBuffer(body) || ArrayBuffer.isView(body)) {
|
|
343
343
|
return null;
|
|
344
344
|
}
|
|
345
|
-
if (body instanceof
|
|
345
|
+
if (body instanceof import_chunk_KNNTV7IN.FormData) {
|
|
346
346
|
return `multipart/form-data; boundary=${request2[INTERNALS].boundary}`;
|
|
347
347
|
}
|
|
348
348
|
if (body && typeof body.getBoundary === "function") {
|
|
@@ -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_MGIYZQLY_exports = {};
|
|
30
|
+
__export(chunk_MGIYZQLY_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_MGIYZQLY_exports);
|
|
37
|
+
var import_chunk_6AA7BHPW = require("./chunk-6AA7BHPW.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_6AA7BHPW.require_package)();
|
|
50
50
|
var prismaSchemaWasmVersion = dependencies["@prisma/prisma-schema-wasm"];
|
|
51
51
|
var schemaEngineWasmVersion = dependencies["@prisma/schema-engine-wasm"];
|
|
@@ -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_MLFKBBDL_exports = {};
|
|
30
|
+
__export(chunk_MLFKBBDL_exports, {
|
|
31
31
|
createDirIfNotExists: () => createDirIfNotExists,
|
|
32
32
|
fs_utils_exports: () => fs_utils_exports,
|
|
33
33
|
getFilesInDir: () => getFilesInDir,
|
|
@@ -36,9 +36,9 @@ __export(chunk_TQFONRJP_exports, {
|
|
|
36
36
|
removeEmptyDirs: () => removeEmptyDirs,
|
|
37
37
|
writeFile: () => writeFile
|
|
38
38
|
});
|
|
39
|
-
module.exports = __toCommonJS(
|
|
39
|
+
module.exports = __toCommonJS(chunk_MLFKBBDL_exports);
|
|
40
40
|
var import_chunk_J77ZIDXB = require("./chunk-J77ZIDXB.js");
|
|
41
|
-
var
|
|
41
|
+
var import_chunk_QOZ7USPD = require("./chunk-QOZ7USPD.js");
|
|
42
42
|
var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
|
|
43
43
|
var import_promises = __toESM(require("fs/promises"));
|
|
44
44
|
var import_path = __toESM(require("path"));
|
|
@@ -51,7 +51,7 @@ var fs_utils_exports = {};
|
|
|
51
51
|
removeEmptyDirs: () => removeEmptyDirs,
|
|
52
52
|
writeFile: () => writeFile
|
|
53
53
|
});
|
|
54
|
-
var import_globby = (0, import_chunk_4VNS5WPM.__toESM)((0,
|
|
54
|
+
var import_globby = (0, import_chunk_4VNS5WPM.__toESM)((0, import_chunk_QOZ7USPD.require_globby)());
|
|
55
55
|
function createDirIfNotExists(dir) {
|
|
56
56
|
return import_promises.default.mkdir(dir, { recursive: true });
|
|
57
57
|
}
|
|
@@ -16,12 +16,12 @@ 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_MYLPCGTT_exports = {};
|
|
20
|
+
__export(chunk_MYLPCGTT_exports, {
|
|
21
21
|
missingDatasource: () => missingDatasource
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(chunk_MYLPCGTT_exports);
|
|
24
|
+
var import_chunk_3WXUQZS7 = require("./chunk-3WXUQZS7.js");
|
|
25
25
|
var import_chunk_TQCLUNM2 = require("./chunk-TQCLUNM2.js");
|
|
26
26
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
27
27
|
var missingDatasource = `
|
|
@@ -36,5 +36,5 @@ ${(0, import_chunk_PG5FDKSF.bold)(
|
|
|
36
36
|
)}
|
|
37
37
|
|
|
38
38
|
More information in our documentation:
|
|
39
|
-
${(0,
|
|
39
|
+
${(0, import_chunk_3WXUQZS7.link)("https://pris.ly/d/prisma-schema")}
|
|
40
40
|
`;
|
|
@@ -26,16 +26,14 @@ 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
|
-
getSchemaFromPackageJson: () => getSchemaFromPackageJson,
|
|
29
|
+
var chunk_OKVM3CW4_exports = {};
|
|
30
|
+
__export(chunk_OKVM3CW4_exports, {
|
|
32
31
|
getSchemaWithPath: () => getSchemaWithPath,
|
|
33
32
|
getSchemaWithPathOptional: () => getSchemaWithPathOptional,
|
|
34
33
|
printSchemaLoadedMessage: () => printSchemaLoadedMessage
|
|
35
34
|
});
|
|
36
|
-
module.exports = __toCommonJS(
|
|
35
|
+
module.exports = __toCommonJS(chunk_OKVM3CW4_exports);
|
|
37
36
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
38
|
-
var import_config = require("@prisma/config");
|
|
39
37
|
var import_debug = require("@prisma/debug");
|
|
40
38
|
var import_schema_files_loader = require("@prisma/schema-files-loader");
|
|
41
39
|
var import_fs = __toESM(require("fs"));
|
|
@@ -119,10 +117,6 @@ async function getSchemaWithPathInternal(schemaPathFromArgs, schemaPathFromConfi
|
|
|
119
117
|
if (prismaConfigResult.ok) {
|
|
120
118
|
return prismaConfigResult;
|
|
121
119
|
}
|
|
122
|
-
const pkgJsonResult = await getSchemaFromPackageJson(cwd);
|
|
123
|
-
if (pkgJsonResult.ok) {
|
|
124
|
-
return pkgJsonResult;
|
|
125
|
-
}
|
|
126
120
|
const defaultResult = await getDefaultSchema(cwd);
|
|
127
121
|
if (defaultResult.ok) {
|
|
128
122
|
return defaultResult;
|
|
@@ -179,36 +173,6 @@ async function readSchemaFromPrismaConfigBasedLocation(schemaPathFromConfig) {
|
|
|
179
173
|
}
|
|
180
174
|
return schemaResult;
|
|
181
175
|
}
|
|
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;
|
|
211
|
-
}
|
|
212
176
|
async function getDefaultSchema(cwd, failures = []) {
|
|
213
177
|
const lookupPaths = [import_path.default.join(cwd, "schema.prisma"), import_path.default.join(cwd, "prisma", "schema.prisma")];
|
|
214
178
|
for (const path2 of lookupPaths) {
|