@prisma/internals 6.19.0 → 6.20.0-integration-next.2

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.
Files changed (116) hide show
  1. package/dist/{chunk-GMW36QQF.js → chunk-22HIO2UL.js} +7 -7
  2. package/dist/{chunk-C7SAKLK2.js → chunk-24ZPBDBI.js} +11 -11
  3. package/dist/{chunk-D7OTFXCP.js → chunk-2Q43C56O.js} +5 -5
  4. package/dist/{chunk-SOKSKSEX.js → chunk-2UPB3LSW.js} +14 -20
  5. package/dist/{chunk-I6WLABB2.js → chunk-3WXUQZS7.js} +14 -5
  6. package/dist/{chunk-Y7XBA7JY.js → chunk-3ZWEK4N6.js} +5 -5
  7. package/dist/{chunk-RS2R7COT.js → chunk-5I4ERIIY.js} +3 -9
  8. package/dist/{chunk-F2OZV76L.js → chunk-5MHUYAV3.js} +9 -9
  9. package/dist/{chunk-HO5HRHFZ.js → chunk-5W3BSMTH.js} +3 -6
  10. package/dist/{chunk-TBR6SNKL.js → chunk-73HXEN2A.js} +5 -5
  11. package/dist/{chunk-FHZ5QJLR.js → chunk-AL7ZUBHY.js} +5 -5
  12. package/dist/{chunk-WFNB7VRA.js → chunk-ARC7TW3L.js} +4 -14
  13. package/dist/{chunk-CCLAMTCA.js → chunk-B2BNIZB2.js} +7 -8
  14. package/dist/{chunk-UQUWZJVN.js → chunk-BM3JIFQT.js} +7 -7
  15. package/dist/{chunk-2GUGGLPK.js → chunk-BMMRL7AY.js} +38 -94
  16. package/dist/{chunk-HFFWZTVM.js → chunk-BUQN4WLU.js} +7 -9
  17. package/dist/{chunk-AP3F7M3T.js → chunk-C5YUUOQW.js} +12 -12
  18. package/dist/{chunk-HHG4DGHC.js → chunk-CGLLQXZE.js} +11 -12
  19. package/dist/chunk-DYV47NUW.js +796 -0
  20. package/dist/{chunk-IDINCQMN.js → chunk-FF7OLLBP.js} +12 -784
  21. package/dist/{chunk-4CGPN5SR.js → chunk-GJSFP4V4.js} +3 -9
  22. package/dist/{chunk-4JCVHBYR.js → chunk-GL7OANR6.js} +5 -5
  23. package/dist/{chunk-OAT7ZJED.js → chunk-H5STSTVK.js} +7 -20
  24. package/dist/{chunk-FYZCPL2Z.js → chunk-HNRMSI3R.js} +5 -8
  25. package/dist/{chunk-JTS4UPHJ.js → chunk-IQLWIY62.js} +5 -5
  26. package/dist/{chunk-LU7NT333.js → chunk-K5SXCDBM.js} +11 -11
  27. package/dist/{chunk-5IQ5L5E4.js → chunk-KGES6NIS.js} +38 -94
  28. package/dist/{chunk-NVNI2SRU.js → chunk-KNNTV7IN.js} +687 -213
  29. package/dist/{chunk-LFFCR67R.js → chunk-LA5QBRTU.js} +14 -20
  30. package/dist/{chunk-5AI4FIZ3.js → chunk-MEOOYUIZ.js} +10 -10
  31. package/dist/{chunk-TQFONRJP.js → chunk-MLFKBBDL.js} +5 -5
  32. package/dist/{chunk-7QC5VORA.js → chunk-MYLPCGTT.js} +5 -5
  33. package/dist/{chunk-LV27YCGC.js → chunk-NCYLUGLI.js} +11 -11
  34. package/dist/{chunk-EYVG6XQS.js → chunk-OKVM3CW4.js} +3 -39
  35. package/dist/{chunk-JOIIWB3U.js → chunk-QOZ7USPD.js} +193 -159
  36. package/dist/{chunk-BVJP43JS.js → chunk-QSVWJ2S2.js} +13 -784
  37. package/dist/{chunk-WYQJ4JWO.js → chunk-S3KGFJ2G.js} +12 -12
  38. package/dist/{chunk-75BIJ5PX.js → chunk-SMJRM3EM.js} +9 -9
  39. package/dist/{chunk-FGU7IK4W.js → chunk-SQI3K6L7.js} +8 -9
  40. package/dist/{chunk-AX5N26KG.js → chunk-TGA7DC5A.js} +14 -9
  41. package/dist/{chunk-QJ3QPUM5.js → chunk-VFZCLI5X.js} +5 -5
  42. package/dist/{chunk-E4H6V3Z4.js → chunk-VHE2A7YV.js} +11 -11
  43. package/dist/{chunk-UHI6VYFX.js → chunk-WJKBKH3Y.js} +5 -5
  44. package/dist/{chunk-TZJROXB3.js → chunk-WSZXPLJQ.js} +4 -4
  45. package/dist/{chunk-PHFQSMQF.js → chunk-WU6O3W6S.js} +5 -5
  46. package/dist/{chunk-E6MOBIU5.js → chunk-ZKAM5JVB.js} +5 -5
  47. package/dist/cli/checkUnsupportedDataProxy.js +53 -60
  48. package/dist/cli/getGeneratorSuccessMessage.js +2 -3
  49. package/dist/cli/getSchema.d.ts +1 -15
  50. package/dist/cli/getSchema.js +4 -5
  51. package/dist/cli/hashes.js +4 -4
  52. package/dist/cli/schemaContext.d.ts +1 -3
  53. package/dist/cli/schemaContext.js +53 -60
  54. package/dist/engine-commands/errorHelpers.js +4 -4
  55. package/dist/engine-commands/formatSchema.js +52 -59
  56. package/dist/engine-commands/getConfig.d.ts +0 -1
  57. package/dist/engine-commands/getConfig.js +13 -13
  58. package/dist/engine-commands/getDmmf.js +10 -10
  59. package/dist/engine-commands/getEngineVersion.js +6 -9
  60. package/dist/engine-commands/getEnginesInfo.d.ts +0 -1
  61. package/dist/engine-commands/getEnginesInfo.js +7 -9
  62. package/dist/engine-commands/index.js +64 -71
  63. package/dist/engine-commands/lintSchema.js +9 -9
  64. package/dist/engine-commands/mergeSchemas.js +10 -10
  65. package/dist/engine-commands/queryEngineCommons.js +6 -6
  66. package/dist/engine-commands/validate.js +10 -10
  67. package/dist/errorReporting.js +6 -6
  68. package/dist/get-generators/getGenerators.d.ts +0 -1
  69. package/dist/get-generators/getGenerators.js +55 -62
  70. package/dist/get-generators/utils/binaryTypeToEngineType.js +2 -2
  71. package/dist/get-generators/utils/engineTypeToBinaryType.js +2 -2
  72. package/dist/get-generators/utils/getBinaryPathsByVersion.js +6 -5
  73. package/dist/getPackedPackage.js +4 -3
  74. package/dist/index.d.ts +1 -10
  75. package/dist/index.js +95 -112
  76. package/dist/{multipart-parser-3AFJFP6K.js → multipart-parser-UV3WZSWW.js} +6 -6
  77. package/dist/resolveBinary.js +8 -7
  78. package/dist/schemaEngineCommands.js +9 -8
  79. package/dist/sendPanic.js +4 -4
  80. package/dist/utils/drawBox.js +2 -2
  81. package/dist/utils/fs-functional.js +10 -10
  82. package/dist/utils/fs-utils.js +8 -8
  83. package/dist/utils/getVersionFromPackageJson.js +3 -3
  84. package/dist/utils/handlePanic.js +6 -6
  85. package/dist/utils/link.js +2 -2
  86. package/dist/utils/missingDatasource.js +3 -3
  87. package/dist/utils/missingGeneratorMessage.js +5 -5
  88. package/dist/utils/serializeQueryEngineName.js +2 -2
  89. package/dist/wasm.js +5 -5
  90. package/package.json +15 -16
  91. package/dist/chunk-3FP46GUV.js +0 -471
  92. package/dist/chunk-46ABODUM.js +0 -186
  93. package/dist/chunk-6TTRTZXU.js +0 -37
  94. package/dist/chunk-D4VDA2TZ.js +0 -66
  95. package/dist/chunk-DZYINYAA.js +0 -68
  96. package/dist/chunk-ERSH2BQA.js +0 -58
  97. package/dist/chunk-PZMRR772.js +0 -41
  98. package/dist/chunk-T2PM5TKT.js +0 -55
  99. package/dist/cli/checkUnsupportedSchemaEngineWasm.d.ts +0 -22
  100. package/dist/cli/checkUnsupportedSchemaEngineWasm.js +0 -135
  101. package/dist/client/getClientEngineType.d.ts +0 -7
  102. package/dist/client/getClientEngineType.js +0 -26
  103. package/dist/dotenvExpand.d.ts +0 -35
  104. package/dist/dotenvExpand.js +0 -25
  105. package/dist/utils/cloudflareD1.d.ts +0 -5
  106. package/dist/utils/cloudflareD1.js +0 -27
  107. package/dist/utils/getEnvPaths.d.ts +0 -14
  108. package/dist/utils/getEnvPaths.js +0 -29
  109. package/dist/utils/handleEngineLoadingErrors.d.ts +0 -8
  110. package/dist/utils/handleEngineLoadingErrors.js +0 -27
  111. package/dist/utils/load.d.ts +0 -6
  112. package/dist/utils/load.js +0 -28
  113. package/dist/utils/loadEnvFile.d.ts +0 -10
  114. package/dist/utils/loadEnvFile.js +0 -30
  115. package/dist/utils/tryLoadEnvs.d.ts +0 -25
  116. package/dist/utils/tryLoadEnvs.js +0 -30
@@ -1,186 +0,0 @@
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_46ABODUM_exports = {};
30
- __export(chunk_46ABODUM_exports, {
31
- getEnvPaths: () => getEnvPaths
32
- });
33
- module.exports = __toCommonJS(chunk_46ABODUM_exports);
34
- var import_chunk_3FP46GUV = require("./chunk-3FP46GUV.js");
35
- var import_chunk_EYVG6XQS = require("./chunk-EYVG6XQS.js");
36
- var import_debug = __toESM(require("@prisma/debug"));
37
- var import_node_path = __toESM(require("node:path"));
38
- var import_node_process = __toESM(require("node:process"));
39
- var import_node_path2 = __toESM(require("node:path"));
40
- var import_node_fs = __toESM(require("node:fs"));
41
- var import_node_url = require("node:url");
42
- var import_node_url2 = require("node:url");
43
- var import_node_fs2 = __toESM(require("node:fs"));
44
- var import_fs = __toESM(require("fs"));
45
- var import_path = __toESM(require("path"));
46
- var typeMappings = {
47
- directory: "isDirectory",
48
- file: "isFile"
49
- };
50
- function checkType(type) {
51
- if (Object.hasOwnProperty.call(typeMappings, type)) {
52
- return;
53
- }
54
- throw new Error(`Invalid type specified: ${type}`);
55
- }
56
- var matchType = (type, stat) => stat[typeMappings[type]]();
57
- var toPath = (urlOrPath) => urlOrPath instanceof URL ? (0, import_node_url.fileURLToPath)(urlOrPath) : urlOrPath;
58
- function locatePathSync(paths, {
59
- cwd = import_node_process.default.cwd(),
60
- type = "file",
61
- allowSymlinks = true
62
- } = {}) {
63
- checkType(type);
64
- cwd = toPath(cwd);
65
- const statFunction = allowSymlinks ? import_node_fs.default.statSync : import_node_fs.default.lstatSync;
66
- for (const path_ of paths) {
67
- try {
68
- const stat = statFunction(import_node_path2.default.resolve(cwd, path_), {
69
- throwIfNoEntry: false
70
- });
71
- if (!stat) {
72
- continue;
73
- }
74
- if (matchType(type, stat)) {
75
- return path_;
76
- }
77
- } catch {
78
- }
79
- }
80
- }
81
- function toPath2(urlOrPath) {
82
- return urlOrPath instanceof URL ? (0, import_node_url2.fileURLToPath)(urlOrPath) : urlOrPath;
83
- }
84
- function pathExistsSync(path4) {
85
- try {
86
- import_node_fs2.default.accessSync(path4);
87
- return true;
88
- } catch {
89
- return false;
90
- }
91
- }
92
- var findUpStop = Symbol("findUpStop");
93
- function findUpMultipleSync(name, options = {}) {
94
- let directory = import_node_path.default.resolve(toPath2(options.cwd) ?? "");
95
- const { root } = import_node_path.default.parse(directory);
96
- const stopAt = import_node_path.default.resolve(directory, toPath2(options.stopAt) ?? root);
97
- const limit = options.limit ?? Number.POSITIVE_INFINITY;
98
- const paths = [name].flat();
99
- const runMatcher = (locateOptions) => {
100
- if (typeof name !== "function") {
101
- return locatePathSync(paths, locateOptions);
102
- }
103
- const foundPath = name(locateOptions.cwd);
104
- if (typeof foundPath === "string") {
105
- return locatePathSync([foundPath], locateOptions);
106
- }
107
- return foundPath;
108
- };
109
- const matches = [];
110
- while (true) {
111
- const foundPath = runMatcher({ ...options, cwd: directory });
112
- if (foundPath === findUpStop) {
113
- break;
114
- }
115
- if (foundPath) {
116
- matches.push(import_node_path.default.resolve(directory, foundPath));
117
- }
118
- if (directory === stopAt || matches.length >= limit) {
119
- break;
120
- }
121
- directory = import_node_path.default.dirname(directory);
122
- }
123
- return matches;
124
- }
125
- function findUpSync(name, options = {}) {
126
- const matches = findUpMultipleSync(name, { ...options, limit: 1 });
127
- return matches[0];
128
- }
129
- var debug = (0, import_debug.default)("prisma:loadEnv");
130
- async function getEnvPaths(schemaPath, opts = { cwd: process.cwd() }) {
131
- const rootEnvPath = getProjectRootEnvPath({ cwd: opts.cwd }) ?? null;
132
- const schemaEnvPathFromArgs = schemaPathToEnvPath(schemaPath);
133
- const schemaEnvPathFromPkgJson = schemaPathToEnvPath(await readSchemaPathFromPkgJson());
134
- const schemaEnvPaths = [
135
- schemaEnvPathFromArgs,
136
- // 1 - Check --schema directory for .env
137
- schemaEnvPathFromPkgJson,
138
- // 2 - Check package.json schema directory for .env
139
- "./prisma/.env",
140
- // 3 - Check ./prisma directory for .env
141
- "./.env"
142
- // 4 - Check cwd for .env
143
- ];
144
- const schemaEnvPath = schemaEnvPaths.find(import_chunk_3FP46GUV.exists);
145
- return { rootEnvPath, schemaEnvPath };
146
- }
147
- async function readSchemaPathFromPkgJson() {
148
- try {
149
- const pkgJsonSchema = await (0, import_chunk_EYVG6XQS.getSchemaFromPackageJson)(process.cwd());
150
- if (pkgJsonSchema.ok) {
151
- pkgJsonSchema.schema.schemaPath;
152
- }
153
- return null;
154
- } catch {
155
- return null;
156
- }
157
- }
158
- function getProjectRootEnvPath(opts) {
159
- const pkgJsonPath = findUpSync((dir) => {
160
- const pkgPath = import_path.default.join(dir, "package.json");
161
- if (pathExistsSync(pkgPath)) {
162
- try {
163
- const pkg = JSON.parse(import_fs.default.readFileSync(pkgPath, "utf8"));
164
- if (pkg["name"] !== ".prisma/client") {
165
- debug(`project root found at ${pkgPath}`);
166
- return pkgPath;
167
- }
168
- } catch (e) {
169
- debug(`skipping package.json at ${pkgPath}`);
170
- }
171
- }
172
- return void 0;
173
- }, opts);
174
- if (!pkgJsonPath) {
175
- return null;
176
- }
177
- const candidate = import_path.default.join(import_path.default.dirname(pkgJsonPath), ".env");
178
- if (!import_fs.default.existsSync(candidate)) {
179
- return null;
180
- }
181
- return candidate;
182
- }
183
- function schemaPathToEnvPath(schemaPath) {
184
- if (!schemaPath) return null;
185
- return import_path.default.join(import_path.default.dirname(schemaPath), ".env");
186
- }
@@ -1,37 +0,0 @@
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_6TTRTZXU_exports = {};
20
- __export(chunk_6TTRTZXU_exports, {
21
- loadLibrary: () => loadLibrary
22
- });
23
- module.exports = __toCommonJS(chunk_6TTRTZXU_exports);
24
- var import_chunk_DZYINYAA = require("./chunk-DZYINYAA.js");
25
- var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
26
- function loadLibrary(id, platformInfo) {
27
- try {
28
- return (0, import_chunk_4VNS5WPM.__require)(id);
29
- } catch (e) {
30
- const errorMessage = (0, import_chunk_DZYINYAA.handleLibraryLoadingErrors)({
31
- e,
32
- platformInfo,
33
- id
34
- });
35
- throw new Error(errorMessage);
36
- }
37
- }
@@ -1,66 +0,0 @@
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_D4VDA2TZ_exports = {};
30
- __export(chunk_D4VDA2TZ_exports, {
31
- locateLocalCloudflareD1: () => locateLocalCloudflareD1
32
- });
33
- module.exports = __toCommonJS(chunk_D4VDA2TZ_exports);
34
- var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
35
- var import_chunk_JOIIWB3U = require("./chunk-JOIIWB3U.js");
36
- var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
37
- var import_node_path = __toESM(require("node:path"));
38
- var import_node_process = __toESM(require("node:process"));
39
- var import_fast_glob = (0, import_chunk_4VNS5WPM.__toESM)((0, import_chunk_JOIIWB3U.require_out)());
40
- var import_globby = (0, import_chunk_4VNS5WPM.__toESM)((0, import_chunk_JOIIWB3U.require_globby)());
41
- var defaultD1DirPath = import_node_path.default.join(".wrangler", "state", "v3", "d1", "miniflare-D1DatabaseObject");
42
- async function locateLocalCloudflareD1({ arg }) {
43
- const cwd = import_node_process.default.cwd();
44
- const d1DirPath = import_node_path.default.posix.join(cwd, defaultD1DirPath);
45
- const pathConverted = (0, import_fast_glob.convertPathToPattern)(d1DirPath);
46
- const d1Databases = await (0, import_globby.default)(import_node_path.default.posix.join(pathConverted, "*.sqlite"), {});
47
- if (d1Databases.length === 0) {
48
- throw new Error(
49
- `No Cloudflare D1 databases found in ${defaultD1DirPath}. Did you run \`wrangler d1 create <DATABASE_NAME>\` and \`wrangler dev\`?`
50
- );
51
- }
52
- if (d1Databases.length > 1) {
53
- const { originalArg, recommendedArg } = (0, import_chunk_XKZ6CBLA.z)(arg).with("--to-local-d1", (originalArg2) => ({
54
- originalArg: originalArg2,
55
- recommendedArg: "--to-url file:"
56
- })).with("--from-local-d1", (originalArg2) => ({
57
- originalArg: originalArg2,
58
- recommendedArg: "--from-url file:"
59
- })).exhaustive();
60
- throw new Error(
61
- `Multiple Cloudflare D1 databases found in ${defaultD1DirPath}. Please manually specify the local D1 database with \`${recommendedArg}\`, without using the \`${originalArg}\` flag.`
62
- );
63
- }
64
- const d1Database = d1Databases[0];
65
- return d1Database;
66
- }
@@ -1,68 +0,0 @@
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_DZYINYAA_exports = {};
20
- __export(chunk_DZYINYAA_exports, {
21
- handleLibraryLoadingErrors: () => handleLibraryLoadingErrors
22
- });
23
- module.exports = __toCommonJS(chunk_DZYINYAA_exports);
24
- var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
25
- var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
26
- var import_get_platform = require("@prisma/get-platform");
27
- function handleLibraryLoadingErrors(args) {
28
- const error = args.e;
29
- const systemLibraryNotFound = (library) => `Prisma cannot find the required \`${library}\` system library in your system`;
30
- const hasLinkingProblem = error.message.includes("cannot open shared object file");
31
- const referToSystemRequirementsDocs = `Please refer to the documentation about Prisma's system requirements: ${(0, import_get_platform.link)(
32
- "https://pris.ly/d/system-requirements"
33
- )}`;
34
- const errorTitle = `Unable to require(\`${(0, import_chunk_PG5FDKSF.dim)(args.id)}\`).`;
35
- const potentialReasonMessage = (0, import_chunk_XKZ6CBLA.z)({ message: error.message, code: error.code }).with({ code: "ENOENT" }, () => `File does not exist.`).when(
36
- ({ message }) => hasLinkingProblem && message.includes("libz"),
37
- () => {
38
- return `${systemLibraryNotFound("libz")}. Please install it and try again.`;
39
- }
40
- ).when(
41
- ({ message }) => hasLinkingProblem && message.includes("libgcc_s"),
42
- () => {
43
- return `${systemLibraryNotFound("libgcc_s")}. Please install it and try again.`;
44
- }
45
- ).when(
46
- ({ message }) => hasLinkingProblem && message.includes("libssl"),
47
- () => {
48
- const libsslVersion = args.platformInfo.libssl ? `openssl-${args.platformInfo.libssl}` : "openssl";
49
- return `${systemLibraryNotFound("libssl")}. Please install ${libsslVersion} and try again.`;
50
- }
51
- ).when(
52
- ({ message }) => message.includes("GLIBC"),
53
- () => {
54
- return `Prisma has detected an incompatible version of the \`glibc\` C standard library installed in your system. This probably means your system may be too old to run Prisma. ${referToSystemRequirementsDocs}`;
55
- }
56
- ).when(
57
- ({ message }) => args.platformInfo.platform === "linux" && message.includes("symbol not found"),
58
- () => {
59
- return `The Prisma engines are not compatible with your system ${args.platformInfo.originalDistro} on (${args.platformInfo.archFromUname}) which uses the \`${args.platformInfo.binaryTarget}\` binaryTarget by default. ${referToSystemRequirementsDocs}`;
60
- }
61
- ).otherwise(() => {
62
- return `The Prisma engines do not seem to be compatible with your system. ${referToSystemRequirementsDocs}`;
63
- });
64
- return `${errorTitle}
65
- ${potentialReasonMessage}
66
-
67
- Details: ${error.message}`;
68
- }
@@ -1,58 +0,0 @@
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_ERSH2BQA_exports = {};
20
- __export(chunk_ERSH2BQA_exports, {
21
- ClientEngineType: () => ClientEngineType,
22
- getClientEngineType: () => getClientEngineType
23
- });
24
- module.exports = __toCommonJS(chunk_ERSH2BQA_exports);
25
- var ClientEngineType = /* @__PURE__ */ ((ClientEngineType2) => {
26
- ClientEngineType2["Library"] = "library";
27
- ClientEngineType2["Binary"] = "binary";
28
- ClientEngineType2["Client"] = "client";
29
- return ClientEngineType2;
30
- })(ClientEngineType || {});
31
- function getClientEngineType(generatorConfig) {
32
- const engineTypeFromEnvVar = getEngineTypeFromEnvVar();
33
- if (engineTypeFromEnvVar) return engineTypeFromEnvVar;
34
- if (generatorConfig?.config.engineType === "library") {
35
- return "library";
36
- } else if (generatorConfig?.config.engineType === "binary") {
37
- return "binary";
38
- } else if (generatorConfig?.config.engineType === "client") {
39
- return "client";
40
- } else {
41
- return getDefaultEngineType();
42
- }
43
- }
44
- function getEngineTypeFromEnvVar() {
45
- const engineType = process.env.PRISMA_CLIENT_ENGINE_TYPE;
46
- if (engineType === "library") {
47
- return "library";
48
- } else if (engineType === "binary") {
49
- return "binary";
50
- } else if (engineType === "client") {
51
- return "client";
52
- } else {
53
- return void 0;
54
- }
55
- }
56
- function getDefaultEngineType() {
57
- return "library";
58
- }
@@ -1,41 +0,0 @@
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_PZMRR772_exports = {};
20
- __export(chunk_PZMRR772_exports, {
21
- loadEnvFile: () => loadEnvFile
22
- });
23
- module.exports = __toCommonJS(chunk_PZMRR772_exports);
24
- var import_chunk_46ABODUM = require("./chunk-46ABODUM.js");
25
- var import_chunk_3FP46GUV = require("./chunk-3FP46GUV.js");
26
- async function loadEnvFile({
27
- schemaPath,
28
- config,
29
- printMessage = false
30
- }) {
31
- if (config.loadedFromFile) {
32
- process.stderr.write(`Prisma config detected, skipping environment variable loading.
33
- `);
34
- return;
35
- }
36
- const envPaths = await (0, import_chunk_46ABODUM.getEnvPaths)(schemaPath);
37
- const envData = (0, import_chunk_3FP46GUV.tryLoadEnvs)(envPaths, { conflictCheck: "error" });
38
- if (printMessage && envData && envData.message) {
39
- process.stderr.write(envData.message + "\n");
40
- }
41
- }
@@ -1,55 +0,0 @@
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
- }
@@ -1,22 +0,0 @@
1
- import { PrismaConfigInternal } from '@prisma/config';
2
- /**
3
- * Get the message to display when a command is forbidden with a data proxy flag
4
- * @param command the cli command (eg. db push)
5
- * @returns
6
- */
7
- export declare const forbiddenCmdFlagWithSchemaEngineWasm: ({ cmd, flag }: {
8
- cmd: string;
9
- flag: string;
10
- }) => string;
11
- /**
12
- * Check that the data proxy cannot be used through the given urls and schema contexts
13
- * @param command the cli command (eg. db push)
14
- * @param urls list of urls to check
15
- * @param schemaContexts list of schema contexts to check
16
- */
17
- export declare function checkUnsupportedSchemaEngineWasm({ cmd, config, args, flags, }: {
18
- cmd: string;
19
- config: PrismaConfigInternal;
20
- args: Record<string, unknown>;
21
- flags: Array<string>;
22
- }): void;
@@ -1,135 +0,0 @@
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 checkUnsupportedSchemaEngineWasm_exports = {};
20
- __export(checkUnsupportedSchemaEngineWasm_exports, {
21
- checkUnsupportedSchemaEngineWasm: () => import_chunk_5IQ5L5E4.checkUnsupportedSchemaEngineWasm,
22
- forbiddenCmdFlagWithSchemaEngineWasm: () => import_chunk_5IQ5L5E4.forbiddenCmdFlagWithSchemaEngineWasm
23
- });
24
- module.exports = __toCommonJS(checkUnsupportedSchemaEngineWasm_exports);
25
- var import_chunk_5IQ5L5E4 = require("../chunk-5IQ5L5E4.js");
26
- var import_chunk_X3P4J7WW = require("../chunk-X3P4J7WW.js");
27
- var import_chunk_LRU47BGE = require("../chunk-LRU47BGE.js");
28
- var import_chunk_OSHZ4P3G = require("../chunk-OSHZ4P3G.js");
29
- var import_chunk_X77CS5RK = require("../chunk-X77CS5RK.js");
30
- var import_chunk_F2OZV76L = require("../chunk-F2OZV76L.js");
31
- var import_chunk_RS2R7COT = require("../chunk-RS2R7COT.js");
32
- var import_chunk_4CGPN5SR = require("../chunk-4CGPN5SR.js");
33
- var import_chunk_GXW4NTU2 = require("../chunk-GXW4NTU2.js");
34
- var import_chunk_5FJ3MENK = require("../chunk-5FJ3MENK.js");
35
- var import_chunk_PFYALFCY = require("../chunk-PFYALFCY.js");
36
- var import_chunk_HO5HRHFZ = require("../chunk-HO5HRHFZ.js");
37
- var import_chunk_ANU3HEGF = require("../chunk-ANU3HEGF.js");
38
- var import_chunk_LRBXMV4B = require("../chunk-LRBXMV4B.js");
39
- var import_chunk_7QC5VORA = require("../chunk-7QC5VORA.js");
40
- var import_chunk_AX5N26KG = require("../chunk-AX5N26KG.js");
41
- var import_chunk_2SDPW6AX = require("../chunk-2SDPW6AX.js");
42
- var import_chunk_PZMRR772 = require("../chunk-PZMRR772.js");
43
- var import_chunk_7B5PXS6N = require("../chunk-7B5PXS6N.js");
44
- var import_chunk_UGR6KLZN = require("../chunk-UGR6KLZN.js");
45
- var import_chunk_CGFNDGGI = require("../chunk-CGFNDGGI.js");
46
- var import_chunk_XXTPN4LB = require("../chunk-XXTPN4LB.js");
47
- var import_chunk_2IOZUH3U = require("../chunk-2IOZUH3U.js");
48
- var import_chunk_JTKAT4KZ = require("../chunk-JTKAT4KZ.js");
49
- var import_chunk_RBDYOTWB = require("../chunk-RBDYOTWB.js");
50
- var import_chunk_ZKWDIAVF = require("../chunk-ZKWDIAVF.js");
51
- var import_chunk_CUD726EK = require("../chunk-CUD726EK.js");
52
- var import_chunk_BERN76ZI = require("../chunk-BERN76ZI.js");
53
- var import_chunk_46ABODUM = require("../chunk-46ABODUM.js");
54
- var import_chunk_3FP46GUV = require("../chunk-3FP46GUV.js");
55
- var import_chunk_RFB2U4GQ = require("../chunk-RFB2U4GQ.js");
56
- var import_chunk_UQUWZJVN = require("../chunk-UQUWZJVN.js");
57
- var import_chunk_I6WLABB2 = require("../chunk-I6WLABB2.js");
58
- var import_chunk_7IKUTPWQ = require("../chunk-7IKUTPWQ.js");
59
- var import_chunk_WV4QHCSM = require("../chunk-WV4QHCSM.js");
60
- var import_chunk_D4VDA2TZ = require("../chunk-D4VDA2TZ.js");
61
- var import_chunk_HHG4DGHC = require("../chunk-HHG4DGHC.js");
62
- var import_chunk_CRVLHWC5 = require("../chunk-CRVLHWC5.js");
63
- var import_chunk_75BIJ5PX = require("../chunk-75BIJ5PX.js");
64
- var import_chunk_TQFONRJP = require("../chunk-TQFONRJP.js");
65
- var import_chunk_J77ZIDXB = require("../chunk-J77ZIDXB.js");
66
- var import_chunk_HW5RCZSE = require("../chunk-HW5RCZSE.js");
67
- var import_chunk_Y4TOGY6I = require("../chunk-Y4TOGY6I.js");
68
- var import_chunk_IL7PSY44 = require("../chunk-IL7PSY44.js");
69
- var import_chunk_DODIJPCS = require("../chunk-DODIJPCS.js");
70
- var import_chunk_L6KOIJJ5 = require("../chunk-L6KOIJJ5.js");
71
- var import_chunk_NIWBAJZV = require("../chunk-NIWBAJZV.js");
72
- var import_chunk_FCYHZHVW = require("../chunk-FCYHZHVW.js");
73
- var import_chunk_H4NI2RIK = require("../chunk-H4NI2RIK.js");
74
- var import_chunk_ICFLO5JW = require("../chunk-ICFLO5JW.js");
75
- var import_chunk_AP3F7M3T = require("../chunk-AP3F7M3T.js");
76
- var import_chunk_TQCLUNM2 = require("../chunk-TQCLUNM2.js");
77
- var import_chunk_OIVPX3BR = require("../chunk-OIVPX3BR.js");
78
- var import_chunk_CYAS6B5N = require("../chunk-CYAS6B5N.js");
79
- var import_chunk_HPVMQFIY = require("../chunk-HPVMQFIY.js");
80
- var import_chunk_E23HYCQJ = require("../chunk-E23HYCQJ.js");
81
- var import_chunk_LFFCR67R = require("../chunk-LFFCR67R.js");
82
- var import_chunk_C7SAKLK2 = require("../chunk-C7SAKLK2.js");
83
- var import_chunk_GMW36QQF = require("../chunk-GMW36QQF.js");
84
- var import_chunk_OAT7ZJED = require("../chunk-OAT7ZJED.js");
85
- var import_chunk_6TTRTZXU = require("../chunk-6TTRTZXU.js");
86
- var import_chunk_DZYINYAA = require("../chunk-DZYINYAA.js");
87
- var import_chunk_E6MOBIU5 = require("../chunk-E6MOBIU5.js");
88
- var import_chunk_LU7NT333 = require("../chunk-LU7NT333.js");
89
- var import_chunk_TZJROXB3 = require("../chunk-TZJROXB3.js");
90
- var import_chunk_C47SCASR = require("../chunk-C47SCASR.js");
91
- var import_chunk_R6QH57HZ = require("../chunk-R6QH57HZ.js");
92
- var import_chunk_J7ZPY2XA = require("../chunk-J7ZPY2XA.js");
93
- var import_chunk_4JCVHBYR = require("../chunk-4JCVHBYR.js");
94
- var import_chunk_EYVG6XQS = require("../chunk-EYVG6XQS.js");
95
- var import_chunk_D4VZUY3O = require("../chunk-D4VZUY3O.js");
96
- var import_chunk_D7OTFXCP = require("../chunk-D7OTFXCP.js");
97
- var import_chunk_PHFQSMQF = require("../chunk-PHFQSMQF.js");
98
- var import_chunk_QN6PSQY7 = require("../chunk-QN6PSQY7.js");
99
- var import_chunk_DTPFRZWV = require("../chunk-DTPFRZWV.js");
100
- var import_chunk_Y7XBA7JY = require("../chunk-Y7XBA7JY.js");
101
- var import_chunk_FGU7IK4W = require("../chunk-FGU7IK4W.js");
102
- var import_chunk_6JE6QGSJ = require("../chunk-6JE6QGSJ.js");
103
- var import_chunk_BCQZ6JQE = require("../chunk-BCQZ6JQE.js");
104
- var import_chunk_WFNB7VRA = require("../chunk-WFNB7VRA.js");
105
- var import_chunk_XYCIH36R = require("../chunk-XYCIH36R.js");
106
- var import_chunk_ERSH2BQA = require("../chunk-ERSH2BQA.js");
107
- var import_chunk_ZJWZK45Z = require("../chunk-ZJWZK45Z.js");
108
- var import_chunk_2B26F5N3 = require("../chunk-2B26F5N3.js");
109
- var import_chunk_UHI6VYFX = require("../chunk-UHI6VYFX.js");
110
- var import_chunk_JOIHHXR6 = require("../chunk-JOIHHXR6.js");
111
- var import_chunk_FYZCPL2Z = require("../chunk-FYZCPL2Z.js");
112
- var import_chunk_M3GBKLGE = require("../chunk-M3GBKLGE.js");
113
- var import_chunk_IDINCQMN = require("../chunk-IDINCQMN.js");
114
- var import_chunk_TWSLDIFL = require("../chunk-TWSLDIFL.js");
115
- var import_chunk_5DBOS77Y = require("../chunk-5DBOS77Y.js");
116
- var import_chunk_HFFWZTVM = require("../chunk-HFFWZTVM.js");
117
- var import_chunk_KDHESRKE = require("../chunk-KDHESRKE.js");
118
- var import_chunk_XKZ6CBLA = require("../chunk-XKZ6CBLA.js");
119
- var import_chunk_LMVSIVKQ = require("../chunk-LMVSIVKQ.js");
120
- var import_chunk_BPDMLM32 = require("../chunk-BPDMLM32.js");
121
- var import_chunk_IOIAK7V7 = require("../chunk-IOIAK7V7.js");
122
- var import_chunk_PG5FDKSF = require("../chunk-PG5FDKSF.js");
123
- var import_chunk_WXRVYSYN = require("../chunk-WXRVYSYN.js");
124
- var import_chunk_SBUSVJCV = require("../chunk-SBUSVJCV.js");
125
- var import_chunk_LYFOJ5NK = require("../chunk-LYFOJ5NK.js");
126
- var import_chunk_LPNBWFQ3 = require("../chunk-LPNBWFQ3.js");
127
- var import_chunk_T2PM5TKT = require("../chunk-T2PM5TKT.js");
128
- var import_chunk_5AI4FIZ3 = require("../chunk-5AI4FIZ3.js");
129
- var import_chunk_NVNI2SRU = require("../chunk-NVNI2SRU.js");
130
- var import_chunk_BVJP43JS = require("../chunk-BVJP43JS.js");
131
- var import_chunk_KDP6C3CB = require("../chunk-KDP6C3CB.js");
132
- var import_chunk_JOIIWB3U = require("../chunk-JOIIWB3U.js");
133
- var import_chunk_UMM35VP5 = require("../chunk-UMM35VP5.js");
134
- var import_chunk_5VQNKCKW = require("../chunk-5VQNKCKW.js");
135
- var import_chunk_4VNS5WPM = require("../chunk-4VNS5WPM.js");