@prisma/internals 6.3.0-integration-engines-6-3-0-6-integration-5-22-0-with-simplified-typeinfo-c7d99d9db5129d8b35986b8518c7f10bc8580e03.2 → 6.3.0-integration-simpler-typeinfo-query.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.
Files changed (99) hide show
  1. package/dist/{chunk-3DMEILBC.js → chunk-2DXAGCPS.js} +11 -11
  2. package/dist/{chunk-4B7QW7H5.js → chunk-2WJPHJ2I.js} +5 -5
  3. package/dist/{chunk-MGZOEY6N.js → chunk-3U2ANLD3.js} +6 -6
  4. package/dist/{chunk-4O27JVUK.js → chunk-44JHENE6.js} +41 -14
  5. package/dist/{chunk-KQOJB3ZW.js → chunk-4NFLAUKD.js} +70 -70
  6. package/dist/chunk-4RWCRJYD.js +166 -0
  7. package/dist/{chunk-5MCWLJSR.js → chunk-5I4BOTBV.js} +9 -3
  8. package/dist/{chunk-ZZLZJFQD.js → chunk-5R7AZFMV.js} +5 -5
  9. package/dist/{chunk-6QXYYIUQ.js → chunk-5UJZARUY.js} +17 -17
  10. package/dist/{chunk-D6NVMO5B.js → chunk-67KWF6KB.js} +5 -5
  11. package/dist/{chunk-OA3Y3SYB.js → chunk-B44XJG7K.js} +5 -5
  12. package/dist/{chunk-6HMDWGVB.js → chunk-CKVVVLEH.js} +8 -8
  13. package/dist/{chunk-MPJLR4LI.js → chunk-COFXY6NH.js} +41 -14
  14. package/dist/chunk-D4MCOTL5.js +122 -0
  15. package/dist/{chunk-AXVFAZVY.js → chunk-DFG3425X.js} +16 -16
  16. package/dist/chunk-FPHZVRV4.js +110 -0
  17. package/dist/{chunk-S57RMXZW.js → chunk-FTS2IEWX.js} +5 -5
  18. package/dist/chunk-G7LL2H2O.js +54 -0
  19. package/dist/{chunk-25RJ7YTB.js → chunk-H3T4L34H.js} +83 -88
  20. package/dist/{chunk-3BND5XB4.js → chunk-HMGEWJDY.js} +47 -232
  21. package/dist/{chunk-77IC3DNO.js → chunk-IABMG3F4.js} +5 -5
  22. package/dist/{chunk-CXEMRKV4.js → chunk-IAEMHQAC.js} +8 -8
  23. package/dist/{chunk-CZDIXJEO.js → chunk-J3JE5NVO.js} +32 -56
  24. package/dist/{chunk-N6K7M2HZ.js → chunk-J4MA2JIK.js} +5 -5
  25. package/dist/{chunk-IHZ2I7E5.js → chunk-JBUUTZQL.js} +15 -15
  26. package/dist/chunk-JMZHUHCC.js +177 -0
  27. package/dist/{chunk-T6NCATRB.js → chunk-KNNIRRTO.js} +5 -5
  28. package/dist/{chunk-6R6PZCVQ.js → chunk-KPVPQQGU.js} +5 -5
  29. package/dist/{chunk-BNAT44VK.js → chunk-KROMVQBD.js} +9 -9
  30. package/dist/{chunk-TR2BJI77.js → chunk-LXIE6UJ2.js} +961 -79
  31. package/dist/{chunk-EAUIEZK2.js → chunk-MUJIYA44.js} +5 -5
  32. package/dist/{chunk-CGFXOUVQ.js → chunk-OHBFHT5Q.js} +15 -15
  33. package/dist/{chunk-UPIULDLZ.js → chunk-OSOXVAZB.js} +11 -11
  34. package/dist/chunk-RQPDQSHK.js +1429 -0
  35. package/dist/{chunk-2XRDQCIA.js → chunk-S4LINK5Y.js} +5 -5
  36. package/dist/{chunk-D3VAE4HY.js → chunk-UR3LUZY3.js} +17 -17
  37. package/dist/{chunk-EKBX4J6O.js → chunk-V2VWODV3.js} +5 -5
  38. package/dist/{chunk-FT32HRUC.js → chunk-VFU3I6P6.js} +16 -16
  39. package/dist/{chunk-JU7L7EBJ.js → chunk-VJQK3LHU.js} +185 -74
  40. package/dist/{chunk-V2ZF7ETH.js → chunk-WCRKL55L.js} +7 -7
  41. package/dist/{chunk-C47SCASR.js → chunk-WMIBAVWZ.js} +5 -5
  42. package/dist/{chunk-PC7HPZQJ.js → chunk-WYTN2XGW.js} +5 -5
  43. package/dist/{chunk-QTXYAZFX.js → chunk-XLYQ6PQW.js} +17 -17
  44. package/dist/{chunk-VRT7T6MF.js → chunk-YDZVEVUG.js} +73 -73
  45. package/dist/{chunk-ZKAW5JSN.js → chunk-ZA3RMW2P.js} +8 -5
  46. package/dist/cli/checkUnsupportedDataProxy.js +40 -41
  47. package/dist/cli/getSchema.js +45 -46
  48. package/dist/cli/hashes.js +40 -41
  49. package/dist/engine-commands/errorHelpers.js +4 -4
  50. package/dist/engine-commands/formatSchema.js +39 -40
  51. package/dist/engine-commands/getConfig.js +13 -13
  52. package/dist/engine-commands/getDmmf.js +10 -10
  53. package/dist/engine-commands/getEngineVersion.js +8 -8
  54. package/dist/engine-commands/getEnginesMetaInfo.js +10 -10
  55. package/dist/engine-commands/index.js +50 -51
  56. package/dist/engine-commands/lintSchema.js +8 -8
  57. package/dist/engine-commands/mergeSchemas.js +10 -10
  58. package/dist/engine-commands/queryEngineCommons.js +7 -7
  59. package/dist/engine-commands/relativizePathInPSLError.js +2 -2
  60. package/dist/engine-commands/validate.js +10 -10
  61. package/dist/errorReporting.js +6 -6
  62. package/dist/get-generators/generatorResolvers/generatorResolvers.js +39 -40
  63. package/dist/get-generators/generatorResolvers/prisma-client-js/auto-installation/getPackageCmd.js +3 -3
  64. package/dist/get-generators/generatorResolvers/prisma-client-js/auto-installation/runPackageCmd.js +4 -4
  65. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +39 -40
  66. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkYarnVersion.d.ts +9 -0
  67. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkYarnVersion.js +132 -0
  68. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/isYarnUsed.js +3 -3
  69. package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +40 -41
  70. package/dist/get-generators/getGenerators.js +42 -43
  71. package/dist/get-generators/utils/getBinaryPathsByVersion.js +3 -3
  72. package/dist/getPackedPackage.js +2 -2
  73. package/dist/index.d.ts +0 -1
  74. package/dist/index.js +85 -87
  75. package/dist/{multipart-parser-32AROPTR.js → multipart-parser-LCETWFPE.js} +6 -9
  76. package/dist/resolveBinary.js +7 -7
  77. package/dist/schemaEngineCommands.js +8 -8
  78. package/dist/sendPanic.js +39 -40
  79. package/dist/tracing/types.d.ts +16 -26
  80. package/dist/utils/cloudflareD1.js +3 -3
  81. package/dist/utils/getCommandWithExecutor.js +3 -3
  82. package/dist/utils/getEnvPaths.js +39 -40
  83. package/dist/utils/getGitHubIssueUrl.js +4 -4
  84. package/dist/utils/getVersionFromPackageJson.js +3 -3
  85. package/dist/utils/handleEngineLoadingErrors.js +3 -3
  86. package/dist/utils/handlePanic.js +39 -40
  87. package/dist/utils/isCurrentBinInstalledGlobally.d.ts +1 -1
  88. package/dist/utils/isCurrentBinInstalledGlobally.js +2 -2
  89. package/dist/utils/load.js +4 -4
  90. package/dist/utils/loadEnvFile.js +39 -40
  91. package/dist/utils/tryLoadEnvs.js +5 -5
  92. package/dist/wasm.js +4 -4
  93. package/package.json +12 -12
  94. package/dist/chunk-BONFK27U.js +0 -47
  95. package/dist/chunk-PPCNLYSB.js +0 -47
  96. package/dist/cli/getTypescriptVersion.d.ts +0 -1
  97. package/dist/cli/getTypescriptVersion.js +0 -25
  98. package/dist/typescript-AILDXN3I.js +0 -205230
  99. package/dist/typescript-WN4QH2CP.js +0 -205192
@@ -0,0 +1,166 @@
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_4RWCRJYD_exports = {};
20
+ __export(chunk_4RWCRJYD_exports, {
21
+ SchemaEngineExitCode: () => SchemaEngineExitCode,
22
+ canConnectToDatabase: () => canConnectToDatabase,
23
+ createDatabase: () => createDatabase,
24
+ dropDatabase: () => dropDatabase,
25
+ execaCommand: () => execaCommand
26
+ });
27
+ module.exports = __toCommonJS(chunk_4RWCRJYD_exports);
28
+ var import_chunk_7XNZDY2V = require("./chunk-7XNZDY2V.js");
29
+ var import_chunk_FPHZVRV4 = require("./chunk-FPHZVRV4.js");
30
+ var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
31
+ var import_fetch_engine = require("@prisma/fetch-engine");
32
+ var import_execa = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_7XNZDY2V.require_execa)());
33
+ var SchemaEngineExitCode = /* @__PURE__ */ ((SchemaEngineExitCode2) => {
34
+ SchemaEngineExitCode2[SchemaEngineExitCode2["Success"] = 0] = "Success";
35
+ SchemaEngineExitCode2[SchemaEngineExitCode2["Error"] = 1] = "Error";
36
+ SchemaEngineExitCode2[SchemaEngineExitCode2["Panic"] = 101] = "Panic";
37
+ return SchemaEngineExitCode2;
38
+ })(SchemaEngineExitCode || {});
39
+ function parseJsonFromStderr(stderr) {
40
+ const lines = stderr.split(/\r?\n/).slice(1);
41
+ const logs = [];
42
+ for (const line of lines) {
43
+ const data = String(line);
44
+ try {
45
+ const json = JSON.parse(data);
46
+ logs.push(json);
47
+ } catch (e) {
48
+ throw new Error(`Could not parse schema engine response: ${e}`);
49
+ }
50
+ }
51
+ return logs;
52
+ }
53
+ async function canConnectToDatabase(connectionString, cwd = process.cwd(), schemaEnginePath) {
54
+ if (!connectionString) {
55
+ throw new Error(
56
+ "Connection url is empty. See https://www.prisma.io/docs/reference/database-reference/connection-urls"
57
+ );
58
+ }
59
+ try {
60
+ await execaCommand({
61
+ connectionString,
62
+ cwd,
63
+ schemaEnginePath,
64
+ engineCommandName: "can-connect-to-database"
65
+ });
66
+ } catch (_e) {
67
+ const e = _e;
68
+ if (e.stderr) {
69
+ const logs = parseJsonFromStderr(e.stderr);
70
+ const error = logs.find((it) => it.level === "ERROR" && it.target === "schema_engine::logger");
71
+ if (error && error.fields.error_code && error.fields.message) {
72
+ return {
73
+ code: error.fields.error_code,
74
+ message: error.fields.message
75
+ };
76
+ } else {
77
+ throw new Error(`Schema engine error:
78
+ ${logs.map((log) => log.fields.message).join("\n")}`);
79
+ }
80
+ } else {
81
+ throw new Error(`Schema engine exited. ${_e}`);
82
+ }
83
+ }
84
+ return true;
85
+ }
86
+ async function createDatabase(connectionString, cwd = process.cwd(), schemaEnginePath) {
87
+ const dbExists = await canConnectToDatabase(connectionString, cwd, schemaEnginePath);
88
+ if (dbExists === true) {
89
+ return false;
90
+ }
91
+ try {
92
+ await execaCommand({
93
+ connectionString,
94
+ cwd,
95
+ schemaEnginePath,
96
+ engineCommandName: "create-database"
97
+ });
98
+ return true;
99
+ } catch (_e) {
100
+ const e = _e;
101
+ if (e.stderr) {
102
+ const logs = parseJsonFromStderr(e.stderr);
103
+ const error = logs.find((it) => it.level === "ERROR" && it.target === "schema_engine::logger");
104
+ if (error && error.fields.error_code && error.fields.message) {
105
+ throw new Error(`${error.fields.error_code}: ${error.fields.message}`);
106
+ } else {
107
+ throw new Error(`Schema engine error:
108
+ ${logs.map((log) => log.fields.message).join("\n")}`);
109
+ }
110
+ } else {
111
+ throw new Error(`Schema engine exited. ${_e}`);
112
+ }
113
+ }
114
+ }
115
+ async function dropDatabase(connectionString, cwd = process.cwd(), schemaEnginePath) {
116
+ try {
117
+ const result = await execaCommand({
118
+ connectionString,
119
+ cwd,
120
+ schemaEnginePath,
121
+ engineCommandName: "drop-database"
122
+ });
123
+ if (result && result.exitCode === 0 && result.stderr.includes("The database was successfully dropped")) {
124
+ return true;
125
+ } else {
126
+ throw Error(`An error occurred during the drop: ${JSON.stringify(result, void 0, 2)}`);
127
+ }
128
+ } catch (e) {
129
+ if (e.stderr) {
130
+ const logs = parseJsonFromStderr(e.stderr);
131
+ throw new Error(`Schema engine error:
132
+ ${logs.map((log) => log.fields.message).join("\n")}`);
133
+ } else {
134
+ throw new Error(`Schema engine exited. ${e}`);
135
+ }
136
+ }
137
+ }
138
+ async function execaCommand({
139
+ connectionString,
140
+ cwd,
141
+ schemaEnginePath,
142
+ engineCommandName
143
+ }) {
144
+ schemaEnginePath = schemaEnginePath || await (0, import_chunk_FPHZVRV4.resolveBinary)(import_fetch_engine.BinaryType.SchemaEngineBinary);
145
+ try {
146
+ return await (0, import_execa.default)(schemaEnginePath, ["cli", "--datasource", connectionString, engineCommandName], {
147
+ cwd,
148
+ env: {
149
+ RUST_BACKTRACE: process.env.RUST_BACKTRACE ?? "1",
150
+ RUST_LOG: process.env.RUST_LOG ?? "info"
151
+ }
152
+ });
153
+ } catch (_e) {
154
+ const e = _e;
155
+ if (e.message) {
156
+ e.message = e.message.replace(connectionString, "<REDACTED>");
157
+ }
158
+ if (e.stdout) {
159
+ e.stdout = e.stdout.replace(connectionString, "<REDACTED>");
160
+ }
161
+ if (e.stderr) {
162
+ e.stderr = e.stderr.replace(connectionString, "<REDACTED>");
163
+ }
164
+ throw e;
165
+ }
166
+ }
@@ -26,11 +26,11 @@ 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 chunk_5MCWLJSR_exports = {};
30
- __export(chunk_5MCWLJSR_exports, {
29
+ var chunk_5I4BOTBV_exports = {};
30
+ __export(chunk_5I4BOTBV_exports, {
31
31
  isCurrentBinInstalledGlobally: () => isCurrentBinInstalledGlobally
32
32
  });
33
- module.exports = __toCommonJS(chunk_5MCWLJSR_exports);
33
+ module.exports = __toCommonJS(chunk_5I4BOTBV_exports);
34
34
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
35
35
  var import_fs = __toESM(require("fs"));
36
36
  var require_ini = (0, import_chunk_WWAWV7DQ.__commonJS)({
@@ -286,10 +286,16 @@ var import_global_dirs = (0, import_chunk_WWAWV7DQ.__toESM)(require_global_dirs(
286
286
  function isCurrentBinInstalledGlobally() {
287
287
  try {
288
288
  const realPrismaPath = import_fs.default.realpathSync(process.argv[1]);
289
+ const usingGlobalYarn = realPrismaPath.indexOf(import_global_dirs.default.yarn.packages) === 0;
289
290
  const usingGlobalNpm = realPrismaPath.indexOf(import_fs.default.realpathSync(import_global_dirs.default.npm.packages)) === 0;
290
291
  if (usingGlobalNpm) {
291
292
  return "npm";
292
293
  }
294
+ if (usingGlobalYarn) {
295
+ return "yarn";
296
+ } else {
297
+ false;
298
+ }
293
299
  } catch (e) {
294
300
  }
295
301
  return false;
@@ -16,21 +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 chunk_ZZLZJFQD_exports = {};
20
- __export(chunk_ZZLZJFQD_exports, {
19
+ var chunk_5R7AZFMV_exports = {};
20
+ __export(chunk_5R7AZFMV_exports, {
21
21
  getLintWarnings: () => getLintWarnings,
22
22
  getLintWarningsAsText: () => getLintWarningsAsText,
23
23
  handleLintPanic: () => handleLintPanic,
24
24
  lintSchema: () => lintSchema,
25
25
  warningToString: () => warningToString
26
26
  });
27
- module.exports = __toCommonJS(chunk_ZZLZJFQD_exports);
27
+ module.exports = __toCommonJS(chunk_5R7AZFMV_exports);
28
28
  var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
29
- var import_chunk_4B7QW7H5 = require("./chunk-4B7QW7H5.js");
29
+ var import_chunk_2WJPHJ2I = require("./chunk-2WJPHJ2I.js");
30
30
  var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
31
31
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
32
32
  function lintSchema({ schemas }) {
33
- const lintResult = import_chunk_4B7QW7H5.prismaSchemaWasm.lint(JSON.stringify(schemas));
33
+ const lintResult = import_chunk_2WJPHJ2I.prismaSchemaWasm.lint(JSON.stringify(schemas));
34
34
  const lintDiagnostics = JSON.parse(lintResult);
35
35
  return lintDiagnostics;
36
36
  }
@@ -26,22 +26,22 @@ 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 chunk_6QXYYIUQ_exports = {};
30
- __export(chunk_6QXYYIUQ_exports, {
29
+ var chunk_5UJZARUY_exports = {};
30
+ __export(chunk_5UJZARUY_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(chunk_6QXYYIUQ_exports);
37
+ module.exports = __toCommonJS(chunk_5UJZARUY_exports);
38
38
  var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
39
- var import_chunk_CXEMRKV4 = require("./chunk-CXEMRKV4.js");
40
- var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
41
- var import_chunk_T6NCATRB = require("./chunk-T6NCATRB.js");
39
+ var import_chunk_IAEMHQAC = require("./chunk-IAEMHQAC.js");
40
+ var import_chunk_WMIBAVWZ = require("./chunk-WMIBAVWZ.js");
41
+ var import_chunk_KNNIRRTO = require("./chunk-KNNIRRTO.js");
42
42
  var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
43
- var import_chunk_25RJ7YTB = require("./chunk-25RJ7YTB.js");
44
- var import_chunk_EAUIEZK2 = require("./chunk-EAUIEZK2.js");
43
+ var import_chunk_H3T4L34H = require("./chunk-H3T4L34H.js");
44
+ var import_chunk_2WJPHJ2I = require("./chunk-2WJPHJ2I.js");
45
45
  var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
46
46
  var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
47
47
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
@@ -53,7 +53,7 @@ var debug = (0, import_debug.default)("prisma:getConfig");
53
53
  var SCHEMA_VALIDATION_ERROR_CODE = "P1012";
54
54
  var GetConfigError = class extends Error {
55
55
  constructor(params) {
56
- const constructedErrorMessage = (0, import_chunk_25RJ7YTB.z)(params).with({ _tag: "parsed" }, ({ errorCode, message, reason }) => {
56
+ const constructedErrorMessage = (0, import_chunk_H3T4L34H.$)(params).with({ _tag: "parsed" }, ({ errorCode, message, reason }) => {
57
57
  const errorCodeMessage = errorCode ? `Error code: ${errorCode}` : "";
58
58
  return `${reason}
59
59
  ${errorCodeMessage}
@@ -65,7 +65,7 @@ ${detailsHeader} ${message}`;
65
65
  }).exhaustive();
66
66
  const errorMessageWithContext = `${constructedErrorMessage}
67
67
  [Context: getConfig]`;
68
- super((0, import_chunk_T6NCATRB.addVersionDetailsToErrorMessage)(errorMessageWithContext));
68
+ super((0, import_chunk_KNNIRRTO.addVersionDetailsToErrorMessage)(errorMessageWithContext));
69
69
  this.name = "GetConfigError";
70
70
  }
71
71
  };
@@ -83,14 +83,14 @@ function resolveUrl(envValue) {
83
83
  return urlFromValue ?? urlEnvVarValue;
84
84
  }
85
85
  async function getConfig(options) {
86
- const debugErrorType = (0, import_chunk_CXEMRKV4.createDebugErrorType)(debug, "getConfigWasm");
86
+ const debugErrorType = (0, import_chunk_IAEMHQAC.createDebugErrorType)(debug, "getConfigWasm");
87
87
  debug(`Using getConfig Wasm`);
88
88
  const configEither = (0, import_function.pipe)(
89
89
  (0, import_chunk_7MD6344A.tryCatch)(
90
90
  () => {
91
91
  if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_CONFIG) {
92
92
  debug("Triggering a Rust panic...");
93
- import_chunk_EAUIEZK2.prismaSchemaWasm.debug_panic();
93
+ import_chunk_2WJPHJ2I.prismaSchemaWasm.debug_panic();
94
94
  }
95
95
  const params = JSON.stringify({
96
96
  prismaSchema: options.datamodel,
@@ -98,7 +98,7 @@ async function getConfig(options) {
98
98
  ignoreEnvVarErrors: options.ignoreEnvVarErrors ?? false,
99
99
  env: process.env
100
100
  });
101
- const data = import_chunk_EAUIEZK2.prismaSchemaWasm.get_config(params);
101
+ const data = import_chunk_2WJPHJ2I.prismaSchemaWasm.get_config(params);
102
102
  return data;
103
103
  },
104
104
  (e) => ({
@@ -140,7 +140,7 @@ async function getConfig(options) {
140
140
  }
141
141
  return Promise.resolve(data);
142
142
  }
143
- const error = (0, import_chunk_25RJ7YTB.z)(configEither.left).with({ type: "wasm-error" }, (e) => {
143
+ const error = (0, import_chunk_H3T4L34H.$)(configEither.left).with({ type: "wasm-error" }, (e) => {
144
144
  debugErrorType(e);
145
145
  if ((0, import_chunk_A4QWQE3W.isWasmPanic)(e.error)) {
146
146
  const { message, stack } = (0, import_chunk_A4QWQE3W.getWasmError)(e.error);
@@ -160,12 +160,12 @@ async function getConfig(options) {
160
160
  return panic;
161
161
  }
162
162
  const errorOutput = e.error.message;
163
- return new GetConfigError((0, import_chunk_CXEMRKV4.parseQueryEngineError)({ errorOutput, reason: e.reason }));
163
+ return new GetConfigError((0, import_chunk_IAEMHQAC.parseQueryEngineError)({ errorOutput, reason: e.reason }));
164
164
  }).with({ type: "validation-error" }, (e) => {
165
165
  return new GetConfigError({
166
166
  _tag: "parsed",
167
167
  errorCode: SCHEMA_VALIDATION_ERROR_CODE,
168
- reason: (0, import_chunk_CXEMRKV4.createSchemaValidationError)(e.reason),
168
+ reason: (0, import_chunk_IAEMHQAC.createSchemaValidationError)(e.reason),
169
169
  message: formatErrors(e.error)
170
170
  });
171
171
  }).otherwise((e) => {
@@ -195,7 +195,7 @@ async function resolveBinaryTargets(generator) {
195
195
  }
196
196
  }
197
197
  function formatErrors(errors) {
198
- const formattedErrors = errors.map((e) => (0, import_chunk_C47SCASR.relativizePathInPSLError)(e.message)).join("\n\n");
198
+ const formattedErrors = errors.map((e) => (0, import_chunk_WMIBAVWZ.relativizePathInPSLError)(e.message)).join("\n\n");
199
199
  const errorCount = `Validation Error Count: ${errors.length}`;
200
200
  return `${formattedErrors}
201
201
  ${errorCount}`;
@@ -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 chunk_D6NVMO5B_exports = {};
20
- __export(chunk_D6NVMO5B_exports, {
19
+ var chunk_67KWF6KB_exports = {};
20
+ __export(chunk_67KWF6KB_exports, {
21
21
  addVersionDetailsToErrorMessage: () => addVersionDetailsToErrorMessage
22
22
  });
23
- module.exports = __toCommonJS(chunk_D6NVMO5B_exports);
24
- var import_chunk_PC7HPZQJ = require("./chunk-PC7HPZQJ.js");
23
+ module.exports = __toCommonJS(chunk_67KWF6KB_exports);
24
+ var import_chunk_KPVPQQGU = require("./chunk-KPVPQQGU.js");
25
25
  var import_chunk_QN6PSQY7 = require("./chunk-QN6PSQY7.js");
26
26
  function addVersionDetailsToErrorMessage(message) {
27
- const rows = [["Prisma CLI Version", import_chunk_PC7HPZQJ.version]];
27
+ const rows = [["Prisma CLI Version", import_chunk_KPVPQQGU.version]];
28
28
  return `${message}
29
29
 
30
30
  ${(0, import_chunk_QN6PSQY7.formatTable)(rows)}`;
@@ -16,21 +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 chunk_OA3Y3SYB_exports = {};
20
- __export(chunk_OA3Y3SYB_exports, {
19
+ var chunk_B44XJG7K_exports = {};
20
+ __export(chunk_B44XJG7K_exports, {
21
21
  getLintWarnings: () => getLintWarnings,
22
22
  getLintWarningsAsText: () => getLintWarningsAsText,
23
23
  handleLintPanic: () => handleLintPanic,
24
24
  lintSchema: () => lintSchema,
25
25
  warningToString: () => warningToString
26
26
  });
27
- module.exports = __toCommonJS(chunk_OA3Y3SYB_exports);
27
+ module.exports = __toCommonJS(chunk_B44XJG7K_exports);
28
28
  var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
29
- var import_chunk_EAUIEZK2 = require("./chunk-EAUIEZK2.js");
29
+ var import_chunk_MUJIYA44 = require("./chunk-MUJIYA44.js");
30
30
  var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
31
31
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
32
32
  function lintSchema({ schemas }) {
33
- const lintResult = import_chunk_EAUIEZK2.prismaSchemaWasm.lint(JSON.stringify(schemas));
33
+ const lintResult = import_chunk_MUJIYA44.prismaSchemaWasm.lint(JSON.stringify(schemas));
34
34
  const lintDiagnostics = JSON.parse(lintResult);
35
35
  return lintDiagnostics;
36
36
  }
@@ -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 chunk_6HMDWGVB_exports = {};
20
- __export(chunk_6HMDWGVB_exports, {
19
+ var chunk_CKVVVLEH_exports = {};
20
+ __export(chunk_CKVVVLEH_exports, {
21
21
  require_package: () => require_package
22
22
  });
23
- module.exports = __toCommonJS(chunk_6HMDWGVB_exports);
23
+ module.exports = __toCommonJS(chunk_CKVVVLEH_exports);
24
24
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
25
25
  var require_package = (0, import_chunk_WWAWV7DQ.__commonJS)({
26
26
  "package.json"(exports, module2) {
@@ -57,16 +57,16 @@ var require_package = (0, import_chunk_WWAWV7DQ.__commonJS)({
57
57
  "@babel/helper-validator-identifier": "7.24.7",
58
58
  "@opentelemetry/api": "1.9.0",
59
59
  "@swc/core": "1.2.204",
60
- "@swc/jest": "0.2.37",
60
+ "@swc/jest": "0.2.36",
61
61
  "@types/babel__helper-validator-identifier": "7.15.2",
62
- "@types/jest": "29.5.14",
62
+ "@types/jest": "29.5.12",
63
63
  "@types/node": "18.19.31",
64
64
  "@types/resolve": "1.20.6",
65
65
  archiver: "6.0.2",
66
66
  "checkpoint-client": "1.1.33",
67
67
  "cli-truncate": "2.1.0",
68
- dotenv: "16.4.7",
69
- esbuild: "0.24.0",
68
+ dotenv: "16.0.3",
69
+ esbuild: "0.23.0",
70
70
  "escape-string-regexp": "4.0.0",
71
71
  execa: "5.1.1",
72
72
  "fast-glob": "3.3.2",
@@ -100,7 +100,7 @@ var require_package = (0, import_chunk_WWAWV7DQ.__commonJS)({
100
100
  "terminal-link": "2.1.1",
101
101
  tmp: "0.2.3",
102
102
  "ts-node": "10.9.2",
103
- "ts-pattern": "5.6.0",
103
+ "ts-pattern": "5.2.0",
104
104
  "ts-toolbelt": "9.6.0",
105
105
  typescript: "5.4.5",
106
106
  yarn: "1.22.22"
@@ -26,18 +26,18 @@ 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 chunk_MPJLR4LI_exports = {};
30
- __export(chunk_MPJLR4LI_exports, {
29
+ var chunk_COFXY6NH_exports = {};
30
+ __export(chunk_COFXY6NH_exports, {
31
31
  GetDmmfError: () => GetDmmfError,
32
32
  getDMMF: () => getDMMF
33
33
  });
34
- module.exports = __toCommonJS(chunk_MPJLR4LI_exports);
34
+ module.exports = __toCommonJS(chunk_COFXY6NH_exports);
35
35
  var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
36
- var import_chunk_CXEMRKV4 = require("./chunk-CXEMRKV4.js");
37
- var import_chunk_D6NVMO5B = require("./chunk-D6NVMO5B.js");
36
+ var import_chunk_IAEMHQAC = require("./chunk-IAEMHQAC.js");
37
+ var import_chunk_KNNIRRTO = require("./chunk-KNNIRRTO.js");
38
38
  var import_chunk_PFLLVWZX = require("./chunk-PFLLVWZX.js");
39
- var import_chunk_25RJ7YTB = require("./chunk-25RJ7YTB.js");
40
- var import_chunk_4B7QW7H5 = require("./chunk-4B7QW7H5.js");
39
+ var import_chunk_H3T4L34H = require("./chunk-H3T4L34H.js");
40
+ var import_chunk_2WJPHJ2I = require("./chunk-2WJPHJ2I.js");
41
41
  var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
42
42
  var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
43
43
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
@@ -48,7 +48,7 @@ var import_function = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_PFLLVW
48
48
  var debug = (0, import_debug.default)("prisma:getDMMF");
49
49
  var GetDmmfError = class extends Error {
50
50
  constructor(params) {
51
- const constructedErrorMessage = (0, import_chunk_25RJ7YTB.z)(params).with({ _tag: "parsed" }, ({ errorCode, message, reason }) => {
51
+ const constructedErrorMessage = (0, import_chunk_H3T4L34H.$)(params).with({ _tag: "parsed" }, ({ errorCode, message, reason }) => {
52
52
  const errorCodeMessage = errorCode ? `Error code: ${errorCode}` : "";
53
53
  return `${reason}
54
54
  ${errorCodeMessage}
@@ -60,12 +60,13 @@ ${detailsHeader} ${message}`;
60
60
  }).exhaustive();
61
61
  const errorMessageWithContext = `${constructedErrorMessage}
62
62
  [Context: getDmmf]`;
63
- super((0, import_chunk_D6NVMO5B.addVersionDetailsToErrorMessage)(errorMessageWithContext));
63
+ super((0, import_chunk_KNNIRRTO.addVersionDetailsToErrorMessage)(errorMessageWithContext));
64
64
  this.name = "GetDmmfError";
65
65
  }
66
66
  };
67
67
  async function getDMMF(options) {
68
- const debugErrorType = (0, import_chunk_CXEMRKV4.createDebugErrorType)(debug, "getDmmfWasm");
68
+ warnOnDeprecatedFeatureFlag(options.previewFeatures);
69
+ const debugErrorType = (0, import_chunk_IAEMHQAC.createDebugErrorType)(debug, "getDmmfWasm");
69
70
  debug(`Using getDmmf Wasm`);
70
71
  const dmmfPipeline = (0, import_function.pipe)(
71
72
  (0, import_chunk_7MD6344A.tryCatch2)(
@@ -90,13 +91,13 @@ async function getDMMF(options) {
90
91
  () => {
91
92
  if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
92
93
  debug("Triggering a Rust panic...");
93
- import_chunk_4B7QW7H5.prismaSchemaWasm.debug_panic();
94
+ import_chunk_2WJPHJ2I.prismaSchemaWasm.debug_panic();
94
95
  }
95
96
  const params = JSON.stringify({
96
97
  prismaSchema: datamodel,
97
98
  noColor: Boolean(process.env.NO_COLOR)
98
99
  });
99
- const data = import_chunk_4B7QW7H5.prismaSchemaWasm.get_dmmf(params);
100
+ const data = import_chunk_2WJPHJ2I.prismaSchemaWasm.get_dmmf(params);
100
101
  return data;
101
102
  },
102
103
  (e) => ({
@@ -129,7 +130,7 @@ async function getDMMF(options) {
129
130
  const { right: data } = dmmfEither;
130
131
  return Promise.resolve(data);
131
132
  }
132
- const error = (0, import_chunk_25RJ7YTB.z)(dmmfEither.left).with({ type: "read-datamodel-path" }, (e) => {
133
+ const error = (0, import_chunk_H3T4L34H.$)(dmmfEither.left).with({ type: "read-datamodel-path" }, (e) => {
133
134
  debugErrorType(e);
134
135
  return new GetDmmfError({
135
136
  _tag: "unparsed",
@@ -157,10 +158,36 @@ Datamodel path: "${e.datamodelPath}"`,
157
158
  return panic;
158
159
  }
159
160
  const errorOutput = e.error.message;
160
- return new GetDmmfError((0, import_chunk_CXEMRKV4.parseQueryEngineError)({ errorOutput, reason: e.reason }));
161
+ return new GetDmmfError((0, import_chunk_IAEMHQAC.parseQueryEngineError)({ errorOutput, reason: e.reason }));
161
162
  }).with({ type: "parse-json" }, (e) => {
162
163
  debugErrorType(e);
163
164
  return new GetDmmfError({ _tag: "unparsed", message: e.error.message, reason: e.reason });
164
165
  }).exhaustive();
165
166
  throw error;
166
167
  }
168
+ function warnOnDeprecatedFeatureFlag(previewFeatures) {
169
+ const getMessage = (flag) => `${(0, import_chunk_PG5FDKSF.blue)((0, import_chunk_PG5FDKSF.bold)("info"))} The preview flag "${flag}" is not needed anymore, please remove it from your schema.prisma`;
170
+ const removedFeatureFlagMap = {
171
+ insensitiveFilters: getMessage("insensitiveFilters"),
172
+ atomicNumberOperations: getMessage("atomicNumberOperations"),
173
+ connectOrCreate: getMessage("connectOrCreate"),
174
+ transaction: getMessage("transaction"),
175
+ nApi: getMessage("nApi"),
176
+ transactionApi: getMessage("transactionApi"),
177
+ uncheckedScalarInputs: getMessage("uncheckedScalarInputs"),
178
+ nativeTypes: getMessage("nativeTypes"),
179
+ createMany: getMessage("createMany"),
180
+ groupBy: getMessage("groupBy"),
181
+ referentialActions: getMessage("referentialActions"),
182
+ microsoftSqlServer: getMessage("microsoftSqlServer"),
183
+ selectRelationCount: getMessage("selectRelationCount"),
184
+ orderByRelation: getMessage("orderByRelation"),
185
+ orderByAggregateGroup: getMessage("orderByAggregateGroup")
186
+ };
187
+ previewFeatures?.forEach((f) => {
188
+ const removedMessage = removedFeatureFlagMap[f];
189
+ if (removedMessage && !process.env.PRISMA_HIDE_PREVIEW_FLAG_WARNINGS) {
190
+ console.warn(removedMessage);
191
+ }
192
+ });
193
+ }
@@ -0,0 +1,122 @@
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 __toESM2 = (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_D4MCOTL5_exports = {};
30
+ __export(chunk_D4MCOTL5_exports, {
31
+ getBinaryPathsByVersion: () => getBinaryPathsByVersion
32
+ });
33
+ module.exports = __toCommonJS(chunk_D4MCOTL5_exports);
34
+ var import_chunk_RS2R7COT = require("./chunk-RS2R7COT.js");
35
+ var import_chunk_4CGPN5SR = require("./chunk-4CGPN5SR.js");
36
+ var import_chunk_2SDPW6AX = require("./chunk-2SDPW6AX.js");
37
+ var import_chunk_7B5PXS6N = require("./chunk-7B5PXS6N.js");
38
+ var import_chunk_RQPDQSHK = require("./chunk-RQPDQSHK.js");
39
+ var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
40
+ var import_engines = require("@prisma/engines");
41
+ var import_fetch_engine = require("@prisma/fetch-engine");
42
+ var import_path = __toESM2(require("path"));
43
+ var import_fs_extra = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_RQPDQSHK.require_lib)());
44
+ async function getBinaryPathsByVersion({
45
+ neededVersions,
46
+ binaryTarget,
47
+ version,
48
+ printDownloadProgress,
49
+ skipDownload,
50
+ binaryPathsOverride
51
+ }) {
52
+ const binaryPathsByVersion = /* @__PURE__ */ Object.create(null);
53
+ for (const currentVersion in neededVersions) {
54
+ binaryPathsByVersion[currentVersion] = {};
55
+ const neededVersion = neededVersions[currentVersion];
56
+ if (neededVersion.binaryTargets.length === 0) {
57
+ neededVersion.binaryTargets = [{ fromEnvVar: null, value: binaryTarget }];
58
+ }
59
+ if (process.env.NETLIFY) {
60
+ const isNodeMajor20OrUp = parseInt(process.versions.node.split(".")[0]) >= 20;
61
+ const awsRuntimeVersion = (0, import_chunk_2SDPW6AX.parseAWSNodejsRuntimeEnvVarVersion)();
62
+ const isRuntimeEnvVar20OrUp = awsRuntimeVersion && awsRuntimeVersion >= 20;
63
+ const isRuntimeEnvVar18OrDown = awsRuntimeVersion && awsRuntimeVersion <= 18;
64
+ const isRhelBinaryTarget1xInNeededVersions = neededVersion.binaryTargets.find(
65
+ (object) => object.value === "rhel-openssl-1.0.x"
66
+ );
67
+ const isRhelBinaryTarget3xInNeededVersions = neededVersion.binaryTargets.find(
68
+ (object) => object.value === "rhel-openssl-3.0.x"
69
+ );
70
+ if (!isRhelBinaryTarget3xInNeededVersions && (isNodeMajor20OrUp || isRuntimeEnvVar20OrUp) && !isRuntimeEnvVar18OrDown) {
71
+ neededVersion.binaryTargets.push({
72
+ fromEnvVar: null,
73
+ value: "rhel-openssl-3.0.x"
74
+ });
75
+ } else if (!isRhelBinaryTarget1xInNeededVersions) {
76
+ neededVersion.binaryTargets.push({
77
+ fromEnvVar: null,
78
+ value: "rhel-openssl-1.0.x"
79
+ });
80
+ }
81
+ }
82
+ let binaryTargetBaseDir = eval(`require('path').join(__dirname, '..')`);
83
+ if (version !== currentVersion) {
84
+ binaryTargetBaseDir = import_path.default.join(binaryTargetBaseDir, `./engines/${currentVersion}/`);
85
+ await (0, import_fs_extra.ensureDir)(binaryTargetBaseDir).catch((e) => console.error(e));
86
+ }
87
+ const binariesConfig = neededVersion.engines.reduce((acc, curr) => {
88
+ if (!binaryPathsOverride?.[curr]) {
89
+ acc[(0, import_chunk_4CGPN5SR.engineTypeToBinaryType)(curr)] = binaryTargetBaseDir;
90
+ }
91
+ return acc;
92
+ }, /* @__PURE__ */ Object.create(null));
93
+ if (Object.values(binariesConfig).length > 0) {
94
+ const binaryTargets = neededVersion.binaryTargets.map(
95
+ (binaryTarget2) => binaryTarget2.value
96
+ );
97
+ const downloadParams = {
98
+ binaries: binariesConfig,
99
+ binaryTargets,
100
+ showProgress: typeof printDownloadProgress === "boolean" ? printDownloadProgress : true,
101
+ version: currentVersion && currentVersion !== "latest" ? currentVersion : import_engines.enginesVersion,
102
+ skipDownload
103
+ };
104
+ const binaryPathsWithEngineType = await (0, import_fetch_engine.download)(downloadParams);
105
+ const binaryPaths = (0, import_chunk_7B5PXS6N.mapKeys)(binaryPathsWithEngineType, import_chunk_RS2R7COT.binaryTypeToEngineType);
106
+ binaryPathsByVersion[currentVersion] = binaryPaths;
107
+ }
108
+ if (binaryPathsOverride) {
109
+ const overrideEngines = Object.keys(binaryPathsOverride);
110
+ const enginesCoveredByOverride = neededVersion.engines.filter((engine) => overrideEngines.includes(engine));
111
+ if (enginesCoveredByOverride.length > 0) {
112
+ for (const engine of enginesCoveredByOverride) {
113
+ const enginePath = binaryPathsOverride[engine];
114
+ binaryPathsByVersion[currentVersion][engine] = {
115
+ [binaryTarget]: enginePath
116
+ };
117
+ }
118
+ }
119
+ }
120
+ }
121
+ return binaryPathsByVersion;
122
+ }