@prisma/internals 7.2.0 → 7.3.0-integration-prisma6-fix-cloudflare-engine.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-QMSPMDFJ.js → chunk-262R2PBW.js} +5 -5
- package/dist/chunk-3FP46GUV.js +471 -0
- package/dist/{chunk-AQOVQMBO.js → chunk-3RVT7N36.js} +10 -8
- package/dist/{chunk-MW6NA5W7.js → chunk-3RY6T5EU.js} +13 -13
- package/dist/chunk-46ABODUM.js +186 -0
- package/dist/{chunk-GJSFP4V4.js → chunk-4CGPN5SR.js} +9 -3
- package/dist/{chunk-KAH2NIWC.js → chunk-4JCVHBYR.js} +6 -6
- package/dist/{chunk-UWK6LIYC.js → chunk-5YENJ7QW.js} +11 -11
- package/dist/{chunk-6JD4VENT.js → chunk-64GJTNNO.js} +12 -12
- package/dist/{chunk-AADMLOWX.js → chunk-656EKQL7.js} +5 -5
- package/dist/chunk-6TTRTZXU.js +37 -0
- package/dist/{chunk-Q5XW7CMJ.js → chunk-75BIJ5PX.js} +9 -9
- package/dist/{chunk-DXWYZA7B.js → chunk-7QC5VORA.js} +4 -3
- package/dist/{chunk-CQVWHHIJ.js → chunk-AX5N26KG.js} +6 -11
- package/dist/{chunk-NBWRGVYR.js → chunk-BCQZ6JQE.js} +6 -4
- package/dist/{chunk-BXIKQUP5.js → chunk-BVJP43JS.js} +7 -7
- package/dist/chunk-D4VDA2TZ.js +66 -0
- package/dist/chunk-DZYINYAA.js +68 -0
- package/dist/{chunk-C6MDA273.js → chunk-E2QTLJH5.js} +13 -13
- package/dist/chunk-ERSH2BQA.js +58 -0
- package/dist/{chunk-2BXDHSSY.js → chunk-EYVG6XQS.js} +68 -56
- package/dist/{chunk-GH2WAX5Y.js → chunk-F2OZV76L.js} +7 -7
- package/dist/{chunk-R3J2O23S.js → chunk-FCYHZHVW.js} +4 -4
- package/dist/{chunk-DQWKFZPY.js → chunk-FYZCPL2Z.js} +7 -4
- package/dist/{chunk-2GPDFPDR.js → chunk-GMW36QQF.js} +7 -7
- package/dist/{chunk-YXCPS3WU.js → chunk-HFFWZTVM.js} +15 -5
- package/dist/chunk-HO5HRHFZ.js +30 -0
- package/dist/chunk-HW5RCZSE.js +1 -0
- package/dist/{chunk-YV4IFLW4.js → chunk-JOIIWB3U.js} +129 -128
- package/dist/{chunk-OVTE2A4Y.js → chunk-JSAYIEU7.js} +5 -5
- package/dist/chunk-KDHESRKE.js +49 -0
- package/dist/{chunk-KJKLC73N.js → chunk-KH7FI42S.js} +11 -11
- package/dist/chunk-L6KOIJJ5.js +125 -0
- package/dist/{chunk-3U4QB2G3.js → chunk-LYFOJ5NK.js} +6 -4
- package/dist/{chunk-G6VGFCRW.js → chunk-MRJKW452.js} +146 -58
- package/dist/{chunk-Q75TMXCR.js → chunk-OAT7ZJED.js} +20 -7
- package/dist/{chunk-P47PM3SY.js → chunk-OMQVWRCE.js} +5 -5
- package/dist/{chunk-GCMOJALQ.js → chunk-OPLMJ5WZ.js} +146 -58
- package/dist/{chunk-T6BPU44Y.js → chunk-OQUKB353.js} +5 -5
- package/dist/{chunk-SP2ETLT2.js → chunk-OSHZ4P3G.js} +5 -5
- package/dist/chunk-PZMRR772.js +41 -0
- package/dist/{chunk-QRW4PODC.js → chunk-QLOP3Z4E.js} +38 -16
- package/dist/{chunk-HNOCAIKC.js → chunk-QPQF4VGD.js} +12 -12
- package/dist/chunk-RFB2U4GQ.js +41 -0
- package/dist/{chunk-5I4ERIIY.js → chunk-RS2R7COT.js} +9 -3
- package/dist/chunk-T2PM5TKT.js +55 -0
- package/dist/{chunk-G7GV3UAA.js → chunk-THADADEM.js} +9 -7
- package/dist/{chunk-5BRXEOYH.js → chunk-TQFONRJP.js} +5 -5
- package/dist/{chunk-HFLFMWOT.js → chunk-TU5OMWUB.js} +5 -5
- package/dist/{chunk-WSZXPLJQ.js → chunk-TZJROXB3.js} +4 -4
- package/dist/{chunk-YJVCIN4F.js → chunk-UHI6VYFX.js} +14 -16
- package/dist/{chunk-NYNXYKR4.js → chunk-UQUWZJVN.js} +7 -7
- package/dist/{chunk-P3FYX4Y7.js → chunk-W6J5YFD2.js} +5 -5
- package/dist/{chunk-J3JTMPWZ.js → chunk-WDPDHAFW.js} +5 -5
- package/dist/{chunk-ARC7TW3L.js → chunk-WFNB7VRA.js} +14 -4
- package/dist/{chunk-EIO44IYO.js → chunk-ZL2NP4XJ.js} +38 -16
- package/dist/cli/checkUnsupportedDataProxy.d.ts +9 -7
- package/dist/cli/checkUnsupportedDataProxy.js +65 -53
- package/dist/cli/checkUnsupportedSchemaEngineWasm.d.ts +22 -0
- package/dist/cli/checkUnsupportedSchemaEngineWasm.js +135 -0
- package/dist/cli/directoryConfig.d.ts +2 -5
- package/dist/cli/directoryConfig.js +2 -2
- package/dist/cli/getGeneratorSuccessMessage.js +3 -2
- package/dist/cli/getSchema.d.ts +20 -28
- package/dist/cli/getSchema.js +5 -7
- package/dist/cli/hashes.d.ts +1 -2
- package/dist/cli/hashes.js +4 -4
- package/dist/cli/schemaContext.d.ts +22 -5
- package/dist/cli/schemaContext.js +65 -54
- package/dist/cli/types.d.ts +1 -1
- package/dist/client/getClientEngineType.d.ts +7 -0
- package/dist/client/getClientEngineType.js +26 -0
- package/dist/convertCredentials.js +4 -4
- package/dist/dotenvExpand.d.ts +35 -0
- package/dist/dotenvExpand.js +25 -0
- package/dist/engine-commands/errorHelpers.js +4 -4
- package/dist/engine-commands/formatSchema.js +64 -52
- package/dist/engine-commands/getConfig.d.ts +5 -1
- package/dist/engine-commands/getConfig.js +13 -10
- package/dist/engine-commands/getDmmf.js +10 -10
- package/dist/engine-commands/getEngineVersion.js +9 -5
- package/dist/engine-commands/getEnginesInfo.d.ts +1 -0
- package/dist/engine-commands/getEnginesInfo.js +9 -6
- package/dist/engine-commands/index.d.ts +1 -1
- package/dist/engine-commands/index.js +76 -62
- 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 +2 -0
- package/dist/get-generators/getGenerators.js +67 -55
- 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 +19 -5
- package/dist/index.js +125 -99
- package/dist/resolveBinary.js +7 -7
- package/dist/schemaEngineCommands.js +8 -8
- package/dist/sendPanic.js +3 -2
- package/dist/tracing/types.d.ts +54 -0
- package/dist/tracing/types.js +2 -0
- package/dist/types.d.ts +0 -15
- package/dist/utils/__tests__/maskSchema.test.js +23 -0
- package/dist/utils/byline.d.ts +4 -0
- package/dist/utils/byline.js +28 -0
- package/dist/utils/canPrompt.js +3 -3
- package/dist/utils/cloudflareD1.d.ts +5 -0
- package/dist/utils/cloudflareD1.js +27 -0
- package/dist/utils/fs-functional.js +10 -10
- package/dist/utils/fs-utils.js +8 -8
- package/dist/utils/getEnvPaths.d.ts +14 -0
- package/dist/utils/{validatePrismaConfigWithDatasource.js → getEnvPaths.js} +8 -7
- package/dist/utils/getMigrateConfigDir.d.ts +2 -0
- package/dist/utils/getMigrateConfigDir.js +25 -0
- package/dist/utils/getVersionFromPackageJson.js +3 -3
- package/dist/utils/handleEngineLoadingErrors.d.ts +8 -0
- package/dist/utils/handleEngineLoadingErrors.js +27 -0
- package/dist/utils/handlePanic.js +7 -6
- package/dist/utils/load.d.ts +6 -0
- package/dist/utils/load.js +28 -0
- package/dist/utils/loadEnvFile.d.ts +10 -0
- package/dist/utils/loadEnvFile.js +30 -0
- package/dist/utils/maskSchema.d.ts +4 -0
- package/dist/utils/maskSchema.js +27 -0
- package/dist/utils/missingDatasource.js +2 -2
- package/dist/utils/missingGeneratorMessage.js +4 -4
- package/dist/utils/serializeQueryEngineName.d.ts +4 -0
- package/dist/utils/serializeQueryEngineName.js +25 -0
- package/dist/utils/toSchemasContainer.d.ts +1 -1
- package/dist/utils/toSchemasContainer.js +3 -3
- package/dist/utils/tryLoadEnvs.d.ts +25 -0
- package/dist/utils/tryLoadEnvs.js +30 -0
- package/dist/wasm.js +5 -5
- package/package.json +17 -15
- package/dist/chunk-QKQKSUQO.js +0 -46
- package/dist/utils/validatePrismaConfigWithDatasource.d.ts +0 -17
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var chunk_RFB2U4GQ_exports = {};
|
|
30
|
+
__export(chunk_RFB2U4GQ_exports, {
|
|
31
|
+
getMigrateConfigDir: () => getMigrateConfigDir
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(chunk_RFB2U4GQ_exports);
|
|
34
|
+
var import_path = __toESM(require("path"));
|
|
35
|
+
function getMigrateConfigDir(config, schemaPath) {
|
|
36
|
+
const sourcePath = config?.datasources?.[0]?.sourceFilePath;
|
|
37
|
+
if (sourcePath) {
|
|
38
|
+
return import_path.default.dirname(sourcePath);
|
|
39
|
+
}
|
|
40
|
+
return schemaPath ? import_path.default.dirname(schemaPath) : process.cwd();
|
|
41
|
+
}
|
|
@@ -16,15 +16,21 @@ 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_RS2R7COT_exports = {};
|
|
20
|
+
__export(chunk_RS2R7COT_exports, {
|
|
21
21
|
binaryTypeToEngineType: () => binaryTypeToEngineType
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_RS2R7COT_exports);
|
|
24
24
|
var import_fetch_engine = require("@prisma/fetch-engine");
|
|
25
25
|
function binaryTypeToEngineType(binaryType) {
|
|
26
26
|
if (binaryType === import_fetch_engine.BinaryType.SchemaEngineBinary) {
|
|
27
27
|
return "schemaEngine";
|
|
28
28
|
}
|
|
29
|
+
if (binaryType === import_fetch_engine.BinaryType.QueryEngineLibrary) {
|
|
30
|
+
return "libqueryEngine";
|
|
31
|
+
}
|
|
32
|
+
if (binaryType === import_fetch_engine.BinaryType.QueryEngineBinary) {
|
|
33
|
+
return "queryEngine";
|
|
34
|
+
}
|
|
29
35
|
throw new Error(`Could not convert binary type ${binaryType}`);
|
|
30
36
|
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var chunk_T2PM5TKT_exports = {};
|
|
20
|
+
__export(chunk_T2PM5TKT_exports, {
|
|
21
|
+
dotenvExpand: () => dotenvExpand
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(chunk_T2PM5TKT_exports);
|
|
24
|
+
function dotenvExpand(config) {
|
|
25
|
+
const environment = config.ignoreProcessEnv ? {} : process.env;
|
|
26
|
+
const interpolate = (envValue) => {
|
|
27
|
+
const matches = envValue.match(/(.?\${(?:[a-zA-Z0-9_]+)?})/g);
|
|
28
|
+
return matches?.reduce(function(newEnv, match) {
|
|
29
|
+
const parts = /(.?)\${([a-zA-Z0-9_]+)?}/g.exec(match);
|
|
30
|
+
if (!parts) {
|
|
31
|
+
return newEnv;
|
|
32
|
+
}
|
|
33
|
+
const prefix = parts[1];
|
|
34
|
+
let value, replacePart;
|
|
35
|
+
if (prefix === "\\") {
|
|
36
|
+
replacePart = parts[0];
|
|
37
|
+
value = replacePart.replace("\\$", "$");
|
|
38
|
+
} else {
|
|
39
|
+
const key = parts[2];
|
|
40
|
+
replacePart = parts[0].substring(prefix.length);
|
|
41
|
+
value = Object.hasOwnProperty.call(environment, key) ? environment[key] : config.parsed[key] || "";
|
|
42
|
+
value = interpolate(value);
|
|
43
|
+
}
|
|
44
|
+
return newEnv.replace(replacePart, value);
|
|
45
|
+
}, envValue) ?? envValue;
|
|
46
|
+
};
|
|
47
|
+
for (const configKey in config.parsed) {
|
|
48
|
+
const value = Object.hasOwnProperty.call(environment, configKey) ? environment[configKey] : config.parsed[configKey];
|
|
49
|
+
config.parsed[configKey] = interpolate(value);
|
|
50
|
+
}
|
|
51
|
+
for (const processKey in config.parsed) {
|
|
52
|
+
environment[processKey] = config.parsed[processKey];
|
|
53
|
+
}
|
|
54
|
+
return config;
|
|
55
|
+
}
|
|
@@ -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_THADADEM_exports = {};
|
|
20
|
+
__export(chunk_THADADEM_exports, {
|
|
21
21
|
require_package: () => require_package
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
23
|
+
module.exports = __toCommonJS(chunk_THADADEM_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) {
|
|
@@ -48,6 +48,7 @@ var require_package = (0, import_chunk_4VNS5WPM.__commonJS)({
|
|
|
48
48
|
files: [
|
|
49
49
|
"README.md",
|
|
50
50
|
"dist",
|
|
51
|
+
"!**/libquery_engine*",
|
|
51
52
|
"!dist/get-generators/engines/*",
|
|
52
53
|
"scripts"
|
|
53
54
|
],
|
|
@@ -58,11 +59,12 @@ var require_package = (0, import_chunk_4VNS5WPM.__commonJS)({
|
|
|
58
59
|
"@swc/jest": "0.2.37",
|
|
59
60
|
"@types/babel__helper-validator-identifier": "7.15.2",
|
|
60
61
|
"@types/jest": "29.5.14",
|
|
61
|
-
"@types/node": "
|
|
62
|
+
"@types/node": "18.19.76",
|
|
62
63
|
"@types/resolve": "1.20.6",
|
|
63
64
|
archiver: "6.0.2",
|
|
64
65
|
"checkpoint-client": "1.1.33",
|
|
65
66
|
"cli-truncate": "4.0.0",
|
|
67
|
+
dotenv: "16.5.0",
|
|
66
68
|
empathic: "2.0.0",
|
|
67
69
|
"escape-string-regexp": "5.0.0",
|
|
68
70
|
execa: "8.0.1",
|
|
@@ -107,14 +109,14 @@ var require_package = (0, import_chunk_4VNS5WPM.__commonJS)({
|
|
|
107
109
|
"@prisma/generator": "workspace:*",
|
|
108
110
|
"@prisma/generator-helper": "workspace:*",
|
|
109
111
|
"@prisma/get-platform": "workspace:*",
|
|
110
|
-
"@prisma/prisma-schema-wasm": "7.
|
|
111
|
-
"@prisma/schema-engine-wasm": "7.
|
|
112
|
+
"@prisma/prisma-schema-wasm": "7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7",
|
|
113
|
+
"@prisma/schema-engine-wasm": "7.1.1-3.c2990dca591cba766e3b7ef5d9e8a84796e47ab7",
|
|
112
114
|
"@prisma/schema-files-loader": "workspace:*",
|
|
113
115
|
arg: "5.0.2",
|
|
114
116
|
prompts: "2.4.2"
|
|
115
117
|
},
|
|
116
118
|
peerDependencies: {
|
|
117
|
-
typescript: ">=5.
|
|
119
|
+
typescript: ">=5.1.0"
|
|
118
120
|
},
|
|
119
121
|
peerDependenciesMeta: {
|
|
120
122
|
typescript: {
|
|
@@ -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_TQFONRJP_exports = {};
|
|
30
|
+
__export(chunk_TQFONRJP_exports, {
|
|
31
31
|
createDirIfNotExists: () => createDirIfNotExists,
|
|
32
32
|
fs_utils_exports: () => fs_utils_exports,
|
|
33
33
|
getFilesInDir: () => getFilesInDir,
|
|
@@ -36,9 +36,9 @@ __export(chunk_5BRXEOYH_exports, {
|
|
|
36
36
|
removeEmptyDirs: () => removeEmptyDirs,
|
|
37
37
|
writeFile: () => writeFile
|
|
38
38
|
});
|
|
39
|
-
module.exports = __toCommonJS(
|
|
39
|
+
module.exports = __toCommonJS(chunk_TQFONRJP_exports);
|
|
40
40
|
var import_chunk_J77ZIDXB = require("./chunk-J77ZIDXB.js");
|
|
41
|
-
var
|
|
41
|
+
var import_chunk_JOIIWB3U = require("./chunk-JOIIWB3U.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_JOIIWB3U.require_globby)());
|
|
55
55
|
function createDirIfNotExists(dir) {
|
|
56
56
|
return import_promises.default.mkdir(dir, { recursive: true });
|
|
57
57
|
}
|
|
@@ -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_TU5OMWUB_exports = {};
|
|
20
|
+
__export(chunk_TU5OMWUB_exports, {
|
|
21
21
|
addVersionDetailsToErrorMessage: () => addVersionDetailsToErrorMessage
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(chunk_TU5OMWUB_exports);
|
|
24
|
+
var import_chunk_JSAYIEU7 = require("./chunk-JSAYIEU7.js");
|
|
25
25
|
var import_chunk_QN6PSQY7 = require("./chunk-QN6PSQY7.js");
|
|
26
26
|
function addVersionDetailsToErrorMessage(message) {
|
|
27
|
-
const rows = [["Prisma CLI Version",
|
|
27
|
+
const rows = [["Prisma CLI Version", import_chunk_JSAYIEU7.version]];
|
|
28
28
|
return `${message}
|
|
29
29
|
|
|
30
30
|
${(0, import_chunk_QN6PSQY7.formatTable)(rows)}`;
|
|
@@ -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_TZJROXB3_exports = {};
|
|
30
|
+
__export(chunk_TZJROXB3_exports, {
|
|
31
31
|
createDebugErrorType: () => createDebugErrorType,
|
|
32
32
|
createSchemaValidationError: () => createSchemaValidationError,
|
|
33
33
|
parseQueryEngineError: () => parseQueryEngineError,
|
|
34
34
|
unlinkTempDatamodelPath: () => unlinkTempDatamodelPath
|
|
35
35
|
});
|
|
36
|
-
module.exports = __toCommonJS(
|
|
37
|
-
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
|
36
|
+
module.exports = __toCommonJS(chunk_TZJROXB3_exports);
|
|
38
37
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
|
38
|
+
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.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_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
@@ -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_UHI6VYFX_exports = {};
|
|
20
|
+
__export(chunk_UHI6VYFX_exports, {
|
|
21
21
|
SchemaEngineExitCode: () => SchemaEngineExitCode,
|
|
22
22
|
canConnectToDatabase: () => canConnectToDatabase,
|
|
23
23
|
createDatabase: () => createDatabase,
|
|
24
24
|
dropDatabase: () => dropDatabase,
|
|
25
25
|
execaCommand: () => execaCommand
|
|
26
26
|
});
|
|
27
|
-
module.exports = __toCommonJS(
|
|
27
|
+
module.exports = __toCommonJS(chunk_UHI6VYFX_exports);
|
|
28
28
|
var import_chunk_JOIHHXR6 = require("./chunk-JOIHHXR6.js");
|
|
29
|
-
var
|
|
29
|
+
var import_chunk_FYZCPL2Z = require("./chunk-FYZCPL2Z.js");
|
|
30
30
|
var import_fetch_engine = require("@prisma/fetch-engine");
|
|
31
31
|
var SchemaEngineExitCode = /* @__PURE__ */ ((SchemaEngineExitCode2) => {
|
|
32
32
|
SchemaEngineExitCode2[SchemaEngineExitCode2["Success"] = 0] = "Success";
|
|
@@ -50,7 +50,9 @@ function parseJsonFromStderr(stderr) {
|
|
|
50
50
|
}
|
|
51
51
|
async function canConnectToDatabase(connectionString, cwd = process.cwd(), schemaEnginePath) {
|
|
52
52
|
if (!connectionString) {
|
|
53
|
-
throw new Error(
|
|
53
|
+
throw new Error(
|
|
54
|
+
"Connection url is empty. See https://www.prisma.io/docs/reference/database-reference/connection-urls"
|
|
55
|
+
);
|
|
54
56
|
}
|
|
55
57
|
try {
|
|
56
58
|
await execaCommand({
|
|
@@ -137,19 +139,15 @@ async function execaCommand({
|
|
|
137
139
|
schemaEnginePath,
|
|
138
140
|
engineCommandName
|
|
139
141
|
}) {
|
|
140
|
-
schemaEnginePath = schemaEnginePath || await (0,
|
|
142
|
+
schemaEnginePath = schemaEnginePath || await (0, import_chunk_FYZCPL2Z.resolveBinary)(import_fetch_engine.BinaryType.SchemaEngineBinary);
|
|
141
143
|
try {
|
|
142
|
-
return await (0, import_chunk_JOIHHXR6.execa)(
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
env: {
|
|
148
|
-
RUST_BACKTRACE: process.env.RUST_BACKTRACE ?? "1",
|
|
149
|
-
RUST_LOG: process.env.RUST_LOG ?? "info"
|
|
150
|
-
}
|
|
144
|
+
return await (0, import_chunk_JOIHHXR6.execa)(schemaEnginePath, ["cli", "--datasource", connectionString, engineCommandName], {
|
|
145
|
+
cwd,
|
|
146
|
+
env: {
|
|
147
|
+
RUST_BACKTRACE: process.env.RUST_BACKTRACE ?? "1",
|
|
148
|
+
RUST_LOG: process.env.RUST_LOG ?? "info"
|
|
151
149
|
}
|
|
152
|
-
);
|
|
150
|
+
});
|
|
153
151
|
} catch (_e) {
|
|
154
152
|
const e = _e;
|
|
155
153
|
if (e.message) {
|
|
@@ -26,19 +26,19 @@ 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_UQUWZJVN_exports = {};
|
|
30
|
+
__export(chunk_UQUWZJVN_exports, {
|
|
31
31
|
handlePanic: () => handlePanic
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_UQUWZJVN_exports);
|
|
34
34
|
var import_chunk_I6WLABB2 = require("./chunk-I6WLABB2.js");
|
|
35
35
|
var import_chunk_7IKUTPWQ = require("./chunk-7IKUTPWQ.js");
|
|
36
|
-
var
|
|
37
|
-
var
|
|
36
|
+
var import_chunk_FCYHZHVW = require("./chunk-FCYHZHVW.js");
|
|
37
|
+
var import_chunk_HFFWZTVM = require("./chunk-HFFWZTVM.js");
|
|
38
38
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
39
39
|
var import_prompts = __toESM(require("prompts"));
|
|
40
40
|
async function handlePanic(args) {
|
|
41
|
-
if (!(0,
|
|
41
|
+
if (!(0, import_chunk_FCYHZHVW.canPrompt)()) {
|
|
42
42
|
throw args.error;
|
|
43
43
|
}
|
|
44
44
|
await panicDialog(args);
|
|
@@ -79,7 +79,7 @@ ${(0, import_chunk_PG5FDKSF.dim)(`Learn more: ${(0, import_chunk_I6WLABB2.link)(
|
|
|
79
79
|
if (shouldSubmitReport) {
|
|
80
80
|
try {
|
|
81
81
|
console.log("Submitting...");
|
|
82
|
-
const reportId = await (0,
|
|
82
|
+
const reportId = await (0, import_chunk_HFFWZTVM.sendPanic)({ error, cliVersion, enginesVersion, getDatabaseVersionSafe });
|
|
83
83
|
console.log(`
|
|
84
84
|
${(0, import_chunk_PG5FDKSF.bold)(`We successfully received the error report id: ${reportId}`)}`);
|
|
85
85
|
console.log(`
|
|
@@ -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_W6J5YFD2_exports = {};
|
|
20
|
+
__export(chunk_W6J5YFD2_exports, {
|
|
21
21
|
version: () => version
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
25
|
-
var packageJson = (0,
|
|
23
|
+
module.exports = __toCommonJS(chunk_W6J5YFD2_exports);
|
|
24
|
+
var import_chunk_THADADEM = require("./chunk-THADADEM.js");
|
|
25
|
+
var packageJson = (0, import_chunk_THADADEM.require_package)();
|
|
26
26
|
var version = packageJson.version;
|
|
@@ -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_WDPDHAFW_exports = {};
|
|
20
|
+
__export(chunk_WDPDHAFW_exports, {
|
|
21
21
|
addVersionDetailsToErrorMessage: () => addVersionDetailsToErrorMessage
|
|
22
22
|
});
|
|
23
|
-
module.exports = __toCommonJS(
|
|
24
|
-
var
|
|
23
|
+
module.exports = __toCommonJS(chunk_WDPDHAFW_exports);
|
|
24
|
+
var import_chunk_W6J5YFD2 = require("./chunk-W6J5YFD2.js");
|
|
25
25
|
var import_chunk_QN6PSQY7 = require("./chunk-QN6PSQY7.js");
|
|
26
26
|
function addVersionDetailsToErrorMessage(message) {
|
|
27
|
-
const rows = [["Prisma CLI Version",
|
|
27
|
+
const rows = [["Prisma CLI Version", import_chunk_W6J5YFD2.version]];
|
|
28
28
|
return `${message}
|
|
29
29
|
|
|
30
30
|
${(0, import_chunk_QN6PSQY7.formatTable)(rows)}`;
|
|
@@ -26,12 +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_WFNB7VRA_exports = {};
|
|
30
|
+
__export(chunk_WFNB7VRA_exports, {
|
|
31
31
|
getGeneratorSuccessMessage: () => getGeneratorSuccessMessage
|
|
32
32
|
});
|
|
33
|
-
module.exports = __toCommonJS(
|
|
33
|
+
module.exports = __toCommonJS(chunk_WFNB7VRA_exports);
|
|
34
34
|
var import_chunk_XYCIH36R = require("./chunk-XYCIH36R.js");
|
|
35
|
+
var import_chunk_ERSH2BQA = require("./chunk-ERSH2BQA.js");
|
|
35
36
|
var import_chunk_IOIAK7V7 = require("./chunk-IOIAK7V7.js");
|
|
36
37
|
var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
|
|
37
38
|
var import_path = __toESM(require("path"));
|
|
@@ -44,7 +45,16 @@ function getGeneratorSuccessMessage(generator, time) {
|
|
|
44
45
|
function formatVersion(generator) {
|
|
45
46
|
const version = generator.manifest?.version;
|
|
46
47
|
if (generator.getProvider() === "prisma-client-js") {
|
|
47
|
-
|
|
48
|
+
const engineType = (0, import_chunk_ERSH2BQA.getClientEngineType)(generator.config);
|
|
49
|
+
let engineHint = "";
|
|
50
|
+
if (generator.options?.noEngine) {
|
|
51
|
+
engineHint = ", engine=none";
|
|
52
|
+
} else if (engineType === "binary") {
|
|
53
|
+
engineHint = ", engine=binary";
|
|
54
|
+
} else if (engineType === "library") {
|
|
55
|
+
engineHint = "";
|
|
56
|
+
}
|
|
57
|
+
return `v${version ?? "?.?.?"}${engineHint}`;
|
|
48
58
|
}
|
|
49
59
|
return version;
|
|
50
60
|
}
|
|
@@ -26,17 +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_ZL2NP4XJ_exports = {};
|
|
30
|
+
__export(chunk_ZL2NP4XJ_exports, {
|
|
31
31
|
GetConfigError: () => GetConfigError,
|
|
32
|
-
getConfig: () => getConfig
|
|
32
|
+
getConfig: () => getConfig,
|
|
33
|
+
getDirectUrl: () => getDirectUrl,
|
|
34
|
+
getEffectiveUrl: () => getEffectiveUrl,
|
|
35
|
+
resolveUrl: () => resolveUrl
|
|
33
36
|
});
|
|
34
|
-
module.exports = __toCommonJS(
|
|
35
|
-
var
|
|
36
|
-
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
|
37
|
+
module.exports = __toCommonJS(chunk_ZL2NP4XJ_exports);
|
|
38
|
+
var import_chunk_TZJROXB3 = require("./chunk-TZJROXB3.js");
|
|
37
39
|
var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
|
|
38
|
-
var
|
|
39
|
-
var
|
|
40
|
+
var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
|
|
41
|
+
var import_chunk_TU5OMWUB = require("./chunk-TU5OMWUB.js");
|
|
42
|
+
var import_chunk_OMQVWRCE = require("./chunk-OMQVWRCE.js");
|
|
40
43
|
var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
|
|
41
44
|
var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
|
|
42
45
|
var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
|
|
@@ -61,22 +64,41 @@ ${detailsHeader} ${message}`;
|
|
|
61
64
|
}).exhaustive();
|
|
62
65
|
const errorMessageWithContext = `${constructedErrorMessage}
|
|
63
66
|
[Context: getConfig]`;
|
|
64
|
-
super((0,
|
|
67
|
+
super((0, import_chunk_TU5OMWUB.addVersionDetailsToErrorMessage)(errorMessageWithContext));
|
|
65
68
|
this.name = "GetConfigError";
|
|
66
69
|
}
|
|
67
70
|
};
|
|
71
|
+
function getEffectiveUrl(ds) {
|
|
72
|
+
if (ds.directUrl !== void 0) return ds.directUrl;
|
|
73
|
+
return ds.url;
|
|
74
|
+
}
|
|
75
|
+
function getDirectUrl(ds) {
|
|
76
|
+
return ds.directUrl;
|
|
77
|
+
}
|
|
78
|
+
function resolveUrl(envValue) {
|
|
79
|
+
const urlFromValue = envValue?.value;
|
|
80
|
+
const urlEnvVarName = envValue?.fromEnvVar;
|
|
81
|
+
const urlEnvVarValue = urlEnvVarName ? process.env[urlEnvVarName] : void 0;
|
|
82
|
+
return urlFromValue ?? urlEnvVarValue;
|
|
83
|
+
}
|
|
68
84
|
async function getConfig(options) {
|
|
69
|
-
const debugErrorType = (0,
|
|
85
|
+
const debugErrorType = (0, import_chunk_TZJROXB3.createDebugErrorType)(debug, "getConfigWasm");
|
|
70
86
|
debug(`Using getConfig Wasm`);
|
|
71
87
|
const configEither = (0, import_function.pipe)(
|
|
72
88
|
(0, import_chunk_5DBOS77Y.tryCatch)(
|
|
73
89
|
() => {
|
|
74
|
-
if (process.env.
|
|
90
|
+
if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_CONFIG) {
|
|
75
91
|
debug("Triggering a Rust panic...");
|
|
76
|
-
|
|
92
|
+
import_chunk_OMQVWRCE.prismaSchemaWasm.debug_panic();
|
|
77
93
|
}
|
|
78
|
-
const params = JSON.stringify({
|
|
79
|
-
|
|
94
|
+
const params = JSON.stringify({
|
|
95
|
+
prismaSchema: options.datamodel,
|
|
96
|
+
datasourceOverrides: {},
|
|
97
|
+
ignoreEnvVarErrors: options.ignoreEnvVarErrors ?? false,
|
|
98
|
+
env: process.env
|
|
99
|
+
});
|
|
100
|
+
const data = import_chunk_OMQVWRCE.prismaSchemaWasm.get_config(params);
|
|
101
|
+
return data;
|
|
80
102
|
},
|
|
81
103
|
(e) => ({
|
|
82
104
|
type: "wasm-error",
|
|
@@ -134,12 +156,12 @@ async function getConfig(options) {
|
|
|
134
156
|
return panic;
|
|
135
157
|
}
|
|
136
158
|
const errorOutput = e.error.message;
|
|
137
|
-
return new GetConfigError((0,
|
|
159
|
+
return new GetConfigError((0, import_chunk_TZJROXB3.parseQueryEngineError)({ errorOutput, reason: e.reason }));
|
|
138
160
|
}).with({ type: "validation-error" }, (e) => {
|
|
139
161
|
return new GetConfigError({
|
|
140
162
|
_tag: "parsed",
|
|
141
163
|
errorCode: SCHEMA_VALIDATION_ERROR_CODE,
|
|
142
|
-
reason: (0,
|
|
164
|
+
reason: (0, import_chunk_TZJROXB3.createSchemaValidationError)(e.reason),
|
|
143
165
|
message: formatErrors(e.error)
|
|
144
166
|
});
|
|
145
167
|
}).otherwise((e) => {
|
|
@@ -1,16 +1,18 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { SchemaContext } from '..';
|
|
2
2
|
/**
|
|
3
3
|
* Get the message to display when a command is forbidden with a data proxy flag
|
|
4
|
-
* @param
|
|
4
|
+
* @param command the cli command (eg. db push)
|
|
5
5
|
* @returns
|
|
6
6
|
*/
|
|
7
|
-
export declare const forbiddenCmdWithDataProxyFlagMessage: (
|
|
7
|
+
export declare const forbiddenCmdWithDataProxyFlagMessage: (command: string) => string;
|
|
8
8
|
/**
|
|
9
9
|
* Check that the data proxy cannot be used through the given urls and schema contexts
|
|
10
|
-
* @param
|
|
11
|
-
* @param
|
|
10
|
+
* @param command the cli command (eg. db push)
|
|
11
|
+
* @param urls list of urls to check
|
|
12
|
+
* @param schemaContexts list of schema contexts to check
|
|
12
13
|
*/
|
|
13
|
-
export declare function checkUnsupportedDataProxy({ cmd,
|
|
14
|
+
export declare function checkUnsupportedDataProxy({ cmd, schemaContext, urls, }: {
|
|
14
15
|
cmd: string;
|
|
15
|
-
|
|
16
|
+
schemaContext?: SchemaContext;
|
|
17
|
+
urls?: (string | undefined)[];
|
|
16
18
|
}): void;
|