@prisma/internals 6.4.0-integration-fix-accelerate-engine-crash-policy.1 → 6.4.0-integration-engines-6-4-0-28-integration-sql-nested-transactions-fba3682185fb5027c810216c59359fba8e1cdbb3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/{chunk-I7UL7OEG.js → chunk-2MZLRA7Z.js} +5 -5
  2. package/dist/{chunk-3LNPEIUN.js → chunk-3SBTJPC7.js} +5 -5
  3. package/dist/{chunk-5YRXRPXS.js → chunk-4I5XU2SS.js} +5 -5
  4. package/dist/{chunk-2KEVLZYL.js → chunk-4P3WDFRF.js} +169 -150
  5. package/dist/{chunk-EEOINYRO.js → chunk-CMTV7T2S.js} +169 -150
  6. package/dist/{chunk-4CZFQN6J.js → chunk-COAPRZ2S.js} +5 -4
  7. package/dist/{chunk-PJXPWN5H.js → chunk-G5UYUVSB.js} +5 -5
  8. package/dist/{chunk-6D2ZAHFY.js → chunk-GICTCYHW.js} +6 -5
  9. package/dist/{chunk-3BLP5EHV.js → chunk-HGUZSEWG.js} +8 -8
  10. package/dist/{chunk-HR324QCR.js → chunk-JH3RE3C7.js} +5 -5
  11. package/dist/{chunk-SU73IGOR.js → chunk-LBVSPAZX.js} +7 -7
  12. package/dist/{chunk-F6CEQGHA.js → chunk-LN2MY5JA.js} +8 -8
  13. package/dist/{chunk-M5RRWJSA.js → chunk-LS4ENWFP.js} +5 -5
  14. package/dist/{chunk-NMZBGBOC.js → chunk-OMHCKFM5.js} +8 -8
  15. package/dist/{chunk-HQWDJ6OM.js → chunk-PTT3EYVI.js} +5 -5
  16. package/dist/{chunk-MKVMJAFE.js → chunk-PXMP5I7Y.js} +8 -8
  17. package/dist/{chunk-UHU6YB7U.js → chunk-Q57LPMAX.js} +8 -8
  18. package/dist/{chunk-IVGHLLOG.js → chunk-RKXUSJ5G.js} +8 -8
  19. package/dist/{chunk-ECCMQHHG.js → chunk-SUNGVJG6.js} +7 -7
  20. package/dist/{chunk-RGTLYBU6.js → chunk-WZH233KP.js} +5 -5
  21. package/dist/cli/checkUnsupportedDataProxy.d.ts +2 -1
  22. package/dist/cli/checkUnsupportedDataProxy.js +12 -12
  23. package/dist/cli/getSchema.d.ts +20 -37
  24. package/dist/cli/getSchema.js +16 -17
  25. package/dist/cli/hashes.d.ts +2 -1
  26. package/dist/cli/hashes.js +12 -12
  27. package/dist/cli/types.d.ts +2 -1
  28. package/dist/engine-commands/errorHelpers.js +4 -4
  29. package/dist/engine-commands/formatSchema.js +11 -11
  30. package/dist/engine-commands/getConfig.js +10 -10
  31. package/dist/engine-commands/getDmmf.js +7 -7
  32. package/dist/engine-commands/index.js +20 -20
  33. package/dist/engine-commands/lintSchema.js +8 -8
  34. package/dist/engine-commands/mergeSchemas.js +7 -7
  35. package/dist/engine-commands/validate.js +7 -7
  36. package/dist/get-generators/generatorResolvers/generatorResolvers.js +11 -11
  37. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +11 -11
  38. package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +12 -12
  39. package/dist/get-generators/getGenerators.js +14 -14
  40. package/dist/index.d.ts +2 -1
  41. package/dist/index.js +39 -39
  42. package/dist/sendPanic.js +11 -11
  43. package/dist/utils/getEnvPaths.js +11 -11
  44. package/dist/utils/getVersionFromPackageJson.js +3 -3
  45. package/dist/utils/handlePanic.js +11 -11
  46. package/dist/utils/loadEnvFile.d.ts +4 -2
  47. package/dist/utils/loadEnvFile.js +11 -11
  48. package/dist/utils/toSchemasContainer.d.ts +1 -1
  49. package/dist/wasm.js +4 -4
  50. package/package.json +9 -8
@@ -26,11 +26,11 @@ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__g
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS2 = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_EEOINYRO_exports = {};
30
- __export2(chunk_EEOINYRO_exports, {
29
+ var chunk_CMTV7T2S_exports = {};
30
+ __export2(chunk_CMTV7T2S_exports, {
31
31
  checkTypeScriptVersion: () => checkTypeScriptVersion,
32
32
  checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
33
- debug: () => debug5,
33
+ debug: () => debug6,
34
34
  forbiddenCmdWithDataProxyFlagMessage: () => forbiddenCmdWithDataProxyFlagMessage,
35
35
  formatSchema: () => formatSchema,
36
36
  generatorResolvers: () => generatorResolvers,
@@ -51,11 +51,10 @@ __export2(chunk_EEOINYRO_exports, {
51
51
  knownBinaryTargets: () => knownBinaryTargets,
52
52
  loadEnvFile: () => loadEnvFile,
53
53
  prismaClientResolver: () => prismaClientResolver,
54
- readSchemaFromSingleFile: () => readSchemaFromSingleFile,
55
54
  sendPanic: () => sendPanic,
56
55
  skipIndex: () => skipIndex
57
56
  });
58
- module.exports = __toCommonJS2(chunk_EEOINYRO_exports);
57
+ module.exports = __toCommonJS2(chunk_CMTV7T2S_exports);
59
58
  var import_chunk_EUTJYQDW = require("./chunk-EUTJYQDW.js");
60
59
  var import_chunk_IPKE37QC = require("./chunk-IPKE37QC.js");
61
60
  var import_chunk_PIPE5DSU = require("./chunk-PIPE5DSU.js");
@@ -80,14 +79,13 @@ var import_chunk_AC6EAR56 = require("./chunk-AC6EAR56.js");
80
79
  var import_chunk_EPJYKNCQ = require("./chunk-EPJYKNCQ.js");
81
80
  var import_chunk_ODI3VNBD = require("./chunk-ODI3VNBD.js");
82
81
  var import_chunk_TSJICM5S = require("./chunk-TSJICM5S.js");
83
- var import_chunk_RGTLYBU6 = require("./chunk-RGTLYBU6.js");
84
- var import_chunk_ECCMQHHG = require("./chunk-ECCMQHHG.js");
85
- var import_chunk_MUPZUVSI = require("./chunk-MUPZUVSI.js");
86
- var import_chunk_IVGHLLOG = require("./chunk-IVGHLLOG.js");
87
- var import_chunk_F6CEQGHA = require("./chunk-F6CEQGHA.js");
82
+ var import_chunk_2MZLRA7Z = require("./chunk-2MZLRA7Z.js");
83
+ var import_chunk_LBVSPAZX = require("./chunk-LBVSPAZX.js");
84
+ var import_chunk_RKXUSJ5G = require("./chunk-RKXUSJ5G.js");
85
+ var import_chunk_OMHCKFM5 = require("./chunk-OMHCKFM5.js");
88
86
  var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
89
87
  var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
90
- var import_chunk_M5RRWJSA = require("./chunk-M5RRWJSA.js");
88
+ var import_chunk_3SBTJPC7 = require("./chunk-3SBTJPC7.js");
91
89
  var import_chunk_A4QWQE3W = require("./chunk-A4QWQE3W.js");
92
90
  var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
93
91
  var import_chunk_QIVUAERL = require("./chunk-QIVUAERL.js");
@@ -102,25 +100,27 @@ var import_chunk_AZNLB67U = require("./chunk-AZNLB67U.js");
102
100
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
103
101
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
104
102
  var import_debug = __toESM2(require("@prisma/debug"));
103
+ var import_config = require("@prisma/config");
105
104
  var import_fs = __toESM2(require("fs"));
106
105
  var import_debug2 = __toESM2(require("@prisma/debug"));
106
+ var import_debug3 = __toESM2(require("@prisma/debug"));
107
107
  var import_fs2 = __toESM2(require("fs"));
108
108
  var import_path = __toESM2(require("path"));
109
- var import_debug3 = require("@prisma/debug");
109
+ var import_debug4 = require("@prisma/debug");
110
110
  var import_schema_files_loader = require("@prisma/schema-files-loader");
111
111
  var import_fs3 = __toESM2(require("fs"));
112
112
  var import_path2 = __toESM2(require("path"));
113
113
  var import_util = require("util");
114
114
  var import_crypto = __toESM2(require("crypto"));
115
- var import_debug4 = __toESM2(require("@prisma/debug"));
115
+ var import_debug5 = __toESM2(require("@prisma/debug"));
116
116
  var import_engines = require("@prisma/engines");
117
117
  var import_fetch_engine = require("@prisma/fetch-engine");
118
118
  var import_get_platform = require("@prisma/get-platform");
119
119
  var import_path3 = __toESM2(require("path"));
120
- var import_debug5 = __toESM2(require("@prisma/debug"));
120
+ var import_debug6 = __toESM2(require("@prisma/debug"));
121
121
  var import_fs4 = __toESM2(require("fs"));
122
122
  var import_path4 = __toESM2(require("path"));
123
- var import_debug6 = __toESM2(require("@prisma/debug"));
123
+ var import_debug7 = __toESM2(require("@prisma/debug"));
124
124
  var import_fs5 = __toESM2(require("fs"));
125
125
  var import_path5 = __toESM2(require("path"));
126
126
  var import_get_platform2 = require("@prisma/get-platform");
@@ -3611,11 +3611,11 @@ var require_stream_readable = (0, import_chunk_WWAWV7DQ.__commonJS)({
3611
3611
  var util = Object.create(require_util());
3612
3612
  util.inherits = (0, import_chunk_RL3K4V2J.require_inherits)();
3613
3613
  var debugUtil = (0, import_chunk_WWAWV7DQ.__require)("util");
3614
- var debug8 = void 0;
3614
+ var debug9 = void 0;
3615
3615
  if (debugUtil && debugUtil.debuglog) {
3616
- debug8 = debugUtil.debuglog("stream");
3616
+ debug9 = debugUtil.debuglog("stream");
3617
3617
  } else {
3618
- debug8 = function() {
3618
+ debug9 = function() {
3619
3619
  };
3620
3620
  }
3621
3621
  var BufferList = require_BufferList();
@@ -3815,13 +3815,13 @@ var require_stream_readable = (0, import_chunk_WWAWV7DQ.__commonJS)({
3815
3815
  return state.length;
3816
3816
  }
3817
3817
  Readable.prototype.read = function(n) {
3818
- debug8("read", n);
3818
+ debug9("read", n);
3819
3819
  n = parseInt(n, 10);
3820
3820
  var state = this._readableState;
3821
3821
  var nOrig = n;
3822
3822
  if (n !== 0) state.emittedReadable = false;
3823
3823
  if (n === 0 && state.needReadable && (state.length >= state.highWaterMark || state.ended)) {
3824
- debug8("read: emitReadable", state.length, state.ended);
3824
+ debug9("read: emitReadable", state.length, state.ended);
3825
3825
  if (state.length === 0 && state.ended) endReadable(this);
3826
3826
  else emitReadable(this);
3827
3827
  return null;
@@ -3832,16 +3832,16 @@ var require_stream_readable = (0, import_chunk_WWAWV7DQ.__commonJS)({
3832
3832
  return null;
3833
3833
  }
3834
3834
  var doRead = state.needReadable;
3835
- debug8("need readable", doRead);
3835
+ debug9("need readable", doRead);
3836
3836
  if (state.length === 0 || state.length - n < state.highWaterMark) {
3837
3837
  doRead = true;
3838
- debug8("length less than watermark", doRead);
3838
+ debug9("length less than watermark", doRead);
3839
3839
  }
3840
3840
  if (state.ended || state.reading) {
3841
3841
  doRead = false;
3842
- debug8("reading or ended", doRead);
3842
+ debug9("reading or ended", doRead);
3843
3843
  } else if (doRead) {
3844
- debug8("do read");
3844
+ debug9("do read");
3845
3845
  state.reading = true;
3846
3846
  state.sync = true;
3847
3847
  if (state.length === 0) state.needReadable = true;
@@ -3881,14 +3881,14 @@ var require_stream_readable = (0, import_chunk_WWAWV7DQ.__commonJS)({
3881
3881
  var state = stream._readableState;
3882
3882
  state.needReadable = false;
3883
3883
  if (!state.emittedReadable) {
3884
- debug8("emitReadable", state.flowing);
3884
+ debug9("emitReadable", state.flowing);
3885
3885
  state.emittedReadable = true;
3886
3886
  if (state.sync) pna.nextTick(emitReadable_, stream);
3887
3887
  else emitReadable_(stream);
3888
3888
  }
3889
3889
  }
3890
3890
  function emitReadable_(stream) {
3891
- debug8("emit readable");
3891
+ debug9("emit readable");
3892
3892
  stream.emit("readable");
3893
3893
  flow(stream);
3894
3894
  }
@@ -3901,7 +3901,7 @@ var require_stream_readable = (0, import_chunk_WWAWV7DQ.__commonJS)({
3901
3901
  function maybeReadMore_(stream, state) {
3902
3902
  var len = state.length;
3903
3903
  while (!state.reading && !state.flowing && !state.ended && state.length < state.highWaterMark) {
3904
- debug8("maybeReadMore read 0");
3904
+ debug9("maybeReadMore read 0");
3905
3905
  stream.read(0);
3906
3906
  if (len === state.length)
3907
3907
  break;
@@ -3927,14 +3927,14 @@ var require_stream_readable = (0, import_chunk_WWAWV7DQ.__commonJS)({
3927
3927
  break;
3928
3928
  }
3929
3929
  state.pipesCount += 1;
3930
- debug8("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
3930
+ debug9("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
3931
3931
  var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
3932
3932
  var endFn = doEnd ? onend : unpipe;
3933
3933
  if (state.endEmitted) pna.nextTick(endFn);
3934
3934
  else src.once("end", endFn);
3935
3935
  dest.on("unpipe", onunpipe);
3936
3936
  function onunpipe(readable, unpipeInfo) {
3937
- debug8("onunpipe");
3937
+ debug9("onunpipe");
3938
3938
  if (readable === src) {
3939
3939
  if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
3940
3940
  unpipeInfo.hasUnpiped = true;
@@ -3943,14 +3943,14 @@ var require_stream_readable = (0, import_chunk_WWAWV7DQ.__commonJS)({
3943
3943
  }
3944
3944
  }
3945
3945
  function onend() {
3946
- debug8("onend");
3946
+ debug9("onend");
3947
3947
  dest.end();
3948
3948
  }
3949
3949
  var ondrain = pipeOnDrain(src);
3950
3950
  dest.on("drain", ondrain);
3951
3951
  var cleanedUp = false;
3952
3952
  function cleanup() {
3953
- debug8("cleanup");
3953
+ debug9("cleanup");
3954
3954
  dest.removeListener("close", onclose);
3955
3955
  dest.removeListener("finish", onfinish);
3956
3956
  dest.removeListener("drain", ondrain);
@@ -3965,12 +3965,12 @@ var require_stream_readable = (0, import_chunk_WWAWV7DQ.__commonJS)({
3965
3965
  var increasedAwaitDrain = false;
3966
3966
  src.on("data", ondata);
3967
3967
  function ondata(chunk) {
3968
- debug8("ondata");
3968
+ debug9("ondata");
3969
3969
  increasedAwaitDrain = false;
3970
3970
  var ret = dest.write(chunk);
3971
3971
  if (false === ret && !increasedAwaitDrain) {
3972
3972
  if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
3973
- debug8("false write response, pause", src._readableState.awaitDrain);
3973
+ debug9("false write response, pause", src._readableState.awaitDrain);
3974
3974
  src._readableState.awaitDrain++;
3975
3975
  increasedAwaitDrain = true;
3976
3976
  }
@@ -3978,7 +3978,7 @@ var require_stream_readable = (0, import_chunk_WWAWV7DQ.__commonJS)({
3978
3978
  }
3979
3979
  }
3980
3980
  function onerror(er) {
3981
- debug8("onerror", er);
3981
+ debug9("onerror", er);
3982
3982
  unpipe();
3983
3983
  dest.removeListener("error", onerror);
3984
3984
  if (EElistenerCount(dest, "error") === 0) dest.emit("error", er);
@@ -3990,18 +3990,18 @@ var require_stream_readable = (0, import_chunk_WWAWV7DQ.__commonJS)({
3990
3990
  }
3991
3991
  dest.once("close", onclose);
3992
3992
  function onfinish() {
3993
- debug8("onfinish");
3993
+ debug9("onfinish");
3994
3994
  dest.removeListener("close", onclose);
3995
3995
  unpipe();
3996
3996
  }
3997
3997
  dest.once("finish", onfinish);
3998
3998
  function unpipe() {
3999
- debug8("unpipe");
3999
+ debug9("unpipe");
4000
4000
  src.unpipe(dest);
4001
4001
  }
4002
4002
  dest.emit("pipe", src);
4003
4003
  if (!state.flowing) {
4004
- debug8("pipe resume");
4004
+ debug9("pipe resume");
4005
4005
  src.resume();
4006
4006
  }
4007
4007
  return dest;
@@ -4009,7 +4009,7 @@ var require_stream_readable = (0, import_chunk_WWAWV7DQ.__commonJS)({
4009
4009
  function pipeOnDrain(src) {
4010
4010
  return function() {
4011
4011
  var state = src._readableState;
4012
- debug8("pipeOnDrain", state.awaitDrain);
4012
+ debug9("pipeOnDrain", state.awaitDrain);
4013
4013
  if (state.awaitDrain) state.awaitDrain--;
4014
4014
  if (state.awaitDrain === 0 && EElistenerCount(src, "data")) {
4015
4015
  state.flowing = true;
@@ -4069,13 +4069,13 @@ var require_stream_readable = (0, import_chunk_WWAWV7DQ.__commonJS)({
4069
4069
  };
4070
4070
  Readable.prototype.addListener = Readable.prototype.on;
4071
4071
  function nReadingNextTick(self2) {
4072
- debug8("readable nexttick read 0");
4072
+ debug9("readable nexttick read 0");
4073
4073
  self2.read(0);
4074
4074
  }
4075
4075
  Readable.prototype.resume = function() {
4076
4076
  var state = this._readableState;
4077
4077
  if (!state.flowing) {
4078
- debug8("resume");
4078
+ debug9("resume");
4079
4079
  state.flowing = true;
4080
4080
  resume(this, state);
4081
4081
  }
@@ -4089,7 +4089,7 @@ var require_stream_readable = (0, import_chunk_WWAWV7DQ.__commonJS)({
4089
4089
  }
4090
4090
  function resume_(stream, state) {
4091
4091
  if (!state.reading) {
4092
- debug8("resume read 0");
4092
+ debug9("resume read 0");
4093
4093
  stream.read(0);
4094
4094
  }
4095
4095
  state.resumeScheduled = false;
@@ -4099,9 +4099,9 @@ var require_stream_readable = (0, import_chunk_WWAWV7DQ.__commonJS)({
4099
4099
  if (state.flowing && !state.reading) stream.read(0);
4100
4100
  }
4101
4101
  Readable.prototype.pause = function() {
4102
- debug8("call pause flowing=%j", this._readableState.flowing);
4102
+ debug9("call pause flowing=%j", this._readableState.flowing);
4103
4103
  if (false !== this._readableState.flowing) {
4104
- debug8("pause");
4104
+ debug9("pause");
4105
4105
  this._readableState.flowing = false;
4106
4106
  this.emit("pause");
4107
4107
  }
@@ -4109,7 +4109,7 @@ var require_stream_readable = (0, import_chunk_WWAWV7DQ.__commonJS)({
4109
4109
  };
4110
4110
  function flow(stream) {
4111
4111
  var state = stream._readableState;
4112
- debug8("flow", state.flowing);
4112
+ debug9("flow", state.flowing);
4113
4113
  while (state.flowing && stream.read() !== null) {
4114
4114
  }
4115
4115
  }
@@ -4118,7 +4118,7 @@ var require_stream_readable = (0, import_chunk_WWAWV7DQ.__commonJS)({
4118
4118
  var state = this._readableState;
4119
4119
  var paused = false;
4120
4120
  stream.on("end", function() {
4121
- debug8("wrapped end");
4121
+ debug9("wrapped end");
4122
4122
  if (state.decoder && !state.ended) {
4123
4123
  var chunk = state.decoder.end();
4124
4124
  if (chunk && chunk.length) _this.push(chunk);
@@ -4126,7 +4126,7 @@ var require_stream_readable = (0, import_chunk_WWAWV7DQ.__commonJS)({
4126
4126
  _this.push(null);
4127
4127
  });
4128
4128
  stream.on("data", function(chunk) {
4129
- debug8("wrapped data");
4129
+ debug9("wrapped data");
4130
4130
  if (state.decoder) chunk = state.decoder.write(chunk);
4131
4131
  if (state.objectMode && (chunk === null || chunk === void 0)) return;
4132
4132
  else if (!state.objectMode && (!chunk || !chunk.length)) return;
@@ -4149,7 +4149,7 @@ var require_stream_readable = (0, import_chunk_WWAWV7DQ.__commonJS)({
4149
4149
  stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
4150
4150
  }
4151
4151
  this._read = function(n2) {
4152
- debug8("wrapped _read", n2);
4152
+ debug9("wrapped _read", n2);
4153
4153
  if (paused) {
4154
4154
  paused = false;
4155
4155
  stream.resume();
@@ -6860,11 +6860,11 @@ var require_stream_readable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
6860
6860
  return Buffer2.isBuffer(obj) || obj instanceof OurUint8Array;
6861
6861
  }
6862
6862
  var debugUtil = (0, import_chunk_WWAWV7DQ.__require)("util");
6863
- var debug8;
6863
+ var debug9;
6864
6864
  if (debugUtil && debugUtil.debuglog) {
6865
- debug8 = debugUtil.debuglog("stream");
6865
+ debug9 = debugUtil.debuglog("stream");
6866
6866
  } else {
6867
- debug8 = function debug9() {
6867
+ debug9 = function debug10() {
6868
6868
  };
6869
6869
  }
6870
6870
  var BufferList = require_buffer_list();
@@ -6979,7 +6979,7 @@ var require_stream_readable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
6979
6979
  return readableAddChunk(this, chunk, null, true, false);
6980
6980
  };
6981
6981
  function readableAddChunk(stream, chunk, encoding, addToFront, skipChunkCheck) {
6982
- debug8("readableAddChunk", chunk);
6982
+ debug9("readableAddChunk", chunk);
6983
6983
  var state = stream._readableState;
6984
6984
  if (chunk === null) {
6985
6985
  state.reading = false;
@@ -7086,13 +7086,13 @@ var require_stream_readable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
7086
7086
  return state.length;
7087
7087
  }
7088
7088
  Readable.prototype.read = function(n) {
7089
- debug8("read", n);
7089
+ debug9("read", n);
7090
7090
  n = parseInt(n, 10);
7091
7091
  var state = this._readableState;
7092
7092
  var nOrig = n;
7093
7093
  if (n !== 0) state.emittedReadable = false;
7094
7094
  if (n === 0 && state.needReadable && ((state.highWaterMark !== 0 ? state.length >= state.highWaterMark : state.length > 0) || state.ended)) {
7095
- debug8("read: emitReadable", state.length, state.ended);
7095
+ debug9("read: emitReadable", state.length, state.ended);
7096
7096
  if (state.length === 0 && state.ended) endReadable(this);
7097
7097
  else emitReadable(this);
7098
7098
  return null;
@@ -7103,16 +7103,16 @@ var require_stream_readable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
7103
7103
  return null;
7104
7104
  }
7105
7105
  var doRead = state.needReadable;
7106
- debug8("need readable", doRead);
7106
+ debug9("need readable", doRead);
7107
7107
  if (state.length === 0 || state.length - n < state.highWaterMark) {
7108
7108
  doRead = true;
7109
- debug8("length less than watermark", doRead);
7109
+ debug9("length less than watermark", doRead);
7110
7110
  }
7111
7111
  if (state.ended || state.reading) {
7112
7112
  doRead = false;
7113
- debug8("reading or ended", doRead);
7113
+ debug9("reading or ended", doRead);
7114
7114
  } else if (doRead) {
7115
- debug8("do read");
7115
+ debug9("do read");
7116
7116
  state.reading = true;
7117
7117
  state.sync = true;
7118
7118
  if (state.length === 0) state.needReadable = true;
@@ -7138,7 +7138,7 @@ var require_stream_readable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
7138
7138
  return ret;
7139
7139
  };
7140
7140
  function onEofChunk(stream, state) {
7141
- debug8("onEofChunk");
7141
+ debug9("onEofChunk");
7142
7142
  if (state.ended) return;
7143
7143
  if (state.decoder) {
7144
7144
  var chunk = state.decoder.end();
@@ -7160,17 +7160,17 @@ var require_stream_readable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
7160
7160
  }
7161
7161
  function emitReadable(stream) {
7162
7162
  var state = stream._readableState;
7163
- debug8("emitReadable", state.needReadable, state.emittedReadable);
7163
+ debug9("emitReadable", state.needReadable, state.emittedReadable);
7164
7164
  state.needReadable = false;
7165
7165
  if (!state.emittedReadable) {
7166
- debug8("emitReadable", state.flowing);
7166
+ debug9("emitReadable", state.flowing);
7167
7167
  state.emittedReadable = true;
7168
7168
  process.nextTick(emitReadable_, stream);
7169
7169
  }
7170
7170
  }
7171
7171
  function emitReadable_(stream) {
7172
7172
  var state = stream._readableState;
7173
- debug8("emitReadable_", state.destroyed, state.length, state.ended);
7173
+ debug9("emitReadable_", state.destroyed, state.length, state.ended);
7174
7174
  if (!state.destroyed && (state.length || state.ended)) {
7175
7175
  stream.emit("readable");
7176
7176
  state.emittedReadable = false;
@@ -7187,7 +7187,7 @@ var require_stream_readable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
7187
7187
  function maybeReadMore_(stream, state) {
7188
7188
  while (!state.reading && !state.ended && (state.length < state.highWaterMark || state.flowing && state.length === 0)) {
7189
7189
  var len = state.length;
7190
- debug8("maybeReadMore read 0");
7190
+ debug9("maybeReadMore read 0");
7191
7191
  stream.read(0);
7192
7192
  if (len === state.length)
7193
7193
  break;
@@ -7212,14 +7212,14 @@ var require_stream_readable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
7212
7212
  break;
7213
7213
  }
7214
7214
  state.pipesCount += 1;
7215
- debug8("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
7215
+ debug9("pipe count=%d opts=%j", state.pipesCount, pipeOpts);
7216
7216
  var doEnd = (!pipeOpts || pipeOpts.end !== false) && dest !== process.stdout && dest !== process.stderr;
7217
7217
  var endFn = doEnd ? onend : unpipe;
7218
7218
  if (state.endEmitted) process.nextTick(endFn);
7219
7219
  else src.once("end", endFn);
7220
7220
  dest.on("unpipe", onunpipe);
7221
7221
  function onunpipe(readable, unpipeInfo) {
7222
- debug8("onunpipe");
7222
+ debug9("onunpipe");
7223
7223
  if (readable === src) {
7224
7224
  if (unpipeInfo && unpipeInfo.hasUnpiped === false) {
7225
7225
  unpipeInfo.hasUnpiped = true;
@@ -7228,14 +7228,14 @@ var require_stream_readable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
7228
7228
  }
7229
7229
  }
7230
7230
  function onend() {
7231
- debug8("onend");
7231
+ debug9("onend");
7232
7232
  dest.end();
7233
7233
  }
7234
7234
  var ondrain = pipeOnDrain(src);
7235
7235
  dest.on("drain", ondrain);
7236
7236
  var cleanedUp = false;
7237
7237
  function cleanup() {
7238
- debug8("cleanup");
7238
+ debug9("cleanup");
7239
7239
  dest.removeListener("close", onclose);
7240
7240
  dest.removeListener("finish", onfinish);
7241
7241
  dest.removeListener("drain", ondrain);
@@ -7249,19 +7249,19 @@ var require_stream_readable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
7249
7249
  }
7250
7250
  src.on("data", ondata);
7251
7251
  function ondata(chunk) {
7252
- debug8("ondata");
7252
+ debug9("ondata");
7253
7253
  var ret = dest.write(chunk);
7254
- debug8("dest.write", ret);
7254
+ debug9("dest.write", ret);
7255
7255
  if (ret === false) {
7256
7256
  if ((state.pipesCount === 1 && state.pipes === dest || state.pipesCount > 1 && indexOf(state.pipes, dest) !== -1) && !cleanedUp) {
7257
- debug8("false write response, pause", state.awaitDrain);
7257
+ debug9("false write response, pause", state.awaitDrain);
7258
7258
  state.awaitDrain++;
7259
7259
  }
7260
7260
  src.pause();
7261
7261
  }
7262
7262
  }
7263
7263
  function onerror(er) {
7264
- debug8("onerror", er);
7264
+ debug9("onerror", er);
7265
7265
  unpipe();
7266
7266
  dest.removeListener("error", onerror);
7267
7267
  if (EElistenerCount(dest, "error") === 0) errorOrDestroy(dest, er);
@@ -7273,18 +7273,18 @@ var require_stream_readable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
7273
7273
  }
7274
7274
  dest.once("close", onclose);
7275
7275
  function onfinish() {
7276
- debug8("onfinish");
7276
+ debug9("onfinish");
7277
7277
  dest.removeListener("close", onclose);
7278
7278
  unpipe();
7279
7279
  }
7280
7280
  dest.once("finish", onfinish);
7281
7281
  function unpipe() {
7282
- debug8("unpipe");
7282
+ debug9("unpipe");
7283
7283
  src.unpipe(dest);
7284
7284
  }
7285
7285
  dest.emit("pipe", src);
7286
7286
  if (!state.flowing) {
7287
- debug8("pipe resume");
7287
+ debug9("pipe resume");
7288
7288
  src.resume();
7289
7289
  }
7290
7290
  return dest;
@@ -7292,7 +7292,7 @@ var require_stream_readable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
7292
7292
  function pipeOnDrain(src) {
7293
7293
  return function pipeOnDrainFunctionResult() {
7294
7294
  var state = src._readableState;
7295
- debug8("pipeOnDrain", state.awaitDrain);
7295
+ debug9("pipeOnDrain", state.awaitDrain);
7296
7296
  if (state.awaitDrain) state.awaitDrain--;
7297
7297
  if (state.awaitDrain === 0 && EElistenerCount(src, "data")) {
7298
7298
  state.flowing = true;
@@ -7347,7 +7347,7 @@ var require_stream_readable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
7347
7347
  state.readableListening = state.needReadable = true;
7348
7348
  state.flowing = false;
7349
7349
  state.emittedReadable = false;
7350
- debug8("on readable", state.length, state.reading);
7350
+ debug9("on readable", state.length, state.reading);
7351
7351
  if (state.length) {
7352
7352
  emitReadable(this);
7353
7353
  } else if (!state.reading) {
@@ -7382,13 +7382,13 @@ var require_stream_readable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
7382
7382
  }
7383
7383
  }
7384
7384
  function nReadingNextTick(self2) {
7385
- debug8("readable nexttick read 0");
7385
+ debug9("readable nexttick read 0");
7386
7386
  self2.read(0);
7387
7387
  }
7388
7388
  Readable.prototype.resume = function() {
7389
7389
  var state = this._readableState;
7390
7390
  if (!state.flowing) {
7391
- debug8("resume");
7391
+ debug9("resume");
7392
7392
  state.flowing = !state.readableListening;
7393
7393
  resume(this, state);
7394
7394
  }
@@ -7402,7 +7402,7 @@ var require_stream_readable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
7402
7402
  }
7403
7403
  }
7404
7404
  function resume_(stream, state) {
7405
- debug8("resume", state.reading);
7405
+ debug9("resume", state.reading);
7406
7406
  if (!state.reading) {
7407
7407
  stream.read(0);
7408
7408
  }
@@ -7412,9 +7412,9 @@ var require_stream_readable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
7412
7412
  if (state.flowing && !state.reading) stream.read(0);
7413
7413
  }
7414
7414
  Readable.prototype.pause = function() {
7415
- debug8("call pause flowing=%j", this._readableState.flowing);
7415
+ debug9("call pause flowing=%j", this._readableState.flowing);
7416
7416
  if (this._readableState.flowing !== false) {
7417
- debug8("pause");
7417
+ debug9("pause");
7418
7418
  this._readableState.flowing = false;
7419
7419
  this.emit("pause");
7420
7420
  }
@@ -7423,7 +7423,7 @@ var require_stream_readable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
7423
7423
  };
7424
7424
  function flow(stream) {
7425
7425
  var state = stream._readableState;
7426
- debug8("flow", state.flowing);
7426
+ debug9("flow", state.flowing);
7427
7427
  while (state.flowing && stream.read() !== null) {
7428
7428
  ;
7429
7429
  }
@@ -7433,7 +7433,7 @@ var require_stream_readable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
7433
7433
  var state = this._readableState;
7434
7434
  var paused = false;
7435
7435
  stream.on("end", function() {
7436
- debug8("wrapped end");
7436
+ debug9("wrapped end");
7437
7437
  if (state.decoder && !state.ended) {
7438
7438
  var chunk = state.decoder.end();
7439
7439
  if (chunk && chunk.length) _this.push(chunk);
@@ -7441,7 +7441,7 @@ var require_stream_readable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
7441
7441
  _this.push(null);
7442
7442
  });
7443
7443
  stream.on("data", function(chunk) {
7444
- debug8("wrapped data");
7444
+ debug9("wrapped data");
7445
7445
  if (state.decoder) chunk = state.decoder.write(chunk);
7446
7446
  if (state.objectMode && (chunk === null || chunk === void 0)) return;
7447
7447
  else if (!state.objectMode && (!chunk || !chunk.length)) return;
@@ -7464,7 +7464,7 @@ var require_stream_readable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
7464
7464
  stream.on(kProxyEvents[n], this.emit.bind(this, kProxyEvents[n]));
7465
7465
  }
7466
7466
  this._read = function(n2) {
7467
- debug8("wrapped _read", n2);
7467
+ debug9("wrapped _read", n2);
7468
7468
  if (paused) {
7469
7469
  paused = false;
7470
7470
  stream.resume();
@@ -7538,14 +7538,14 @@ var require_stream_readable2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
7538
7538
  }
7539
7539
  function endReadable(stream) {
7540
7540
  var state = stream._readableState;
7541
- debug8("endReadable", state.endEmitted);
7541
+ debug9("endReadable", state.endEmitted);
7542
7542
  if (!state.endEmitted) {
7543
7543
  state.ended = true;
7544
7544
  process.nextTick(endReadableNT, state, stream);
7545
7545
  }
7546
7546
  }
7547
7547
  function endReadableNT(state, stream) {
7548
- debug8("endReadableNT", state.endEmitted, state.length);
7548
+ debug9("endReadableNT", state.endEmitted, state.length);
7549
7549
  if (!state.endEmitted && state.length === 0) {
7550
7550
  state.endEmitted = true;
7551
7551
  stream.readable = false;
@@ -13542,7 +13542,7 @@ var require_dist = (0, import_chunk_WWAWV7DQ.__commonJS)({
13542
13542
  var re$1 = { exports: {} };
13543
13543
  (function(module2, exports2) {
13544
13544
  const { MAX_SAFE_COMPONENT_LENGTH: MAX_SAFE_COMPONENT_LENGTH2, MAX_SAFE_BUILD_LENGTH: MAX_SAFE_BUILD_LENGTH2 } = constants;
13545
- const debug8 = debug_1;
13545
+ const debug9 = debug_1;
13546
13546
  exports2 = module2.exports = {};
13547
13547
  const re2 = exports2.re = [];
13548
13548
  const safeRe = exports2.safeRe = [];
@@ -13564,7 +13564,7 @@ var require_dist = (0, import_chunk_WWAWV7DQ.__commonJS)({
13564
13564
  const createToken = (name, value, isGlobal) => {
13565
13565
  const safe = makeSafeRegex(value);
13566
13566
  const index2 = R++;
13567
- debug8(name, index2, value);
13567
+ debug9(name, index2, value);
13568
13568
  t2[name] = index2;
13569
13569
  src[index2] = value;
13570
13570
  re2[index2] = new RegExp(value, isGlobal ? "g" : void 0);
@@ -14715,16 +14715,16 @@ var require_tmp = (0, import_chunk_WWAWV7DQ.__commonJS)({
14715
14715
  var import_find_up = (0, import_chunk_WWAWV7DQ.__toESM)(require_find_up());
14716
14716
  var readFile = (0, import_util.promisify)(import_fs3.default.readFile);
14717
14717
  var stat = (0, import_util.promisify)(import_fs3.default.stat);
14718
- var debug2 = (0, import_debug3.Debug)("prisma:getSchema");
14719
- async function getSchemaWithPath(schemaPathFromArgs, { cwd = process.cwd(), argumentName = "--schema" } = {}) {
14720
- const result = await getSchemaWithPathInternal(schemaPathFromArgs, { cwd, argumentName });
14718
+ var debug2 = (0, import_debug4.Debug)("prisma:getSchema");
14719
+ async function getSchemaWithPath(schemaPathFromArgs, schemaPathFromConfig, { cwd = process.cwd(), argumentName = "--schema" } = {}) {
14720
+ const result = await getSchemaWithPathInternal(schemaPathFromArgs, schemaPathFromConfig, { cwd, argumentName });
14721
14721
  if (result.ok) {
14722
14722
  return result.schema;
14723
14723
  }
14724
14724
  throw new Error(renderDefaultLookupError(result.error, cwd));
14725
14725
  }
14726
- async function getSchemaWithPathOptional(schemaPathFromArgs, { cwd = process.cwd(), argumentName = "--schema" } = {}) {
14727
- const result = await getSchemaWithPathInternal(schemaPathFromArgs, { cwd, argumentName });
14726
+ async function getSchemaWithPathOptional(schemaPathFromArgs, schemaPathFromConfig, { cwd = process.cwd(), argumentName = "--schema" } = {}) {
14727
+ const result = await getSchemaWithPathInternal(schemaPathFromArgs, schemaPathFromConfig, { cwd, argumentName });
14728
14728
  if (result.ok) {
14729
14729
  return result.schema;
14730
14730
  }
@@ -14732,7 +14732,7 @@ async function getSchemaWithPathOptional(schemaPathFromArgs, { cwd = process.cwd
14732
14732
  }
14733
14733
  async function readSchemaFromSingleFile(schemaPath2) {
14734
14734
  debug2("Reading schema from single file", schemaPath2);
14735
- const typeError = await ensureType(schemaPath2, "file");
14735
+ const typeError = await (0, import_schema_files_loader.ensureType)(schemaPath2, "file");
14736
14736
  if (typeError) {
14737
14737
  return { ok: false, error: typeError };
14738
14738
  }
@@ -14745,13 +14745,13 @@ async function readSchemaFromSingleFile(schemaPath2) {
14745
14745
  }
14746
14746
  async function readSchemaFromDirectory(schemaPath2) {
14747
14747
  debug2("Reading schema from multiple files", schemaPath2);
14748
- const typeError = await ensureType(schemaPath2, "directory");
14748
+ const typeError = await (0, import_schema_files_loader.ensureType)(schemaPath2, "directory");
14749
14749
  if (typeError) {
14750
14750
  return { ok: false, error: typeError };
14751
14751
  }
14752
14752
  const files = await (0, import_schema_files_loader.loadSchemaFiles)(schemaPath2);
14753
14753
  debug2("Loading config");
14754
- const config2 = await (0, import_chunk_IVGHLLOG.getConfig)({
14754
+ const config2 = await (0, import_chunk_RKXUSJ5G.getConfig)({
14755
14755
  datamodel: files,
14756
14756
  ignoreEnvVarErrors: true
14757
14757
  });
@@ -14761,23 +14761,6 @@ async function readSchemaFromDirectory(schemaPath2) {
14761
14761
  }
14762
14762
  return { ok: true, schema: { schemaPath: schemaPath2, schemaRootDir: schemaPath2, schemas: files } };
14763
14763
  }
14764
- async function ensureType(entryPath, expectedType) {
14765
- try {
14766
- const pathStat = await stat(entryPath);
14767
- if (expectedType === "file" && pathStat.isFile()) {
14768
- return void 0;
14769
- }
14770
- if (expectedType === "directory" && pathStat.isDirectory()) {
14771
- return void 0;
14772
- }
14773
- return { kind: "WrongType", path: entryPath, expectedTypes: [expectedType] };
14774
- } catch (e) {
14775
- if (e.code === "ENOENT") {
14776
- return { kind: "NotFound", path: entryPath, expectedType };
14777
- }
14778
- throw e;
14779
- }
14780
- }
14781
14764
  async function readSchemaFromFileOrDirectory(schemaPath2) {
14782
14765
  let stats;
14783
14766
  try {
@@ -14796,7 +14779,7 @@ async function readSchemaFromFileOrDirectory(schemaPath2) {
14796
14779
  }
14797
14780
  return { ok: false, error: { kind: "WrongType", path: schemaPath2, expectedTypes: ["file", "directory"] } };
14798
14781
  }
14799
- async function getSchemaWithPathInternal(schemaPathFromArgs, { cwd, argumentName }) {
14782
+ async function getSchemaWithPathInternal(schemaPathFromArgs, schemaPathFromConfig, { cwd, argumentName }) {
14800
14783
  if (schemaPathFromArgs) {
14801
14784
  const absPath = import_path2.default.resolve(cwd, schemaPathFromArgs);
14802
14785
  const customSchemaResult = await readSchemaFromFileOrDirectory(absPath);
@@ -14810,6 +14793,10 @@ async function getSchemaWithPathInternal(schemaPathFromArgs, { cwd, argumentName
14810
14793
  }
14811
14794
  return customSchemaResult;
14812
14795
  }
14796
+ const prismaConfigResult = await readSchemaFromPrismaConfigBasedLocation(schemaPathFromConfig);
14797
+ if (prismaConfigResult.ok) {
14798
+ return prismaConfigResult;
14799
+ }
14813
14800
  const pkgJsonResult = await getSchemaFromPackageJson(cwd);
14814
14801
  if (pkgJsonResult.ok) {
14815
14802
  return pkgJsonResult;
@@ -14865,6 +14852,31 @@ async function getPrismaConfigFromPackageJson(cwd) {
14865
14852
  packagePath: pkgJson.path
14866
14853
  };
14867
14854
  }
14855
+ async function readSchemaFromPrismaConfigBasedLocation(schemaPathFromConfig) {
14856
+ if (!schemaPathFromConfig) {
14857
+ return {
14858
+ ok: false,
14859
+ error: { kind: "PrismaConfigNotConfigured" }
14860
+ };
14861
+ }
14862
+ let schemaResult2;
14863
+ if (schemaPathFromConfig.kind === "single") {
14864
+ schemaResult2 = await readSchemaFromSingleFile(schemaPathFromConfig.filePath);
14865
+ if (!schemaResult2.ok) {
14866
+ throw new Error(
14867
+ `Could not load schema from file \`${schemaPathFromConfig.filePath}\` provided by "prisma.config.ts"\`: ${renderLookupError(schemaResult2.error)}`
14868
+ );
14869
+ }
14870
+ } else {
14871
+ schemaResult2 = await readSchemaFromDirectory(schemaPathFromConfig.folderPath);
14872
+ if (!schemaResult2.ok) {
14873
+ throw new Error(
14874
+ `Could not load schema from folder \`${schemaPathFromConfig.folderPath}\` provided by "prisma.config.ts"\`: ${renderLookupError(schemaResult2.error)}`
14875
+ );
14876
+ }
14877
+ }
14878
+ return schemaResult2;
14879
+ }
14868
14880
  async function getSchemaFromPackageJson(cwd) {
14869
14881
  const prismaConfig = await getPrismaConfigFromPackageJson(cwd);
14870
14882
  debug2("prismaConfig", prismaConfig);
@@ -14969,11 +14981,11 @@ async function getSchemaDir(schemaPathFromArgs) {
14969
14981
  }
14970
14982
  return import_path2.default.dirname(schemaPathResult.schemaPath);
14971
14983
  }
14972
- async function getSchema(schemaPathFromArgs) {
14973
- const schemaPathResult = await getSchemaWithPath(schemaPathFromArgs);
14984
+ async function getSchema(schemaPathFromArgs, schemaPathFromConfig) {
14985
+ const schemaPathResult = await getSchemaWithPath(schemaPathFromArgs, schemaPathFromConfig);
14974
14986
  return schemaPathResult.schemas;
14975
14987
  }
14976
- var debug3 = (0, import_debug2.default)("prisma:loadEnv");
14988
+ var debug3 = (0, import_debug3.default)("prisma:loadEnv");
14977
14989
  async function getEnvPaths(schemaPath2, opts = { cwd: process.cwd() }) {
14978
14990
  const rootEnvPath = getProjectRootEnvPath({ cwd: opts.cwd }) ?? null;
14979
14991
  const schemaEnvPathFromArgs = schemaPathToEnvPath(schemaPath2);
@@ -15031,10 +15043,16 @@ function schemaPathToEnvPath(schemaPath2) {
15031
15043
  if (!schemaPath2) return null;
15032
15044
  return import_path.default.join(import_path.default.dirname(schemaPath2), ".env");
15033
15045
  }
15046
+ var debug4 = (0, import_debug2.default)("prisma:cli:loadEnvFile");
15034
15047
  async function loadEnvFile({
15035
15048
  schemaPath: schemaPath2,
15049
+ config: config2,
15036
15050
  printMessage = false
15037
- } = {}) {
15051
+ }) {
15052
+ if (config2.loadedFromFile) {
15053
+ debug4(`Prisma config detected, skipping environment variable loading`);
15054
+ return;
15055
+ }
15038
15056
  const envPaths2 = await getEnvPaths(schemaPath2);
15039
15057
  const envData = (0, import_chunk_3BND5XB4.tryLoadEnvs)(envPaths2, { conflictCheck: "error" });
15040
15058
  if (printMessage && envData && envData.message) {
@@ -15047,9 +15065,9 @@ Please use a direct connection to your database via the datasource \`directUrl\`
15047
15065
 
15048
15066
  More information about this limitation: ${(0, import_chunk_L6GBFCXG.link)("https://pris.ly/d/accelerate-limitations")}
15049
15067
  `;
15050
- async function checkUnsupportedDataProxyMessage(command, args, implicitSchema) {
15068
+ async function checkUnsupportedDataProxyMessage(command, args, schemaPathFromConfig, implicitSchema) {
15051
15069
  if (implicitSchema === true) {
15052
- args["--schema"] = (await getSchemaWithPath(args["--schema"]))?.schemaPath ?? void 0;
15070
+ args["--schema"] = (await getSchemaWithPath(args["--schema"], schemaPathFromConfig))?.schemaPath ?? void 0;
15053
15071
  }
15054
15072
  const argList = Object.entries(args);
15055
15073
  for (const [argName, argValue] of argList) {
@@ -15057,10 +15075,10 @@ async function checkUnsupportedDataProxyMessage(command, args, implicitSchema) {
15057
15075
  return forbiddenCmdWithDataProxyFlagMessage(command);
15058
15076
  }
15059
15077
  if (argName.includes("schema")) {
15060
- await loadEnvFile({ schemaPath: argValue, printMessage: false });
15078
+ await loadEnvFile({ schemaPath: argValue, printMessage: false, config: (0, import_config.defaultTestConfig)() });
15061
15079
  const datamodel = await import_fs.default.promises.readFile(argValue, "utf-8");
15062
- const config2 = await (0, import_chunk_IVGHLLOG.getConfig)({ datamodel, ignoreEnvVarErrors: true });
15063
- const url = (0, import_chunk_IVGHLLOG.resolveUrl)((0, import_chunk_IVGHLLOG.getEffectiveUrl)(config2.datasources[0]));
15080
+ const config2 = await (0, import_chunk_RKXUSJ5G.getConfig)({ datamodel, ignoreEnvVarErrors: true });
15081
+ const url = (0, import_chunk_RKXUSJ5G.resolveUrl)((0, import_chunk_RKXUSJ5G.getEffectiveUrl)(config2.datasources[0]));
15064
15082
  if (url?.startsWith("prisma://")) {
15065
15083
  return forbiddenCmdWithDataProxyFlagMessage(command);
15066
15084
  }
@@ -15068,13 +15086,14 @@ async function checkUnsupportedDataProxyMessage(command, args, implicitSchema) {
15068
15086
  }
15069
15087
  return void 0;
15070
15088
  }
15071
- async function checkUnsupportedDataProxy(command, args, implicitSchema) {
15072
- const message = await checkUnsupportedDataProxyMessage(command, args, implicitSchema).catch(() => void 0);
15089
+ async function checkUnsupportedDataProxy(command, args, schemaPathFromConfig, implicitSchema) {
15090
+ const message = await checkUnsupportedDataProxyMessage(command, args, schemaPathFromConfig, implicitSchema).catch(
15091
+ () => void 0
15092
+ );
15073
15093
  if (message) throw new Error(message);
15074
15094
  }
15075
- async function getProjectHash() {
15076
- const args = (0, import_chunk_MUPZUVSI.arg)(process.argv.slice(3), { "--schema": String });
15077
- const projectPath = (await getSchemaWithPath(args["--schema"]))?.schemaPath ?? process.cwd();
15095
+ async function getProjectHash(schemaPathFromArgs, schemaPathFromConfig) {
15096
+ const projectPath = (await getSchemaWithPath(schemaPathFromArgs, schemaPathFromConfig))?.schemaPath ?? process.cwd();
15078
15097
  return import_crypto.default.createHash("sha256").update(projectPath).digest("hex").substring(0, 8);
15079
15098
  }
15080
15099
  function getCLIPathHash() {
@@ -15082,14 +15101,14 @@ function getCLIPathHash() {
15082
15101
  return import_crypto.default.createHash("sha256").update(cliPath).digest("hex").substring(0, 8);
15083
15102
  }
15084
15103
  var import_p_map = (0, import_chunk_WWAWV7DQ.__toESM)((0, import_chunk_RL3K4V2J.require_p_map)());
15085
- var debug4 = (0, import_debug6.default)("prisma:generator");
15104
+ var debug5 = (0, import_debug7.default)("prisma:generator");
15086
15105
  async function checkTypeScriptVersion() {
15087
15106
  const minVersion = "4.1.0";
15088
15107
  try {
15089
15108
  const typescriptPath = await (0, import_chunk_YXD4CJDK.resolvePkg)("typescript", {
15090
15109
  basedir: process.cwd()
15091
15110
  });
15092
- debug4("typescriptPath", typescriptPath);
15111
+ debug5("typescriptPath", typescriptPath);
15093
15112
  const typescriptPkg = typescriptPath && import_path5.default.join(typescriptPath, "package.json");
15094
15113
  if (typescriptPkg && import_fs5.default.existsSync(typescriptPkg)) {
15095
15114
  const pjson = (0, import_chunk_WWAWV7DQ.__require)(typescriptPkg);
@@ -15107,14 +15126,14 @@ async function checkTypeScriptVersion() {
15107
15126
  } catch (e) {
15108
15127
  }
15109
15128
  }
15110
- var debug5 = (0, import_debug5.default)("prisma:generator");
15129
+ var debug6 = (0, import_debug6.default)("prisma:generator");
15111
15130
  async function prismaClientResolver(baseDir, version3) {
15112
15131
  let prismaClientDir = await (0, import_chunk_PIPE5DSU.findPrismaClientDir)(baseDir);
15113
- debug5("baseDir", baseDir);
15132
+ debug6("baseDir", baseDir);
15114
15133
  await checkTypeScriptVersion();
15115
15134
  if (!prismaClientDir && !process.env.PRISMA_GENERATE_SKIP_AUTOINSTALL) {
15116
15135
  let projectRoot = (0, import_chunk_J77ZIDXB.longestCommonPathPrefix)(baseDir, process.cwd());
15117
- debug5("projectRoot", projectRoot);
15136
+ debug6("projectRoot", projectRoot);
15118
15137
  const warningTag = `${(0, import_chunk_PG5FDKSF.bold)("Warning:")} ${(0, import_chunk_PG5FDKSF.dim)("[Prisma auto-install on generate]")}`;
15119
15138
  if (projectRoot === void 0) {
15120
15139
  console.warn(
@@ -15184,7 +15203,7 @@ Please try to install it with ${(0, import_chunk_PG5FDKSF.bold)((0, import_chunk
15184
15203
  var generatorResolvers = {
15185
15204
  "prisma-client-js": prismaClientResolver
15186
15205
  };
15187
- var debug6 = (0, import_debug4.default)("prisma:getGenerators");
15206
+ var debug7 = (0, import_debug5.default)("prisma:getGenerators");
15188
15207
  async function getGenerators(options) {
15189
15208
  const {
15190
15209
  schemaPath,
@@ -15232,7 +15251,7 @@ async function getGenerators(options) {
15232
15251
  prismaPath = binaryPathsWithEngineType[queryEngineBinaryType][binaryTarget];
15233
15252
  }
15234
15253
  }
15235
- const config = await (0, import_chunk_IVGHLLOG.getConfig)({
15254
+ const config = await (0, import_chunk_RKXUSJ5G.getConfig)({
15236
15255
  datamodel: schemas,
15237
15256
  datamodelPath: schemaPath,
15238
15257
  prismaPath,
@@ -15243,7 +15262,7 @@ async function getGenerators(options) {
15243
15262
  }
15244
15263
  (0, import_chunk_5FJ3MENK.printConfigWarnings)(config.warnings);
15245
15264
  const previewFeatures = (0, import_chunk_TSJICM5S.extractPreviewFeatures)(config);
15246
- const dmmf = await (0, import_chunk_F6CEQGHA.getDMMF)({
15265
+ const dmmf = await (0, import_chunk_OMHCKFM5.getDMMF)({
15247
15266
  datamodel: schemas,
15248
15267
  datamodelPath: schemaPath,
15249
15268
  prismaPath,
@@ -15304,7 +15323,7 @@ The generator needs to either define the \`defaultOutput\` path in the manifest
15304
15323
  fromEnvVar: "null"
15305
15324
  };
15306
15325
  }
15307
- const datamodel = (0, import_chunk_ECCMQHHG.mergeSchemas)({ schemas });
15326
+ const datamodel = (0, import_chunk_LBVSPAZX.mergeSchemas)({ schemas });
15308
15327
  const envPaths2 = await getEnvPaths(schemaPath, { cwd: generator.output.value });
15309
15328
  const options2 = {
15310
15329
  datamodel,
@@ -15370,7 +15389,7 @@ generator gen {
15370
15389
  }
15371
15390
  }
15372
15391
  }
15373
- debug6("neededVersions", JSON.stringify(neededVersions, null, 2));
15392
+ debug7("neededVersions", JSON.stringify(neededVersions, null, 2));
15374
15393
  const binaryPathsByVersion = await (0, import_chunk_5XRQ7ONW.getBinaryPathsByVersion)({
15375
15394
  neededVersions,
15376
15395
  binaryTarget,
@@ -15384,19 +15403,19 @@ generator gen {
15384
15403
  const engineVersion = (0, import_chunk_X3P4J7WW.getEngineVersionForGenerator)(generator.manifest, version);
15385
15404
  const binaryPaths = binaryPathsByVersion[engineVersion];
15386
15405
  const generatorBinaryPaths = (0, import_chunk_5V36RLCO.pick)(binaryPaths, generator.manifest.requiresEngines);
15387
- debug6({ generatorBinaryPaths });
15406
+ debug7({ generatorBinaryPaths });
15388
15407
  generator.setBinaryPaths(generatorBinaryPaths);
15389
15408
  if (engineVersion !== version && generator.options && generator.manifest.requiresEngines.includes(queryEngineType) && generatorBinaryPaths[queryEngineType] && generatorBinaryPaths[queryEngineType]?.[binaryTarget]) {
15390
- const customDmmf = await (0, import_chunk_F6CEQGHA.getDMMF)({
15409
+ const customDmmf = await (0, import_chunk_OMHCKFM5.getDMMF)({
15391
15410
  datamodel: schemas,
15392
15411
  datamodelPath: schemaPath,
15393
15412
  prismaPath: generatorBinaryPaths[queryEngineType]?.[binaryTarget],
15394
15413
  previewFeatures
15395
15414
  });
15396
15415
  const options2 = { ...generator.options, dmmf: customDmmf };
15397
- debug6("generator.manifest.prettyName", generator.manifest.prettyName);
15398
- debug6("options", options2);
15399
- debug6("options.generator.binaryTargets", options2.generator.binaryTargets);
15416
+ debug7("generator.manifest.prettyName", generator.manifest.prettyName);
15417
+ debug7("options", options2);
15418
+ debug7("options.generator.binaryTargets", options2.generator.binaryTargets);
15400
15419
  generator.setOptions(options2);
15401
15420
  }
15402
15421
  }
@@ -15680,12 +15699,12 @@ ${(0, import_chunk_PG5FDKSF.bold)("Thanks a lot for your help! \u{1F64F}")}`);
15680
15699
  });
15681
15700
  process.exit(1);
15682
15701
  }
15683
- var debug7 = (0, import_debug.default)("prisma:format");
15702
+ var debug8 = (0, import_debug.default)("prisma:format");
15684
15703
  async function formatSchema({ schemas: schemas2 }, inputFormattingOptions) {
15685
15704
  if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
15686
15705
  handleFormatPanic(
15687
15706
  () => {
15688
- import_chunk_M5RRWJSA.prismaSchemaWasm.debug_panic();
15707
+ import_chunk_3SBTJPC7.prismaSchemaWasm.debug_panic();
15689
15708
  },
15690
15709
  { schemas: schemas2 }
15691
15710
  );
@@ -15705,12 +15724,12 @@ async function formatSchema({ schemas: schemas2 }, inputFormattingOptions) {
15705
15724
  () => {
15706
15725
  const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas2), documentFormattingParams);
15707
15726
  const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
15708
- const lintDiagnostics2 = (0, import_chunk_RGTLYBU6.lintSchema)({ schemas: formattedMultipleSchemas2 });
15727
+ const lintDiagnostics2 = (0, import_chunk_2MZLRA7Z.lintSchema)({ schemas: formattedMultipleSchemas2 });
15709
15728
  return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
15710
15729
  },
15711
15730
  { schemas: schemas2 }
15712
15731
  );
15713
- const lintWarnings = (0, import_chunk_RGTLYBU6.getLintWarningsAsText)(lintDiagnostics);
15732
+ const lintWarnings = (0, import_chunk_2MZLRA7Z.getLintWarningsAsText)(lintDiagnostics);
15714
15733
  if (lintWarnings && import_chunk_AZNLB67U.logger_exports.should.warn()) {
15715
15734
  console.warn(lintWarnings);
15716
15735
  }
@@ -15721,8 +15740,8 @@ function handleFormatPanic(tryCb, { schemas: schemas2 }) {
15721
15740
  return tryCb();
15722
15741
  } catch (e) {
15723
15742
  const { message, stack } = (0, import_chunk_A4QWQE3W.getWasmError)(e);
15724
- debug7(`Error formatting schema: ${message}`);
15725
- debug7(stack);
15743
+ debug8(`Error formatting schema: ${message}`);
15744
+ debug8(stack);
15726
15745
  const panic = new import_chunk_A4QWQE3W.RustPanic(
15727
15746
  /* message */
15728
15747
  message,
@@ -15740,7 +15759,7 @@ function handleFormatPanic(tryCb, { schemas: schemas2 }) {
15740
15759
  }
15741
15760
  }
15742
15761
  function formatWasm(schema, documentFormattingParams) {
15743
- const formattedSchema = import_chunk_M5RRWJSA.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
15762
+ const formattedSchema = import_chunk_3SBTJPC7.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
15744
15763
  return formattedSchema;
15745
15764
  }
15746
15765
  /*! Bundled license information: