@prisma/internals 6.6.0-dev.34 → 6.6.0-dev.36

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 (65) hide show
  1. package/dist/{chunk-WD2267J3.js → chunk-2VT4AM4Y.js} +17 -17
  2. package/dist/{chunk-7MD6344A.js → chunk-5DBOS77Y.js} +3 -5
  3. package/dist/{chunk-KSJNY56L.js → chunk-5II75LYF.js} +22 -22
  4. package/dist/{chunk-JUXIW5NS.js → chunk-5MWCIDUY.js} +5 -5
  5. package/dist/{chunk-KTB2HCCO.js → chunk-7FH5JKIS.js} +7 -7
  6. package/dist/{chunk-JAWGW6LI.js → chunk-BXZXLEEH.js} +9 -9
  7. package/dist/{chunk-PSYMCJ4B.js → chunk-CMIKSBKL.js} +8 -8
  8. package/dist/{chunk-TSJICM5S.js → chunk-CRVLHWC5.js} +5 -5
  9. package/dist/{chunk-LOQLKDQE.js → chunk-EV7SJDE5.js} +5 -5
  10. package/dist/{chunk-6E4KJPDH.js → chunk-GH3DD2OM.js} +14 -14
  11. package/dist/{chunk-PIHBLNPJ.js → chunk-OSAQY3IQ.js} +4 -4
  12. package/dist/{chunk-JHQHVXIR.js → chunk-OSHZ4P3G.js} +6 -7
  13. package/dist/{chunk-MM4PIVNT.js → chunk-PAIGKNMY.js} +26 -26
  14. package/dist/{chunk-2TQR7BKX.js → chunk-Q6VZHKYE.js} +9 -9
  15. package/dist/{chunk-T2PFJSAD.js → chunk-RQK5KO77.js} +13 -13
  16. package/dist/{chunk-YBYBY7QI.js → chunk-U4WXIU7C.js} +5 -5
  17. package/dist/{chunk-EORSBI5P.js → chunk-UCI7OFQ4.js} +5 -5
  18. package/dist/{chunk-RAC7G3AO.js → chunk-UVLDTPOI.js} +5 -5
  19. package/dist/{chunk-X3CLVIIZ.js → chunk-VLBKBUPL.js} +35 -64
  20. package/dist/{chunk-RVU5FP25.js → chunk-VYFTEDQQ.js} +393 -415
  21. package/dist/{chunk-GNEFDTJE.js → chunk-WSCZQCHP.js} +391 -413
  22. package/dist/{chunk-AYSLETYV.js → chunk-WUO3S6J2.js} +38 -67
  23. package/dist/{chunk-MSQTBYIV.js → chunk-YYIAYJ4W.js} +5 -5
  24. package/dist/cli/checkUnsupportedDataProxy.d.ts +12 -17
  25. package/dist/cli/checkUnsupportedDataProxy.js +21 -22
  26. package/dist/cli/getSchema.js +25 -26
  27. package/dist/cli/hashes.js +21 -22
  28. package/dist/cli/schemaContext.d.ts +17 -2
  29. package/dist/cli/schemaContext.js +21 -21
  30. package/dist/engine-commands/errorHelpers.js +4 -4
  31. package/dist/engine-commands/formatSchema.js +20 -21
  32. package/dist/engine-commands/getConfig.d.ts +0 -4
  33. package/dist/engine-commands/getConfig.js +12 -12
  34. package/dist/engine-commands/getDmmf.d.ts +1 -5
  35. package/dist/engine-commands/getDmmf.js +9 -9
  36. package/dist/engine-commands/getEngineVersion.js +5 -5
  37. package/dist/engine-commands/getEnginesMetaInfo.js +7 -7
  38. package/dist/engine-commands/index.js +31 -32
  39. package/dist/engine-commands/lintSchema.js +8 -8
  40. package/dist/engine-commands/mergeSchemas.js +9 -9
  41. package/dist/engine-commands/queryEngineCommons.js +6 -6
  42. package/dist/engine-commands/validate.js +9 -9
  43. package/dist/get-generators/generatorResolvers/generatorResolvers.js +20 -21
  44. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +20 -21
  45. package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +21 -22
  46. package/dist/get-generators/getGenerators.d.ts +7 -3
  47. package/dist/get-generators/getGenerators.js +23 -24
  48. package/dist/index.d.ts +1 -1
  49. package/dist/index.js +62 -62
  50. package/dist/resolveBinary.js +7 -7
  51. package/dist/schemaEngineCommands.js +8 -8
  52. package/dist/sendPanic.js +20 -21
  53. package/dist/utils/extractPreviewFeatures.d.ts +2 -2
  54. package/dist/utils/extractPreviewFeatures.js +2 -2
  55. package/dist/utils/getEnvPaths.js +20 -21
  56. package/dist/utils/getVersionFromPackageJson.js +3 -3
  57. package/dist/utils/handlePanic.js +20 -21
  58. package/dist/utils/loadEnvFile.js +20 -21
  59. package/dist/utils/toSchemasContainer.d.ts +2 -3
  60. package/dist/utils/toSchemasContainer.js +3 -4
  61. package/dist/wasm.js +4 -4
  62. package/package.json +8 -8
  63. package/dist/chunk-IPKE37QC.js +0 -25
  64. package/dist/get-generators/utils/check-feature-flags/checkFeatureFlags.d.ts +0 -8
  65. package/dist/get-generators/utils/check-feature-flags/checkFeatureFlags.js +0 -25
@@ -26,33 +26,33 @@ 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_MM4PIVNT_exports = {};
30
- __export(chunk_MM4PIVNT_exports, {
29
+ var chunk_PAIGKNMY_exports = {};
30
+ __export(chunk_PAIGKNMY_exports, {
31
31
  getEnginesInfo: () => getEnginesInfo,
32
32
  getEnginesMetaInfo: () => getEnginesMetaInfo,
33
33
  resolveEngine: () => resolveEngine
34
34
  });
35
- module.exports = __toCommonJS(chunk_MM4PIVNT_exports);
35
+ module.exports = __toCommonJS(chunk_PAIGKNMY_exports);
36
36
  var import_chunk_ZGAIRZ32 = require("./chunk-ZGAIRZ32.js");
37
- var import_chunk_KTB2HCCO = require("./chunk-KTB2HCCO.js");
37
+ var import_chunk_7FH5JKIS = require("./chunk-7FH5JKIS.js");
38
38
  var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
39
- var import_chunk_YBYBY7QI = require("./chunk-YBYBY7QI.js");
40
- var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
39
+ var import_chunk_U4WXIU7C = require("./chunk-U4WXIU7C.js");
40
+ var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
41
41
  var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
42
42
  var import_engines = require("@prisma/engines");
43
43
  var import_fetch_engine = require("@prisma/fetch-engine");
44
44
  var import_path = __toESM(require("path"));
45
45
  var import_function2 = (0, import_chunk_2ESYSVXG.__toESM)((0, import_chunk_ZGAIRZ32.require_function)());
46
- var none2 = import_chunk_7MD6344A.none;
47
- var some2 = import_chunk_7MD6344A.some;
46
+ var none2 = import_chunk_5DBOS77Y.none;
47
+ var some2 = import_chunk_5DBOS77Y.some;
48
48
  var getRight = function(ma) {
49
49
  return ma._tag === "Left" ? none2 : some2(ma.right);
50
50
  };
51
51
  var _map = function(fa, f) {
52
- return (0, import_chunk_7MD6344A.pipe)(fa, map(f));
52
+ return (0, import_chunk_5DBOS77Y.pipe)(fa, map(f));
53
53
  };
54
54
  var _ap = function(fab, fa) {
55
- return (0, import_chunk_7MD6344A.pipe)(fab, ap(fa));
55
+ return (0, import_chunk_5DBOS77Y.pipe)(fab, ap(fa));
56
56
  };
57
57
  var URI = "Option";
58
58
  var map = function(f) {
@@ -64,14 +64,14 @@ var Functor = {
64
64
  URI,
65
65
  map: _map
66
66
  };
67
- var as2 = (0, import_chunk_7MD6344A.dual)(2, (0, import_chunk_7MD6344A.as)(Functor));
68
- var asUnit2 = (0, import_chunk_7MD6344A.asUnit)(Functor);
67
+ var as2 = (0, import_chunk_5DBOS77Y.dual)(2, (0, import_chunk_5DBOS77Y.as)(Functor));
68
+ var asUnit2 = (0, import_chunk_5DBOS77Y.asUnit)(Functor);
69
69
  var ap = function(fa) {
70
70
  return function(fab) {
71
71
  return isNone(fab) ? none2 : isNone(fa) ? none2 : some2(fab.value(fa.value));
72
72
  };
73
73
  };
74
- var flatMap = /* @__PURE__ */ (0, import_chunk_7MD6344A.dual)(2, function(ma, f) {
74
+ var flatMap = /* @__PURE__ */ (0, import_chunk_5DBOS77Y.dual)(2, function(ma, f) {
75
75
  return isNone(ma) ? none2 : f(ma.value);
76
76
  });
77
77
  var Chain = {
@@ -80,7 +80,7 @@ var Chain = {
80
80
  ap: _ap,
81
81
  chain: flatMap
82
82
  };
83
- var orElse = (0, import_chunk_7MD6344A.dual)(2, function(self, that) {
83
+ var orElse = (0, import_chunk_5DBOS77Y.dual)(2, function(self, that) {
84
84
  return isNone(self) ? that() : self;
85
85
  });
86
86
  var fromEither2 = getRight;
@@ -88,7 +88,7 @@ var FromEither = {
88
88
  URI,
89
89
  fromEither: fromEither2
90
90
  };
91
- var isSome2 = import_chunk_7MD6344A.isSome;
91
+ var isSome2 = import_chunk_5DBOS77Y.isSome;
92
92
  var isNone = function(fa) {
93
93
  return fa._tag === "None";
94
94
  };
@@ -99,8 +99,8 @@ var matchW = function(onNone, onSome) {
99
99
  };
100
100
  var match = matchW;
101
101
  var fold = match;
102
- var tap2 = /* @__PURE__ */ (0, import_chunk_7MD6344A.dual)(2, (0, import_chunk_7MD6344A.tap)(Chain));
103
- var tapEither2 = /* @__PURE__ */ (0, import_chunk_7MD6344A.dual)(2, (0, import_chunk_7MD6344A.tapEither)(FromEither, Chain));
102
+ var tap2 = /* @__PURE__ */ (0, import_chunk_5DBOS77Y.dual)(2, (0, import_chunk_5DBOS77Y.tap)(Chain));
103
+ var tapEither2 = /* @__PURE__ */ (0, import_chunk_5DBOS77Y.dual)(2, (0, import_chunk_5DBOS77Y.tapEither)(FromEither, Chain));
104
104
  var fromNullable = function(a) {
105
105
  return a == null ? none2 : some2(a);
106
106
  };
@@ -133,15 +133,15 @@ function getEnginesInfo(enginesInfo) {
133
133
  const resolved = (0, import_chunk_XKZ6CBLA.z)(enginesInfo).with({ fromEnvVar: import_chunk_XKZ6CBLA.N.when(isSome2) }, (_engineInfo) => {
134
134
  return `, resolved by ${_engineInfo.fromEnvVar.value}`;
135
135
  }).otherwise(() => "");
136
- const absolutePath = (0, import_chunk_XKZ6CBLA.z)(enginesInfo).with({ path: import_chunk_XKZ6CBLA.N.when(import_chunk_7MD6344A.isRight) }, (_engineInfo) => {
136
+ const absolutePath = (0, import_chunk_XKZ6CBLA.z)(enginesInfo).with({ path: import_chunk_XKZ6CBLA.N.when(import_chunk_5DBOS77Y.isRight) }, (_engineInfo) => {
137
137
  return _engineInfo.path.right;
138
- }).with({ path: import_chunk_XKZ6CBLA.N.when(import_chunk_7MD6344A.isLeft) }, (_engineInfo) => {
138
+ }).with({ path: import_chunk_XKZ6CBLA.N.when(import_chunk_5DBOS77Y.isLeft) }, (_engineInfo) => {
139
139
  errors.push(_engineInfo.path.left);
140
140
  return "E_CANNOT_RESOLVE_PATH";
141
141
  }).exhaustive();
142
- const version = (0, import_chunk_XKZ6CBLA.z)(enginesInfo).with({ version: import_chunk_XKZ6CBLA.N.when(import_chunk_7MD6344A.isRight) }, (_engineInfo) => {
142
+ const version = (0, import_chunk_XKZ6CBLA.z)(enginesInfo).with({ version: import_chunk_XKZ6CBLA.N.when(import_chunk_5DBOS77Y.isRight) }, (_engineInfo) => {
143
143
  return _engineInfo.version.right;
144
- }).with({ version: import_chunk_XKZ6CBLA.N.when(import_chunk_7MD6344A.isLeft) }, (_engineInfo) => {
144
+ }).with({ version: import_chunk_XKZ6CBLA.N.when(import_chunk_5DBOS77Y.isLeft) }, (_engineInfo) => {
145
145
  errors.push(_engineInfo.version.left);
146
146
  return "E_CANNOT_RESOLVE_VERSION";
147
147
  }).exhaustive();
@@ -157,15 +157,15 @@ async function resolveEngine(binaryName) {
157
157
  const enginePathEither = await (0, import_function2.pipe)(
158
158
  pathFromEnvOption,
159
159
  fold(
160
- () => (0, import_chunk_YBYBY7QI.safeResolveBinary)(binaryName),
161
- (pathFromEnv) => (0, import_chunk_7MD6344A.right2)(pathFromEnv.path)
160
+ () => (0, import_chunk_U4WXIU7C.safeResolveBinary)(binaryName),
161
+ (pathFromEnv) => (0, import_chunk_5DBOS77Y.right2)(pathFromEnv.path)
162
162
  )
163
163
  )();
164
164
  const versionEither = await (0, import_function2.pipe)(
165
165
  enginePathEither,
166
- import_chunk_7MD6344A.fromEither,
167
- (0, import_chunk_7MD6344A.chain)((enginePath) => {
168
- return (0, import_chunk_KTB2HCCO.safeGetEngineVersion)(enginePath, binaryName);
166
+ import_chunk_5DBOS77Y.fromEither,
167
+ (0, import_chunk_5DBOS77Y.chain)((enginePath) => {
168
+ return (0, import_chunk_7FH5JKIS.safeGetEngineVersion)(enginePath, binaryName);
169
169
  })
170
170
  )();
171
171
  const engineInfo = {
@@ -26,21 +26,21 @@ 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_2TQR7BKX_exports = {};
30
- __export(chunk_2TQR7BKX_exports, {
29
+ var chunk_Q6VZHKYE_exports = {};
30
+ __export(chunk_Q6VZHKYE_exports, {
31
31
  MergeSchemasError: () => MergeSchemasError,
32
32
  mergeSchemas: () => mergeSchemas
33
33
  });
34
- module.exports = __toCommonJS(chunk_2TQR7BKX_exports);
34
+ module.exports = __toCommonJS(chunk_Q6VZHKYE_exports);
35
35
  var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
36
- var import_chunk_PSYMCJ4B = require("./chunk-PSYMCJ4B.js");
36
+ var import_chunk_CMIKSBKL = require("./chunk-CMIKSBKL.js");
37
37
  var import_chunk_ZGAIRZ32 = require("./chunk-ZGAIRZ32.js");
38
38
  var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
39
39
  var import_chunk_QKPV6M3S = require("./chunk-QKPV6M3S.js");
40
40
  var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
41
41
  var import_chunk_R7U45FIQ = require("./chunk-R7U45FIQ.js");
42
42
  var import_chunk_CCQRDM7X = require("./chunk-CCQRDM7X.js");
43
- var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
43
+ var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
44
44
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
45
45
  var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
46
46
  var import_debug = __toESM(require("@prisma/debug"));
@@ -65,10 +65,10 @@ ${detailsHeader} ${message}`;
65
65
  }
66
66
  };
67
67
  function mergeSchemas(options) {
68
- const debugErrorType = (0, import_chunk_PSYMCJ4B.createDebugErrorType)(debug, "mergeSchemasWasm");
68
+ const debugErrorType = (0, import_chunk_CMIKSBKL.createDebugErrorType)(debug, "mergeSchemasWasm");
69
69
  debug(`Using mergeSchemas Wasm`);
70
70
  const mergeSchemasEither = (0, import_function.pipe)(
71
- (0, import_chunk_7MD6344A.tryCatch)(
71
+ (0, import_chunk_5DBOS77Y.tryCatch)(
72
72
  () => {
73
73
  const params = JSON.stringify({
74
74
  schema: options.schemas
@@ -82,7 +82,7 @@ function mergeSchemas(options) {
82
82
  })
83
83
  )
84
84
  );
85
- if ((0, import_chunk_7MD6344A.isRight)(mergeSchemasEither)) {
85
+ if ((0, import_chunk_5DBOS77Y.isRight)(mergeSchemasEither)) {
86
86
  return mergeSchemasEither.right;
87
87
  }
88
88
  const error = (0, import_chunk_XKZ6CBLA.z)(mergeSchemasEither.left).with({ type: "wasm-error" }, (e) => {
@@ -108,7 +108,7 @@ function mergeSchemas(options) {
108
108
  return panic;
109
109
  }
110
110
  const errorOutput = e.error.message;
111
- return new MergeSchemasError((0, import_chunk_PSYMCJ4B.parseQueryEngineError)({ errorOutput, reason: e.reason }));
111
+ return new MergeSchemasError((0, import_chunk_CMIKSBKL.parseQueryEngineError)({ errorOutput, reason: e.reason }));
112
112
  }).exhaustive();
113
113
  throw error;
114
114
  }
@@ -26,21 +26,21 @@ 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_T2PFJSAD_exports = {};
30
- __export(chunk_T2PFJSAD_exports, {
29
+ var chunk_RQK5KO77_exports = {};
30
+ __export(chunk_RQK5KO77_exports, {
31
31
  MergeSchemasError: () => MergeSchemasError,
32
32
  mergeSchemas: () => mergeSchemas
33
33
  });
34
- module.exports = __toCommonJS(chunk_T2PFJSAD_exports);
34
+ module.exports = __toCommonJS(chunk_RQK5KO77_exports);
35
35
  var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
36
- var import_chunk_PSYMCJ4B = require("./chunk-PSYMCJ4B.js");
36
+ var import_chunk_CMIKSBKL = require("./chunk-CMIKSBKL.js");
37
37
  var import_chunk_ZGAIRZ32 = require("./chunk-ZGAIRZ32.js");
38
38
  var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
39
- var import_chunk_JUXIW5NS = require("./chunk-JUXIW5NS.js");
39
+ var import_chunk_5MWCIDUY = require("./chunk-5MWCIDUY.js");
40
40
  var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
41
- var import_chunk_RAC7G3AO = require("./chunk-RAC7G3AO.js");
41
+ var import_chunk_UVLDTPOI = require("./chunk-UVLDTPOI.js");
42
42
  var import_chunk_CCQRDM7X = require("./chunk-CCQRDM7X.js");
43
- var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
43
+ var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
44
44
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
45
45
  var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
46
46
  var import_debug = __toESM(require("@prisma/debug"));
@@ -60,20 +60,20 @@ ${detailsHeader} ${message}`;
60
60
  }).exhaustive();
61
61
  const errorMessageWithContext = `${constructedErrorMessage}
62
62
  [Context: mergeSchemas]`;
63
- super((0, import_chunk_JUXIW5NS.addVersionDetailsToErrorMessage)(errorMessageWithContext));
63
+ super((0, import_chunk_5MWCIDUY.addVersionDetailsToErrorMessage)(errorMessageWithContext));
64
64
  this.name = "MergeSchemasError";
65
65
  }
66
66
  };
67
67
  function mergeSchemas(options) {
68
- const debugErrorType = (0, import_chunk_PSYMCJ4B.createDebugErrorType)(debug, "mergeSchemasWasm");
68
+ const debugErrorType = (0, import_chunk_CMIKSBKL.createDebugErrorType)(debug, "mergeSchemasWasm");
69
69
  debug(`Using mergeSchemas Wasm`);
70
70
  const mergeSchemasEither = (0, import_function.pipe)(
71
- (0, import_chunk_7MD6344A.tryCatch)(
71
+ (0, import_chunk_5DBOS77Y.tryCatch)(
72
72
  () => {
73
73
  const params = JSON.stringify({
74
74
  schema: options.schemas
75
75
  });
76
- return import_chunk_RAC7G3AO.prismaSchemaWasm.merge_schemas(params);
76
+ return import_chunk_UVLDTPOI.prismaSchemaWasm.merge_schemas(params);
77
77
  },
78
78
  (e) => ({
79
79
  type: "wasm-error",
@@ -82,7 +82,7 @@ function mergeSchemas(options) {
82
82
  })
83
83
  )
84
84
  );
85
- if ((0, import_chunk_7MD6344A.isRight)(mergeSchemasEither)) {
85
+ if ((0, import_chunk_5DBOS77Y.isRight)(mergeSchemasEither)) {
86
86
  return mergeSchemasEither.right;
87
87
  }
88
88
  const error = (0, import_chunk_XKZ6CBLA.z)(mergeSchemasEither.left).with({ type: "wasm-error" }, (e) => {
@@ -108,7 +108,7 @@ function mergeSchemas(options) {
108
108
  return panic;
109
109
  }
110
110
  const errorOutput = e.error.message;
111
- return new MergeSchemasError((0, import_chunk_PSYMCJ4B.parseQueryEngineError)({ errorOutput, reason: e.reason }));
111
+ return new MergeSchemasError((0, import_chunk_CMIKSBKL.parseQueryEngineError)({ errorOutput, reason: e.reason }));
112
112
  }).exhaustive();
113
113
  throw error;
114
114
  }
@@ -26,19 +26,19 @@ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__g
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_YBYBY7QI_exports = {};
30
- __export(chunk_YBYBY7QI_exports, {
29
+ var chunk_U4WXIU7C_exports = {};
30
+ __export(chunk_U4WXIU7C_exports, {
31
31
  BinaryType: () => import_fetch_engine.BinaryType,
32
32
  engineEnvVarMap: () => import_fetch_engine.engineEnvVarMap,
33
33
  maybeCopyToTmp: () => maybeCopyToTmp,
34
34
  resolveBinary: () => resolveBinary,
35
35
  safeResolveBinary: () => safeResolveBinary
36
36
  });
37
- module.exports = __toCommonJS(chunk_YBYBY7QI_exports);
37
+ module.exports = __toCommonJS(chunk_U4WXIU7C_exports);
38
38
  var import_chunk_RAYPCPVU = require("./chunk-RAYPCPVU.js");
39
39
  var import_chunk_M3GBKLGE = require("./chunk-M3GBKLGE.js");
40
40
  var import_chunk_TWSLDIFL = require("./chunk-TWSLDIFL.js");
41
- var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
41
+ var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
42
42
  var import_chunk_6TVEFPKE = require("./chunk-6TVEFPKE.js");
43
43
  var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
44
44
  var import_engines = require("@prisma/engines");
@@ -90,7 +90,7 @@ async function resolveBinary(name, proposedPath) {
90
90
  );
91
91
  }
92
92
  function safeResolveBinary(name, proposedPath) {
93
- return (0, import_chunk_7MD6344A.tryCatch2)(
93
+ return (0, import_chunk_5DBOS77Y.tryCatch2)(
94
94
  () => resolveBinary(name, proposedPath),
95
95
  (error) => error
96
96
  );
@@ -16,17 +16,17 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_EORSBI5P_exports = {};
20
- __export(chunk_EORSBI5P_exports, {
19
+ var chunk_UCI7OFQ4_exports = {};
20
+ __export(chunk_UCI7OFQ4_exports, {
21
21
  SchemaEngineExitCode: () => SchemaEngineExitCode,
22
22
  canConnectToDatabase: () => canConnectToDatabase,
23
23
  createDatabase: () => createDatabase,
24
24
  dropDatabase: () => dropDatabase,
25
25
  execaCommand: () => execaCommand
26
26
  });
27
- module.exports = __toCommonJS(chunk_EORSBI5P_exports);
27
+ module.exports = __toCommonJS(chunk_UCI7OFQ4_exports);
28
28
  var import_chunk_2WR3PY2L = require("./chunk-2WR3PY2L.js");
29
- var import_chunk_YBYBY7QI = require("./chunk-YBYBY7QI.js");
29
+ var import_chunk_U4WXIU7C = require("./chunk-U4WXIU7C.js");
30
30
  var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
31
31
  var import_fetch_engine = require("@prisma/fetch-engine");
32
32
  var import_execa = (0, import_chunk_2ESYSVXG.__toESM)((0, import_chunk_2WR3PY2L.require_execa)());
@@ -141,7 +141,7 @@ async function execaCommand({
141
141
  schemaEnginePath,
142
142
  engineCommandName
143
143
  }) {
144
- schemaEnginePath = schemaEnginePath || await (0, import_chunk_YBYBY7QI.resolveBinary)(import_fetch_engine.BinaryType.SchemaEngineBinary);
144
+ schemaEnginePath = schemaEnginePath || await (0, import_chunk_U4WXIU7C.resolveBinary)(import_fetch_engine.BinaryType.SchemaEngineBinary);
145
145
  try {
146
146
  return await (0, import_execa.default)(schemaEnginePath, ["cli", "--datasource", connectionString, engineCommandName], {
147
147
  cwd,
@@ -26,14 +26,14 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_RAC7G3AO_exports = {};
30
- __export(chunk_RAC7G3AO_exports, {
29
+ var chunk_UVLDTPOI_exports = {};
30
+ __export(chunk_UVLDTPOI_exports, {
31
31
  prismaSchemaWasm: () => import_prisma_schema_wasm.default,
32
32
  prismaSchemaWasmVersion: () => prismaSchemaWasmVersion,
33
33
  wasm_exports: () => wasm_exports
34
34
  });
35
- module.exports = __toCommonJS(chunk_RAC7G3AO_exports);
36
- var import_chunk_PIHBLNPJ = require("./chunk-PIHBLNPJ.js");
35
+ module.exports = __toCommonJS(chunk_UVLDTPOI_exports);
36
+ var import_chunk_OSAQY3IQ = require("./chunk-OSAQY3IQ.js");
37
37
  var import_chunk_WXRVYSYN = require("./chunk-WXRVYSYN.js");
38
38
  var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
39
39
  var import_prisma_schema_wasm = __toESM(require("@prisma/prisma-schema-wasm"));
@@ -42,6 +42,6 @@ var wasm_exports = {};
42
42
  prismaSchemaWasm: () => import_prisma_schema_wasm.default,
43
43
  prismaSchemaWasmVersion: () => prismaSchemaWasmVersion
44
44
  });
45
- var { dependencies } = (0, import_chunk_PIHBLNPJ.require_package)();
45
+ var { dependencies } = (0, import_chunk_OSAQY3IQ.require_package)();
46
46
  var prismaSchemaWasmVersion = dependencies["@prisma/prisma-schema-wasm"];
47
47
  globalThis.PRISMA_WASM_PANIC_REGISTRY = new import_chunk_WXRVYSYN.WasmPanicRegistry();
@@ -26,24 +26,23 @@ 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_X3CLVIIZ_exports = {};
30
- __export(chunk_X3CLVIIZ_exports, {
29
+ var chunk_VLBKBUPL_exports = {};
30
+ __export(chunk_VLBKBUPL_exports, {
31
31
  GetDmmfError: () => GetDmmfError,
32
32
  getDMMF: () => getDMMF
33
33
  });
34
- module.exports = __toCommonJS(chunk_X3CLVIIZ_exports);
34
+ module.exports = __toCommonJS(chunk_VLBKBUPL_exports);
35
35
  var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
36
- var import_chunk_PSYMCJ4B = require("./chunk-PSYMCJ4B.js");
36
+ var import_chunk_CMIKSBKL = require("./chunk-CMIKSBKL.js");
37
37
  var import_chunk_ZGAIRZ32 = require("./chunk-ZGAIRZ32.js");
38
38
  var import_chunk_QKPV6M3S = require("./chunk-QKPV6M3S.js");
39
39
  var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
40
40
  var import_chunk_R7U45FIQ = require("./chunk-R7U45FIQ.js");
41
41
  var import_chunk_CCQRDM7X = require("./chunk-CCQRDM7X.js");
42
- var import_chunk_7MD6344A = require("./chunk-7MD6344A.js");
42
+ var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
43
43
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
44
44
  var import_chunk_2ESYSVXG = require("./chunk-2ESYSVXG.js");
45
45
  var import_debug = __toESM(require("@prisma/debug"));
46
- var import_fs = __toESM(require("fs"));
47
46
  var import_function = (0, import_chunk_2ESYSVXG.__toESM)((0, import_chunk_ZGAIRZ32.require_function)());
48
47
  var debug = (0, import_debug.default)("prisma:getDMMF");
49
48
  var GetDmmfError = class extends Error {
@@ -65,79 +64,51 @@ ${detailsHeader} ${message}`;
65
64
  }
66
65
  };
67
66
  async function getDMMF(options) {
68
- const debugErrorType = (0, import_chunk_PSYMCJ4B.createDebugErrorType)(debug, "getDmmfWasm");
67
+ const debugErrorType = (0, import_chunk_CMIKSBKL.createDebugErrorType)(debug, "getDmmfWasm");
69
68
  debug(`Using getDmmf Wasm`);
70
69
  const dmmfPipeline = (0, import_function.pipe)(
71
- (0, import_chunk_7MD6344A.tryCatch2)(
70
+ (0, import_chunk_5DBOS77Y.tryCatch)(
72
71
  () => {
73
- if (options.datamodel) {
74
- debug("Using given datamodel");
75
- return Promise.resolve(options.datamodel);
72
+ if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
73
+ debug("Triggering a Rust panic...");
74
+ import_chunk_R7U45FIQ.prismaSchemaWasm.debug_panic();
76
75
  }
77
- debug(`Reading datamodel from the given datamodel path ${options.datamodelPath}`);
78
- return import_fs.default.promises.readFile(options.datamodelPath, { encoding: "utf-8" });
76
+ const params = JSON.stringify({
77
+ prismaSchema: options.datamodel,
78
+ noColor: Boolean(process.env.NO_COLOR)
79
+ });
80
+ const data = import_chunk_R7U45FIQ.prismaSchemaWasm.get_dmmf(params);
81
+ return data;
79
82
  },
80
83
  (e) => ({
81
- type: "read-datamodel-path",
82
- reason: "Error while trying to read the datamodel path",
83
- error: e,
84
- datamodelPath: options.datamodelPath
84
+ type: "wasm-error",
85
+ reason: "(get-dmmf wasm)",
86
+ error: e
85
87
  })
86
88
  ),
87
- (0, import_chunk_7MD6344A.chainW2)((datamodel) => {
88
- return (0, import_function.pipe)(
89
- (0, import_chunk_7MD6344A.tryCatch)(
90
- () => {
91
- if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
92
- debug("Triggering a Rust panic...");
93
- import_chunk_R7U45FIQ.prismaSchemaWasm.debug_panic();
94
- }
95
- const params = JSON.stringify({
96
- prismaSchema: datamodel,
97
- noColor: Boolean(process.env.NO_COLOR)
98
- });
99
- const data = import_chunk_R7U45FIQ.prismaSchemaWasm.get_dmmf(params);
100
- return data;
101
- },
89
+ (0, import_chunk_5DBOS77Y.map)((result) => ({ result })),
90
+ (0, import_chunk_5DBOS77Y.chainW)(
91
+ ({ result }) => (
92
+ // NOTE: this should never fail, as we expect returned values to be valid JSON-serializable strings
93
+ (0, import_chunk_5DBOS77Y.tryCatch)(
94
+ () => JSON.parse(result),
102
95
  (e) => ({
103
- type: "wasm-error",
104
- reason: "(get-dmmf wasm)",
96
+ type: "parse-json",
97
+ reason: "Unable to parse JSON",
105
98
  error: e
106
99
  })
107
- ),
108
- (0, import_chunk_7MD6344A.map)((result) => ({ result })),
109
- (0, import_chunk_7MD6344A.chainW)(
110
- ({ result }) => (
111
- // NOTE: this should never fail, as we expect returned values to be valid JSON-serializable strings
112
- (0, import_chunk_7MD6344A.tryCatch)(
113
- () => JSON.parse(result),
114
- (e) => ({
115
- type: "parse-json",
116
- reason: "Unable to parse JSON",
117
- error: e
118
- })
119
- )
120
- )
121
- ),
122
- import_chunk_7MD6344A.fromEither
123
- );
124
- })
100
+ )
101
+ )
102
+ ),
103
+ import_chunk_5DBOS77Y.fromEither
125
104
  );
126
105
  const dmmfEither = await dmmfPipeline();
127
- if ((0, import_chunk_7MD6344A.isRight)(dmmfEither)) {
106
+ if ((0, import_chunk_5DBOS77Y.isRight)(dmmfEither)) {
128
107
  debug("dmmf data retrieved without errors in getDmmf Wasm");
129
108
  const { right: data } = dmmfEither;
130
109
  return Promise.resolve(data);
131
110
  }
132
- const error = (0, import_chunk_XKZ6CBLA.z)(dmmfEither.left).with({ type: "read-datamodel-path" }, (e) => {
133
- debugErrorType(e);
134
- return new GetDmmfError({
135
- _tag: "unparsed",
136
- message: `${e.error.message}
137
- Datamodel path: "${e.datamodelPath}"`,
138
- reason: e.reason
139
- });
140
- }).with({ type: "wasm-error" }, (e) => {
111
+ const error = (0, import_chunk_XKZ6CBLA.z)(dmmfEither.left).with({ type: "wasm-error" }, (e) => {
141
112
  debugErrorType(e);
142
113
  if ((0, import_chunk_CCQRDM7X.isWasmPanic)(e.error)) {
143
114
  const { message, stack } = (0, import_chunk_CCQRDM7X.getWasmError)(e.error);
@@ -150,14 +121,14 @@ Datamodel path: "${e.datamodelPath}"`,
150
121
  "@prisma/prisma-schema-wasm get_dmmf",
151
122
  "FMT_CLI",
152
123
  /* schemaPath */
153
- options.prismaPath,
124
+ void 0,
154
125
  /* schema */
155
126
  (0, import_chunk_YRBRUREX.toMultipleSchemas)(options.datamodel)
156
127
  );
157
128
  return panic;
158
129
  }
159
130
  const errorOutput = e.error.message;
160
- return new GetDmmfError((0, import_chunk_PSYMCJ4B.parseQueryEngineError)({ errorOutput, reason: e.reason }));
131
+ return new GetDmmfError((0, import_chunk_CMIKSBKL.parseQueryEngineError)({ errorOutput, reason: e.reason }));
161
132
  }).with({ type: "parse-json" }, (e) => {
162
133
  debugErrorType(e);
163
134
  return new GetDmmfError({ _tag: "unparsed", message: e.error.message, reason: e.reason });