@prisma/internals 7.2.0 → 7.3.0-integration-fix-6-19-0-cloudflare-accelerate-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.
Files changed (137) hide show
  1. package/dist/{chunk-QMSPMDFJ.js → chunk-262R2PBW.js} +5 -5
  2. package/dist/chunk-3FP46GUV.js +471 -0
  3. package/dist/chunk-46ABODUM.js +186 -0
  4. package/dist/{chunk-GJSFP4V4.js → chunk-4CGPN5SR.js} +9 -3
  5. package/dist/{chunk-KAH2NIWC.js → chunk-4JCVHBYR.js} +6 -6
  6. package/dist/{chunk-EIO44IYO.js → chunk-55ZV2II2.js} +38 -16
  7. package/dist/{chunk-AADMLOWX.js → chunk-5ETP2F4G.js} +5 -5
  8. package/dist/{chunk-UWK6LIYC.js → chunk-5PEHPZHO.js} +11 -11
  9. package/dist/{chunk-T6BPU44Y.js → chunk-656EKQL7.js} +5 -5
  10. package/dist/{chunk-MW6NA5W7.js → chunk-65XSDXPY.js} +13 -13
  11. package/dist/chunk-6TTRTZXU.js +37 -0
  12. package/dist/{chunk-Q5XW7CMJ.js → chunk-75BIJ5PX.js} +9 -9
  13. package/dist/{chunk-DXWYZA7B.js → chunk-7QC5VORA.js} +4 -3
  14. package/dist/{chunk-AQOVQMBO.js → chunk-7QKLIARO.js} +10 -8
  15. package/dist/{chunk-CQVWHHIJ.js → chunk-AX5N26KG.js} +6 -11
  16. package/dist/{chunk-NBWRGVYR.js → chunk-BCQZ6JQE.js} +6 -4
  17. package/dist/{chunk-BXIKQUP5.js → chunk-BVJP43JS.js} +7 -7
  18. package/dist/chunk-D4VDA2TZ.js +66 -0
  19. package/dist/{chunk-G6VGFCRW.js → chunk-D6JNJJI7.js} +146 -58
  20. package/dist/chunk-DZYINYAA.js +68 -0
  21. package/dist/{chunk-C6MDA273.js → chunk-E2QTLJH5.js} +13 -13
  22. package/dist/chunk-ERSH2BQA.js +58 -0
  23. package/dist/{chunk-2BXDHSSY.js → chunk-EYVG6XQS.js} +68 -56
  24. package/dist/{chunk-GH2WAX5Y.js → chunk-F2OZV76L.js} +7 -7
  25. package/dist/{chunk-R3J2O23S.js → chunk-FCYHZHVW.js} +4 -4
  26. package/dist/{chunk-DQWKFZPY.js → chunk-FYZCPL2Z.js} +7 -4
  27. package/dist/{chunk-2GPDFPDR.js → chunk-GMW36QQF.js} +7 -7
  28. package/dist/{chunk-OVTE2A4Y.js → chunk-H43XC5ET.js} +5 -5
  29. package/dist/{chunk-YXCPS3WU.js → chunk-HFFWZTVM.js} +15 -5
  30. package/dist/chunk-HO5HRHFZ.js +30 -0
  31. package/dist/chunk-HW5RCZSE.js +1 -0
  32. package/dist/{chunk-YV4IFLW4.js → chunk-JOIIWB3U.js} +129 -128
  33. package/dist/chunk-KDHESRKE.js +49 -0
  34. package/dist/{chunk-KJKLC73N.js → chunk-KH7FI42S.js} +11 -11
  35. package/dist/chunk-L6KOIJJ5.js +125 -0
  36. package/dist/{chunk-3U4QB2G3.js → chunk-LYFOJ5NK.js} +6 -4
  37. package/dist/{chunk-Q75TMXCR.js → chunk-OAT7ZJED.js} +20 -7
  38. package/dist/{chunk-GCMOJALQ.js → chunk-OPLMJ5WZ.js} +146 -58
  39. package/dist/{chunk-SP2ETLT2.js → chunk-OSHZ4P3G.js} +5 -5
  40. package/dist/{chunk-6JD4VENT.js → chunk-OWUYXGDF.js} +12 -12
  41. package/dist/chunk-PZMRR772.js +41 -0
  42. package/dist/{chunk-HFLFMWOT.js → chunk-QDT7TGYZ.js} +5 -5
  43. package/dist/{chunk-QRW4PODC.js → chunk-QLOP3Z4E.js} +38 -16
  44. package/dist/{chunk-HNOCAIKC.js → chunk-QPQF4VGD.js} +12 -12
  45. package/dist/chunk-RFB2U4GQ.js +41 -0
  46. package/dist/{chunk-5I4ERIIY.js → chunk-RS2R7COT.js} +9 -3
  47. package/dist/chunk-T2PM5TKT.js +55 -0
  48. package/dist/{chunk-G7GV3UAA.js → chunk-THADADEM.js} +9 -7
  49. package/dist/{chunk-5BRXEOYH.js → chunk-TQFONRJP.js} +5 -5
  50. package/dist/{chunk-WSZXPLJQ.js → chunk-TZJROXB3.js} +4 -4
  51. package/dist/{chunk-YJVCIN4F.js → chunk-UHI6VYFX.js} +14 -16
  52. package/dist/{chunk-NYNXYKR4.js → chunk-UQUWZJVN.js} +7 -7
  53. package/dist/{chunk-P3FYX4Y7.js → chunk-W6J5YFD2.js} +5 -5
  54. package/dist/{chunk-J3JTMPWZ.js → chunk-WDPDHAFW.js} +5 -5
  55. package/dist/{chunk-ARC7TW3L.js → chunk-WFNB7VRA.js} +14 -4
  56. package/dist/{chunk-P47PM3SY.js → chunk-WKP2TVYB.js} +5 -5
  57. package/dist/cli/checkUnsupportedDataProxy.d.ts +9 -7
  58. package/dist/cli/checkUnsupportedDataProxy.js +65 -53
  59. package/dist/cli/checkUnsupportedSchemaEngineWasm.d.ts +22 -0
  60. package/dist/cli/checkUnsupportedSchemaEngineWasm.js +135 -0
  61. package/dist/cli/directoryConfig.d.ts +2 -5
  62. package/dist/cli/directoryConfig.js +2 -2
  63. package/dist/cli/getGeneratorSuccessMessage.js +3 -2
  64. package/dist/cli/getSchema.d.ts +20 -28
  65. package/dist/cli/getSchema.js +5 -7
  66. package/dist/cli/hashes.d.ts +1 -2
  67. package/dist/cli/hashes.js +4 -4
  68. package/dist/cli/schemaContext.d.ts +22 -5
  69. package/dist/cli/schemaContext.js +65 -54
  70. package/dist/cli/types.d.ts +1 -1
  71. package/dist/client/getClientEngineType.d.ts +7 -0
  72. package/dist/client/getClientEngineType.js +26 -0
  73. package/dist/convertCredentials.js +4 -4
  74. package/dist/dotenvExpand.d.ts +35 -0
  75. package/dist/dotenvExpand.js +25 -0
  76. package/dist/engine-commands/errorHelpers.js +4 -4
  77. package/dist/engine-commands/formatSchema.js +64 -52
  78. package/dist/engine-commands/getConfig.d.ts +5 -1
  79. package/dist/engine-commands/getConfig.js +13 -10
  80. package/dist/engine-commands/getDmmf.js +10 -10
  81. package/dist/engine-commands/getEngineVersion.js +9 -5
  82. package/dist/engine-commands/getEnginesInfo.d.ts +1 -0
  83. package/dist/engine-commands/getEnginesInfo.js +9 -6
  84. package/dist/engine-commands/index.d.ts +1 -1
  85. package/dist/engine-commands/index.js +76 -62
  86. package/dist/engine-commands/lintSchema.js +9 -9
  87. package/dist/engine-commands/mergeSchemas.js +10 -10
  88. package/dist/engine-commands/queryEngineCommons.js +6 -6
  89. package/dist/engine-commands/validate.js +10 -10
  90. package/dist/get-generators/getGenerators.d.ts +2 -0
  91. package/dist/get-generators/getGenerators.js +67 -55
  92. package/dist/get-generators/utils/binaryTypeToEngineType.js +2 -2
  93. package/dist/get-generators/utils/engineTypeToBinaryType.js +2 -2
  94. package/dist/get-generators/utils/getBinaryPathsByVersion.js +4 -4
  95. package/dist/getPackedPackage.js +3 -3
  96. package/dist/index.d.ts +19 -5
  97. package/dist/index.js +125 -99
  98. package/dist/resolveBinary.js +7 -7
  99. package/dist/schemaEngineCommands.js +8 -8
  100. package/dist/sendPanic.js +3 -2
  101. package/dist/tracing/types.d.ts +54 -0
  102. package/dist/tracing/types.js +2 -0
  103. package/dist/types.d.ts +0 -15
  104. package/dist/utils/__tests__/maskSchema.test.js +23 -0
  105. package/dist/utils/byline.d.ts +4 -0
  106. package/dist/utils/byline.js +28 -0
  107. package/dist/utils/canPrompt.js +3 -3
  108. package/dist/utils/cloudflareD1.d.ts +5 -0
  109. package/dist/utils/cloudflareD1.js +27 -0
  110. package/dist/utils/fs-functional.js +10 -10
  111. package/dist/utils/fs-utils.js +8 -8
  112. package/dist/utils/getEnvPaths.d.ts +14 -0
  113. package/dist/utils/{validatePrismaConfigWithDatasource.js → getEnvPaths.js} +8 -7
  114. package/dist/utils/getMigrateConfigDir.d.ts +2 -0
  115. package/dist/utils/getMigrateConfigDir.js +25 -0
  116. package/dist/utils/getVersionFromPackageJson.js +3 -3
  117. package/dist/utils/handleEngineLoadingErrors.d.ts +8 -0
  118. package/dist/utils/handleEngineLoadingErrors.js +27 -0
  119. package/dist/utils/handlePanic.js +7 -6
  120. package/dist/utils/load.d.ts +6 -0
  121. package/dist/utils/load.js +28 -0
  122. package/dist/utils/loadEnvFile.d.ts +10 -0
  123. package/dist/utils/loadEnvFile.js +30 -0
  124. package/dist/utils/maskSchema.d.ts +4 -0
  125. package/dist/utils/maskSchema.js +27 -0
  126. package/dist/utils/missingDatasource.js +2 -2
  127. package/dist/utils/missingGeneratorMessage.js +4 -4
  128. package/dist/utils/serializeQueryEngineName.d.ts +4 -0
  129. package/dist/utils/serializeQueryEngineName.js +25 -0
  130. package/dist/utils/toSchemasContainer.d.ts +1 -1
  131. package/dist/utils/toSchemasContainer.js +3 -3
  132. package/dist/utils/tryLoadEnvs.d.ts +25 -0
  133. package/dist/utils/tryLoadEnvs.js +30 -0
  134. package/dist/wasm.js +5 -5
  135. package/package.json +17 -15
  136. package/dist/chunk-QKQKSUQO.js +0 -46
  137. package/dist/utils/validatePrismaConfigWithDatasource.d.ts +0 -17
@@ -26,58 +26,83 @@ 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_GCMOJALQ_exports = {};
30
- __export(chunk_GCMOJALQ_exports, {
29
+ var chunk_OPLMJ5WZ_exports = {};
30
+ __export(chunk_OPLMJ5WZ_exports, {
31
31
  checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
32
+ checkUnsupportedSchemaEngineWasm: () => checkUnsupportedSchemaEngineWasm,
33
+ forbiddenCmdFlagWithSchemaEngineWasm: () => forbiddenCmdFlagWithSchemaEngineWasm,
32
34
  forbiddenCmdWithDataProxyFlagMessage: () => forbiddenCmdWithDataProxyFlagMessage,
33
35
  formatSchema: () => formatSchema,
34
36
  getBinaryTargetForCurrentPlatform: () => import_get_platform2.getBinaryTargetForCurrentPlatform,
35
37
  getGenerator: () => getGenerator,
36
38
  getGenerators: () => getGenerators,
37
- getSchemaDatasourceProvider: () => getSchemaDatasourceProvider,
39
+ getNodeAPIName: () => import_get_platform2.getNodeAPIName,
38
40
  knownBinaryTargets: () => knownBinaryTargets,
39
41
  loadSchemaContext: () => loadSchemaContext,
40
42
  processSchemaResult: () => processSchemaResult,
41
43
  skipIndex: () => skipIndex
42
44
  });
43
- module.exports = __toCommonJS(chunk_GCMOJALQ_exports);
44
- var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
45
- var import_chunk_GH2WAX5Y = require("./chunk-GH2WAX5Y.js");
45
+ module.exports = __toCommonJS(chunk_OPLMJ5WZ_exports);
46
46
  var import_chunk_X3P4J7WW = require("./chunk-X3P4J7WW.js");
47
47
  var import_chunk_LRU47BGE = require("./chunk-LRU47BGE.js");
48
+ var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
49
+ var import_chunk_F2OZV76L = require("./chunk-F2OZV76L.js");
50
+ var import_chunk_RS2R7COT = require("./chunk-RS2R7COT.js");
48
51
  var import_chunk_GXW4NTU2 = require("./chunk-GXW4NTU2.js");
49
52
  var import_chunk_5FJ3MENK = require("./chunk-5FJ3MENK.js");
50
- var import_chunk_DXWYZA7B = require("./chunk-DXWYZA7B.js");
51
- var import_chunk_CQVWHHIJ = require("./chunk-CQVWHHIJ.js");
53
+ var import_chunk_7QC5VORA = require("./chunk-7QC5VORA.js");
54
+ var import_chunk_AX5N26KG = require("./chunk-AX5N26KG.js");
55
+ var import_chunk_46ABODUM = require("./chunk-46ABODUM.js");
52
56
  var import_chunk_I6WLABB2 = require("./chunk-I6WLABB2.js");
53
57
  var import_chunk_CRVLHWC5 = require("./chunk-CRVLHWC5.js");
54
- var import_chunk_AADMLOWX = require("./chunk-AADMLOWX.js");
55
- var import_chunk_UWK6LIYC = require("./chunk-UWK6LIYC.js");
56
- var import_chunk_QRW4PODC = require("./chunk-QRW4PODC.js");
57
- var import_chunk_HNOCAIKC = require("./chunk-HNOCAIKC.js");
58
- var import_chunk_P47PM3SY = require("./chunk-P47PM3SY.js");
59
- var import_chunk_2BXDHSSY = require("./chunk-2BXDHSSY.js");
58
+ var import_chunk_QLOP3Z4E = require("./chunk-QLOP3Z4E.js");
59
+ var import_chunk_QPQF4VGD = require("./chunk-QPQF4VGD.js");
60
+ var import_chunk_656EKQL7 = require("./chunk-656EKQL7.js");
61
+ var import_chunk_KH7FI42S = require("./chunk-KH7FI42S.js");
62
+ var import_chunk_EYVG6XQS = require("./chunk-EYVG6XQS.js");
63
+ var import_chunk_262R2PBW = require("./chunk-262R2PBW.js");
64
+ var import_chunk_ZJWZK45Z = require("./chunk-ZJWZK45Z.js");
60
65
  var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
61
66
  var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
62
67
  var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
63
68
  var import_chunk_BPDMLM32 = require("./chunk-BPDMLM32.js");
64
69
  var import_chunk_IOIAK7V7 = require("./chunk-IOIAK7V7.js");
65
- var import_chunk_BXIKQUP5 = require("./chunk-BXIKQUP5.js");
66
- var import_chunk_ZJWZK45Z = require("./chunk-ZJWZK45Z.js");
67
70
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
71
+ var import_chunk_BVJP43JS = require("./chunk-BVJP43JS.js");
68
72
  var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
69
- var import_node_path = __toESM(require("node:path"));
73
+ var import_path = __toESM(require("path"));
70
74
  var import_debug = __toESM(require("@prisma/debug"));
71
75
  var import_debug2 = __toESM(require("@prisma/debug"));
72
76
  var import_engines = require("@prisma/engines");
73
77
  var import_get_platform = require("@prisma/get-platform");
74
- var import_path = __toESM(require("path"));
78
+ var import_path2 = __toESM(require("path"));
75
79
  var import_get_platform2 = require("@prisma/get-platform");
80
+ var forbiddenCmdFlagWithSchemaEngineWasm = ({ cmd, flag }) => `
81
+ Passing the ${(0, import_chunk_PG5FDKSF.green)(`${flag}`)} flag to the ${(0, import_chunk_PG5FDKSF.green)(`prisma ${cmd}`)} command is not supported when
82
+ defining an ${(0, import_chunk_PG5FDKSF.green)(`adapter`)} in Prisma config file (e.g., ${(0, import_chunk_PG5FDKSF.green)(`\`prisma.config.ts\``)}).
83
+
84
+ More information about this limitation: ${(0, import_chunk_I6WLABB2.link)("https://pris.ly/d/schema-engine-limitations")}
85
+ `;
86
+ function checkUnsupportedSchemaEngineWasm({
87
+ cmd,
88
+ config,
89
+ args,
90
+ flags
91
+ }) {
92
+ if (config.engine !== "js") {
93
+ return;
94
+ }
95
+ for (const flag of flags) {
96
+ if (args[flag] !== void 0) {
97
+ throw new Error(forbiddenCmdFlagWithSchemaEngineWasm({ cmd, flag }));
98
+ }
99
+ }
100
+ }
76
101
  var debug = (0, import_debug.default)("prisma:format");
77
102
  async function formatSchema({ schemas }, inputFormattingOptions) {
78
103
  if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
79
104
  handleFormatPanic(() => {
80
- import_chunk_P47PM3SY.prismaSchemaWasm.debug_panic();
105
+ import_chunk_262R2PBW.prismaSchemaWasm.debug_panic();
81
106
  });
82
107
  }
83
108
  const defaultFormattingOptions = {
@@ -94,10 +119,10 @@ async function formatSchema({ schemas }, inputFormattingOptions) {
94
119
  const { formattedMultipleSchemas, lintDiagnostics } = handleFormatPanic(() => {
95
120
  const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas), documentFormattingParams);
96
121
  const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
97
- const lintDiagnostics2 = (0, import_chunk_AADMLOWX.lintSchema)({ schemas: formattedMultipleSchemas2 });
122
+ const lintDiagnostics2 = (0, import_chunk_656EKQL7.lintSchema)({ schemas: formattedMultipleSchemas2 });
98
123
  return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
99
124
  });
100
- const lintWarnings = (0, import_chunk_AADMLOWX.getLintWarningsAsText)(lintDiagnostics);
125
+ const lintWarnings = (0, import_chunk_656EKQL7.getLintWarningsAsText)(lintDiagnostics);
101
126
  if (lintWarnings && import_chunk_ZJWZK45Z.logger_exports.should.warn()) {
102
127
  console.warn(lintWarnings);
103
128
  }
@@ -124,37 +149,60 @@ function handleFormatPanic(tryCb) {
124
149
  }
125
150
  }
126
151
  function formatWasm(schema, documentFormattingParams) {
127
- const formattedSchema = import_chunk_P47PM3SY.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
152
+ const formattedSchema = import_chunk_262R2PBW.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
128
153
  return formattedSchema;
129
154
  }
130
- async function loadSchemaContext({ schemaPath, printLoadMessage, allowNull, schemaPathArgumentName, cwd } = {
131
- schemaPath: { baseDir: process.cwd() },
132
- printLoadMessage: true,
133
- allowNull: false,
134
- schemaPathArgumentName: "--schema",
135
- cwd: process.cwd()
136
- }) {
155
+ async function loadSchemaContext({
156
+ schemaPathFromArg,
157
+ schemaPathFromConfig,
158
+ schemaEngineConfig,
159
+ printLoadMessage = true,
160
+ ignoreEnvVarErrors = false,
161
+ allowNull = false,
162
+ schemaPathArgumentName = "--schema",
163
+ cwd = process.cwd()
164
+ } = {}) {
137
165
  let schemaResult = null;
138
166
  if (allowNull) {
139
- schemaResult = await (0, import_chunk_2BXDHSSY.getSchemaWithPathOptional)({ schemaPath, cwd, argumentName: schemaPathArgumentName });
167
+ schemaResult = await (0, import_chunk_EYVG6XQS.getSchemaWithPathOptional)(schemaPathFromArg, schemaPathFromConfig, {
168
+ argumentName: schemaPathArgumentName,
169
+ cwd
170
+ });
140
171
  if (!schemaResult) return null;
141
172
  } else {
142
- schemaResult = await (0, import_chunk_2BXDHSSY.getSchemaWithPath)({ schemaPath, cwd, argumentName: schemaPathArgumentName });
173
+ schemaResult = await (0, import_chunk_EYVG6XQS.getSchemaWithPath)(schemaPathFromArg, schemaPathFromConfig, {
174
+ argumentName: schemaPathArgumentName,
175
+ cwd
176
+ });
143
177
  }
144
- return processSchemaResult({ schemaResult, printLoadMessage, cwd });
178
+ return processSchemaResult({ schemaResult, schemaEngineConfig, printLoadMessage, ignoreEnvVarErrors, cwd });
145
179
  }
146
180
  async function processSchemaResult({
147
181
  schemaResult,
182
+ schemaEngineConfig,
148
183
  printLoadMessage = true,
184
+ ignoreEnvVarErrors = false,
149
185
  cwd = process.cwd()
150
186
  }) {
151
- const loadedFromPathForLogMessages = import_node_path.default.relative(cwd, schemaResult.schemaPath);
187
+ const loadedFromPathForLogMessages = import_path.default.relative(cwd, schemaResult.schemaPath);
152
188
  const schemaRootDir = schemaResult.schemaRootDir || cwd;
153
189
  if (printLoadMessage) {
154
- (0, import_chunk_2BXDHSSY.printSchemaLoadedMessage)(loadedFromPathForLogMessages);
190
+ (0, import_chunk_EYVG6XQS.printSchemaLoadedMessage)(loadedFromPathForLogMessages);
155
191
  }
156
- const configFromPsl = await (0, import_chunk_QRW4PODC.getConfig)({ datamodel: schemaResult.schemas });
157
- const primaryDatasource = configFromPsl.datasources.at(0);
192
+ const configFromPsl = await (0, import_chunk_QLOP3Z4E.getConfig)({ datamodel: schemaResult.schemas, ignoreEnvVarErrors });
193
+ const datasourceFromPsl = configFromPsl.datasources.at(0);
194
+ const primaryDatasource = (0, import_chunk_XKZ6CBLA.z)(schemaEngineConfig).with({ engine: "classic" }, ({ datasource }) => {
195
+ const { url, directUrl, shadowDatabaseUrl } = datasource;
196
+ const primaryDatasource2 = {
197
+ ...datasourceFromPsl,
198
+ url: { fromEnvVar: null, value: url },
199
+ directUrl: directUrl ? { fromEnvVar: null, value: directUrl } : void 0,
200
+ shadowDatabaseUrl: shadowDatabaseUrl ? { fromEnvVar: null, value: shadowDatabaseUrl } : void 0,
201
+ [Symbol.for("engine.classic")]: true
202
+ };
203
+ return primaryDatasource2;
204
+ }).otherwise(() => datasourceFromPsl);
205
+ const primaryDatasourceDirectory = getPrimaryDatasourceDirectory(datasourceFromPsl) || schemaRootDir;
158
206
  return {
159
207
  schemaFiles: schemaResult.schemas,
160
208
  schemaPath: schemaResult.schemaPath,
@@ -162,17 +210,19 @@ async function processSchemaResult({
162
210
  datasources: configFromPsl.datasources,
163
211
  generators: configFromPsl.generators,
164
212
  primaryDatasource,
213
+ primaryDatasourceDirectory,
165
214
  warnings: configFromPsl.warnings,
166
215
  loadedFromPathForLogMessages
167
216
  };
168
217
  }
169
- function getSchemaDatasourceProvider(schemaContext) {
170
- if (schemaContext.primaryDatasource === void 0) {
171
- throw new Error("Schema must contain a datasource block");
218
+ function getPrimaryDatasourceDirectory(primaryDatasource) {
219
+ const datasourcePath = primaryDatasource?.sourceFilePath;
220
+ if (datasourcePath) {
221
+ return import_path.default.dirname(datasourcePath);
172
222
  }
173
- return schemaContext.primaryDatasource.activeProvider;
223
+ return null;
174
224
  }
175
- var import_p_map = (0, import_chunk_4VNS5WPM.__toESM)((0, import_chunk_BXIKQUP5.require_p_map)());
225
+ var import_p_map = (0, import_chunk_4VNS5WPM.__toESM)((0, import_chunk_BVJP43JS.require_p_map)());
176
226
  var debug2 = (0, import_debug2.default)("prisma:getGenerators");
177
227
  async function getGenerators(options) {
178
228
  if (options.registry === void 0 && options.providerAliases !== void 0) {
@@ -196,27 +246,29 @@ async function getGenerators(options) {
196
246
  skipDownload,
197
247
  binaryPathsOverride,
198
248
  generatorNames = [],
249
+ postinstall,
250
+ noEngine,
199
251
  allowNoModels = true,
200
252
  typedSql
201
253
  } = options;
202
- const schemaContext = !options.schemaContext && schemaPath ? await loadSchemaContext({ schemaPath: { cliProvidedPath: schemaPath } }) : options.schemaContext;
254
+ const schemaContext = !options.schemaContext && schemaPath ? await loadSchemaContext({ schemaPathFromArg: schemaPath, ignoreEnvVarErrors: true }) : options.schemaContext;
203
255
  if (!schemaContext) {
204
256
  throw new Error(`no schema provided for getGenerators`);
205
257
  }
206
258
  if (!schemaContext.primaryDatasource) {
207
- throw new Error(import_chunk_DXWYZA7B.missingDatasource);
259
+ throw new Error(import_chunk_7QC5VORA.missingDatasource);
208
260
  }
209
261
  (0, import_chunk_5FJ3MENK.printConfigWarnings)(schemaContext.warnings);
210
262
  const previewFeatures = (0, import_chunk_CRVLHWC5.extractPreviewFeatures)(schemaContext.generators);
211
- const dmmf = await (0, import_chunk_HNOCAIKC.getDMMF)({
263
+ const dmmf = await (0, import_chunk_QPQF4VGD.getDMMF)({
212
264
  datamodel: schemaContext.schemaFiles,
213
265
  previewFeatures
214
266
  });
215
267
  if (dmmf.datamodel.models.length === 0 && !allowNoModels) {
216
268
  if (schemaContext.primaryDatasource.provider === "mongodb") {
217
- throw new Error(import_chunk_CQVWHHIJ.missingModelMessageMongoDB);
269
+ throw new Error(import_chunk_AX5N26KG.missingModelMessageMongoDB);
218
270
  }
219
- throw new Error(import_chunk_CQVWHHIJ.missingModelMessage);
271
+ throw new Error(import_chunk_AX5N26KG.missingModelMessage);
220
272
  }
221
273
  const generatorConfigs = filterGenerators(overrideGenerators || schemaContext.generators, generatorNames);
222
274
  await validateGenerators(generatorConfigs);
@@ -225,7 +277,7 @@ async function getGenerators(options) {
225
277
  const generators = await (0, import_p_map.default)(
226
278
  generatorConfigs,
227
279
  async (generatorConfig, index) => {
228
- const baseDir = import_path.default.dirname(generatorConfig.sourceFilePath ?? schemaContext.schemaRootDir);
280
+ const baseDir = import_path2.default.dirname(generatorConfig.sourceFilePath ?? schemaContext.schemaRootDir);
229
281
  const providerValue = (0, import_chunk_IOIAK7V7.parseEnvValue)(generatorConfig.provider);
230
282
  const generatorDefinition = registry[providerValue] ?? {
231
283
  type: "rpc",
@@ -238,7 +290,7 @@ async function getGenerators(options) {
238
290
  await generatorInstance.init();
239
291
  if (generatorConfig.output) {
240
292
  generatorConfig.output = {
241
- value: import_path.default.resolve(baseDir, (0, import_chunk_IOIAK7V7.parseEnvValue)(generatorConfig.output)),
293
+ value: import_path2.default.resolve(baseDir, (0, import_chunk_IOIAK7V7.parseEnvValue)(generatorConfig.output)),
242
294
  fromEnvVar: null
243
295
  };
244
296
  generatorConfig.isCustomOutput = true;
@@ -259,7 +311,8 @@ You need to define \`output\` in the generator block in the schema file.`
259
311
  fromEnvVar: null
260
312
  };
261
313
  }
262
- const datamodel = (0, import_chunk_UWK6LIYC.mergeSchemas)({ schemas: schemaContext.schemaFiles });
314
+ const datamodel = (0, import_chunk_KH7FI42S.mergeSchemas)({ schemas: schemaContext.schemaFiles });
315
+ const envPaths = await (0, import_chunk_46ABODUM.getEnvPaths)(schemaContext.schemaPath, { cwd: generatorConfig.output.value });
263
316
  const options2 = {
264
317
  datamodel,
265
318
  datasources: schemaContext.datasources,
@@ -270,7 +323,10 @@ You need to define \`output\` in the generator block in the schema file.`
270
323
  // TODO:(schemaPath) can we get rid of schema path passing here?
271
324
  version: version2 || import_engines.enginesVersion,
272
325
  // this version makes no sense anymore and should be ignored
326
+ postinstall,
327
+ noEngine,
273
328
  allowNoModels,
329
+ envPaths,
274
330
  typedSql
275
331
  };
276
332
  generatorInstance.setOptions(options2);
@@ -314,16 +370,18 @@ generator gen {
314
370
  }
315
371
  const generatorBinaryTargets = g.options?.generator?.binaryTargets;
316
372
  if (generatorBinaryTargets && generatorBinaryTargets.length > 0) {
317
- for (const binaryTarget of generatorBinaryTargets) {
318
- if (!neededVersions[neededVersion].binaryTargets.find((object) => object.value === binaryTarget.value)) {
319
- neededVersions[neededVersion].binaryTargets.push(binaryTarget);
373
+ for (const binaryTarget2 of generatorBinaryTargets) {
374
+ if (!neededVersions[neededVersion].binaryTargets.find((object) => object.value === binaryTarget2.value)) {
375
+ neededVersions[neededVersion].binaryTargets.push(binaryTarget2);
320
376
  }
321
377
  }
322
378
  }
323
379
  }
324
380
  }
381
+ const queryEngineBinaryType = (0, import_engines.getCliQueryEngineBinaryType)();
382
+ const queryEngineType = (0, import_chunk_RS2R7COT.binaryTypeToEngineType)(queryEngineBinaryType);
325
383
  debug2("neededVersions", JSON.stringify(neededVersions, null, 2));
326
- const { binaryPathsByVersion } = await (0, import_chunk_GH2WAX5Y.getBinaryPathsByVersion)({
384
+ const { binaryPathsByVersion, binaryTarget } = await (0, import_chunk_F2OZV76L.getBinaryPathsByVersion)({
327
385
  neededVersions,
328
386
  // We're lazily computing the binary target here, to avoid printing the
329
387
  // `Prisma failed to detect the libssl/openssl version to use` warning
@@ -344,6 +402,17 @@ generator gen {
344
402
  const generatorBinaryPaths = (0, import_chunk_GXW4NTU2.pick)(binaryPaths ?? {}, generator.manifest.requiresEngines);
345
403
  debug2({ generatorBinaryPaths });
346
404
  generator.setBinaryPaths(generatorBinaryPaths);
405
+ if (engineVersion !== version2 && generator.options && generator.manifest.requiresEngines.includes(queryEngineType) && generatorBinaryPaths[queryEngineType] && generatorBinaryPaths[queryEngineType]?.[binaryTarget]) {
406
+ const customDmmf = await (0, import_chunk_QPQF4VGD.getDMMF)({
407
+ datamodel: schemaContext.schemaFiles,
408
+ previewFeatures
409
+ });
410
+ const options2 = { ...generator.options, dmmf: customDmmf };
411
+ debug2("generator.manifest.prettyName", generator.manifest.prettyName);
412
+ debug2("options", options2);
413
+ debug2("options.generator.binaryTargets", options2.generator.binaryTargets);
414
+ generator.setOptions(options2);
415
+ }
347
416
  }
348
417
  }
349
418
  return generators;
@@ -368,6 +437,17 @@ var oldToNewBinaryTargetsMapping = {
368
437
  async function validateGenerators(generators) {
369
438
  const binaryTarget = await (0, import_get_platform.getBinaryTargetForCurrentPlatform)();
370
439
  for (const generator of generators) {
440
+ if (generator.config.platforms) {
441
+ throw new Error(
442
+ `The \`platforms\` field on the generator definition is deprecated. Please rename it to \`binaryTargets\`.`
443
+ );
444
+ }
445
+ if (generator.config.pinnedBinaryTargets) {
446
+ throw new Error(
447
+ `The \`pinnedBinaryTargets\` field on the generator definition is deprecated.
448
+ Please use the PRISMA_QUERY_ENGINE_BINARY env var instead to pin the binary target.`
449
+ );
450
+ }
371
451
  if (generator.binaryTargets) {
372
452
  const binaryTargets2 = generator.binaryTargets && generator.binaryTargets.length > 0 ? generator.binaryTargets : [{ fromEnvVar: null, value: "native" }];
373
453
  const resolvedBinaryTargets = binaryTargets2.flatMap((object) => (0, import_chunk_IOIAK7V7.parseBinaryTargetsEnvValue)(object)).map((p) => p === "native" ? binaryTarget : p);
@@ -427,17 +507,25 @@ function filterGenerators(generators, generatorNames) {
427
507
  }
428
508
  return filtered;
429
509
  }
430
- var forbiddenCmdWithDataProxyFlagMessage = (cmd) => `
431
- Using an Accelerate URL is not supported for this CLI command ${(0, import_chunk_PG5FDKSF.green)(`prisma ${cmd}`)} yet.
432
- Please use a direct connection to your database in \`prisma.config.ts\`.
510
+ var forbiddenCmdWithDataProxyFlagMessage = (command) => `
511
+ Using an Accelerate URL is not supported for this CLI command ${(0, import_chunk_PG5FDKSF.green)(`prisma ${command}`)} yet.
512
+ Please use a direct connection to your database via the datasource \`directUrl\` setting.
433
513
 
434
514
  More information about this limitation: ${(0, import_chunk_I6WLABB2.link)("https://pris.ly/d/accelerate-limitations")}
435
515
  `;
436
516
  function checkUnsupportedDataProxy({
437
517
  cmd,
438
- validatedConfig
518
+ schemaContext = void 0,
519
+ urls = []
439
520
  }) {
440
- if (validatedConfig.datasource.url.startsWith("prisma://")) {
521
+ for (const url2 of urls) {
522
+ if (url2 && url2.includes("prisma://")) {
523
+ throw new Error(forbiddenCmdWithDataProxyFlagMessage(cmd));
524
+ }
525
+ }
526
+ if (!schemaContext?.primaryDatasource) return;
527
+ const url = (0, import_chunk_QLOP3Z4E.resolveUrl)((0, import_chunk_QLOP3Z4E.getEffectiveUrl)(schemaContext.primaryDatasource));
528
+ if (url?.startsWith("prisma://")) {
441
529
  throw new Error(forbiddenCmdWithDataProxyFlagMessage(cmd));
442
530
  }
443
531
  }
@@ -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_SP2ETLT2_exports = {};
20
- __export(chunk_SP2ETLT2_exports, {
19
+ var chunk_OSHZ4P3G_exports = {};
20
+ __export(chunk_OSHZ4P3G_exports, {
21
21
  toSchemasContainer: () => toSchemasContainer,
22
22
  toSchemasWithConfigDir: () => toSchemasWithConfigDir
23
23
  });
24
- module.exports = __toCommonJS(chunk_SP2ETLT2_exports);
24
+ module.exports = __toCommonJS(chunk_OSHZ4P3G_exports);
25
25
  function toSchemasContainer(schemas) {
26
26
  return {
27
27
  files: multipleSchemasToSchemaContainers(schemas)
28
28
  };
29
29
  }
30
- function toSchemasWithConfigDir(schemaContext, configDir) {
30
+ function toSchemasWithConfigDir(schemaContext) {
31
31
  return {
32
32
  files: multipleSchemasToSchemaContainers(schemaContext.schemaFiles),
33
- configDir
33
+ configDir: schemaContext.primaryDatasourceDirectory
34
34
  };
35
35
  }
36
36
  function multipleSchemasToSchemaContainers(schemas) {
@@ -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 chunk_6JD4VENT_exports = {};
30
- __export(chunk_6JD4VENT_exports, {
29
+ var chunk_OWUYXGDF_exports = {};
30
+ __export(chunk_OWUYXGDF_exports, {
31
31
  GetDmmfError: () => GetDmmfError,
32
32
  getDMMF: () => getDMMF
33
33
  });
34
- module.exports = __toCommonJS(chunk_6JD4VENT_exports);
35
- var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
34
+ module.exports = __toCommonJS(chunk_OWUYXGDF_exports);
35
+ var import_chunk_TZJROXB3 = require("./chunk-TZJROXB3.js");
36
36
  var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
37
- var import_chunk_HFLFMWOT = require("./chunk-HFLFMWOT.js");
38
- var import_chunk_QMSPMDFJ = require("./chunk-QMSPMDFJ.js");
37
+ var import_chunk_QDT7TGYZ = require("./chunk-QDT7TGYZ.js");
38
+ var import_chunk_WKP2TVYB = require("./chunk-WKP2TVYB.js");
39
39
  var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
40
40
  var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
41
41
  var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
@@ -58,25 +58,25 @@ ${detailsHeader} ${message}`;
58
58
  }).exhaustive();
59
59
  const errorMessageWithContext = `${constructedErrorMessage}
60
60
  [Context: getDmmf]`;
61
- super((0, import_chunk_HFLFMWOT.addVersionDetailsToErrorMessage)(errorMessageWithContext));
61
+ super((0, import_chunk_QDT7TGYZ.addVersionDetailsToErrorMessage)(errorMessageWithContext));
62
62
  this.name = "GetDmmfError";
63
63
  }
64
64
  };
65
65
  async function getDMMF(options) {
66
- const debugErrorType = (0, import_chunk_WSZXPLJQ.createDebugErrorType)(debug, "getDmmfWasm");
66
+ const debugErrorType = (0, import_chunk_TZJROXB3.createDebugErrorType)(debug, "getDmmfWasm");
67
67
  debug(`Using getDmmf Wasm`);
68
68
  const dmmfPipeline = (0, import_function.pipe)(
69
69
  (0, import_chunk_5DBOS77Y.tryCatch)(
70
70
  () => {
71
- if (process.env.FORCE_PANIC_GET_DMMF) {
71
+ if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
72
72
  debug("Triggering a Rust panic...");
73
- import_chunk_QMSPMDFJ.prismaSchemaWasm.debug_panic();
73
+ import_chunk_WKP2TVYB.prismaSchemaWasm.debug_panic();
74
74
  }
75
75
  const params = JSON.stringify({
76
76
  prismaSchema: options.datamodel,
77
77
  noColor: Boolean(process.env.NO_COLOR)
78
78
  });
79
- const data = import_chunk_QMSPMDFJ.prismaSchemaWasm.get_dmmf(params);
79
+ const data = import_chunk_WKP2TVYB.prismaSchemaWasm.get_dmmf(params);
80
80
  return data;
81
81
  },
82
82
  (e) => ({
@@ -124,7 +124,7 @@ async function getDMMF(options) {
124
124
  return panic;
125
125
  }
126
126
  const errorOutput = e.error.message;
127
- return new GetDmmfError((0, import_chunk_WSZXPLJQ.parseQueryEngineError)({ errorOutput, reason: e.reason }));
127
+ return new GetDmmfError((0, import_chunk_TZJROXB3.parseQueryEngineError)({ errorOutput, reason: e.reason }));
128
128
  }).with({ type: "parse-json" }, (e) => {
129
129
  debugErrorType(e);
130
130
  return new GetDmmfError({ _tag: "unparsed", message: e.error.message, reason: e.reason });
@@ -0,0 +1,41 @@
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
+ }
@@ -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_HFLFMWOT_exports = {};
20
- __export(chunk_HFLFMWOT_exports, {
19
+ var chunk_QDT7TGYZ_exports = {};
20
+ __export(chunk_QDT7TGYZ_exports, {
21
21
  addVersionDetailsToErrorMessage: () => addVersionDetailsToErrorMessage
22
22
  });
23
- module.exports = __toCommonJS(chunk_HFLFMWOT_exports);
24
- var import_chunk_OVTE2A4Y = require("./chunk-OVTE2A4Y.js");
23
+ module.exports = __toCommonJS(chunk_QDT7TGYZ_exports);
24
+ var import_chunk_H43XC5ET = require("./chunk-H43XC5ET.js");
25
25
  var import_chunk_QN6PSQY7 = require("./chunk-QN6PSQY7.js");
26
26
  function addVersionDetailsToErrorMessage(message) {
27
- const rows = [["Prisma CLI Version", import_chunk_OVTE2A4Y.version]];
27
+ const rows = [["Prisma CLI Version", import_chunk_H43XC5ET.version]];
28
28
  return `${message}
29
29
 
30
30
  ${(0, import_chunk_QN6PSQY7.formatTable)(rows)}`;
@@ -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 chunk_QRW4PODC_exports = {};
30
- __export(chunk_QRW4PODC_exports, {
29
+ var chunk_QLOP3Z4E_exports = {};
30
+ __export(chunk_QLOP3Z4E_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(chunk_QRW4PODC_exports);
35
- var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
36
- var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
37
+ module.exports = __toCommonJS(chunk_QLOP3Z4E_exports);
38
+ var import_chunk_TZJROXB3 = require("./chunk-TZJROXB3.js");
37
39
  var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
38
- var import_chunk_J3JTMPWZ = require("./chunk-J3JTMPWZ.js");
39
- var import_chunk_P47PM3SY = require("./chunk-P47PM3SY.js");
40
+ var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
41
+ var import_chunk_WDPDHAFW = require("./chunk-WDPDHAFW.js");
42
+ var import_chunk_262R2PBW = require("./chunk-262R2PBW.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, import_chunk_J3JTMPWZ.addVersionDetailsToErrorMessage)(errorMessageWithContext));
67
+ super((0, import_chunk_WDPDHAFW.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, import_chunk_WSZXPLJQ.createDebugErrorType)(debug, "getConfigWasm");
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.FORCE_PANIC_GET_CONFIG) {
90
+ if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_CONFIG) {
75
91
  debug("Triggering a Rust panic...");
76
- import_chunk_P47PM3SY.prismaSchemaWasm.debug_panic();
92
+ import_chunk_262R2PBW.prismaSchemaWasm.debug_panic();
77
93
  }
78
- const params = JSON.stringify({ prismaSchema: options.datamodel });
79
- return import_chunk_P47PM3SY.prismaSchemaWasm.get_config(params);
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_262R2PBW.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, import_chunk_WSZXPLJQ.parseQueryEngineError)({ errorOutput, reason: e.reason }));
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, import_chunk_WSZXPLJQ.createSchemaValidationError)(e.reason),
164
+ reason: (0, import_chunk_TZJROXB3.createSchemaValidationError)(e.reason),
143
165
  message: formatErrors(e.error)
144
166
  });
145
167
  }).otherwise((e) => {