@prisma/internals 6.6.0-dev.26 → 6.6.0-dev.28

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 (51) hide show
  1. package/dist/{chunk-GJTVX7D7.js → chunk-3EPHRVO3.js} +7 -7
  2. package/dist/{chunk-H3PEAQWT.js → chunk-4DBHGLDX.js} +13 -13
  3. package/dist/{chunk-TEVID6C5.js → chunk-4QFYMU5Q.js} +4 -4
  4. package/dist/{chunk-WJ7TBF4E.js → chunk-7W7UYM7C.js} +11 -11
  5. package/dist/{chunk-Z4ALPGAK.js → chunk-DB2ZXQNZ.js} +7 -7
  6. package/dist/{chunk-UJ725NXW.js → chunk-EDPM4TAT.js} +5 -5
  7. package/dist/{chunk-MG3I677L.js → chunk-FBHWUFLM.js} +131 -86
  8. package/dist/{chunk-DBHRA3FT.js → chunk-IOF3PJAC.js} +5 -5
  9. package/dist/{chunk-7WZO4C7P.js → chunk-IU6TJYZC.js} +125 -80
  10. package/dist/{chunk-GSUMZPVL.js → chunk-JPTRXV36.js} +7 -7
  11. package/dist/{chunk-INRYNZGK.js → chunk-JTWCAWGS.js} +5 -5
  12. package/dist/{chunk-FA73SMDO.js → chunk-LMHOWT5I.js} +8 -8
  13. package/dist/{chunk-N4XGBEVK.js → chunk-MXMNTCC5.js} +12 -12
  14. package/dist/{chunk-IVUMKFGZ.js → chunk-NWX4DSMZ.js} +7 -7
  15. package/dist/{chunk-SCSDDDCW.js → chunk-OCYZOJRG.js} +5 -5
  16. package/dist/{chunk-4URMCTG6.js → chunk-PSYMCJ4B.js} +4 -4
  17. package/dist/{chunk-G734OYOG.js → chunk-PVHEBSDI.js} +11 -11
  18. package/dist/{chunk-FCYHZHVW.js → chunk-R3J2O23S.js} +4 -4
  19. package/dist/{chunk-6NS6O6L4.js → chunk-RZCTV2U3.js} +5 -5
  20. package/dist/{chunk-TQCLUNM2.js → chunk-VNIE2AZB.js} +4 -4
  21. package/dist/cli/checkUnsupportedDataProxy.js +27 -27
  22. package/dist/cli/getSchema.js +31 -31
  23. package/dist/cli/hashes.js +27 -27
  24. package/dist/cli/schemaContext.d.ts +43 -0
  25. package/dist/cli/schemaContext.js +135 -0
  26. package/dist/engine-commands/errorHelpers.js +4 -4
  27. package/dist/engine-commands/formatSchema.js +26 -26
  28. package/dist/engine-commands/getConfig.js +12 -12
  29. package/dist/engine-commands/getDmmf.js +9 -9
  30. package/dist/engine-commands/index.js +35 -35
  31. package/dist/engine-commands/lintSchema.js +8 -8
  32. package/dist/engine-commands/mergeSchemas.js +9 -9
  33. package/dist/engine-commands/queryEngineCommons.js +6 -6
  34. package/dist/engine-commands/validate.js +9 -9
  35. package/dist/get-generators/generatorResolvers/generatorResolvers.js +26 -26
  36. package/dist/get-generators/generatorResolvers/prisma-client-js/check-dependencies/checkTypeScriptVersion.js +26 -26
  37. package/dist/get-generators/generatorResolvers/prisma-client-js/prismaClientResolver.js +27 -27
  38. package/dist/get-generators/getGenerators.js +29 -29
  39. package/dist/highlight/highlight.js +5 -5
  40. package/dist/index.d.ts +1 -0
  41. package/dist/index.js +60 -59
  42. package/dist/sendPanic.js +26 -26
  43. package/dist/utils/canPrompt.js +3 -3
  44. package/dist/utils/getEnvPaths.js +26 -26
  45. package/dist/utils/getVersionFromPackageJson.js +3 -3
  46. package/dist/utils/handlePanic.js +26 -26
  47. package/dist/utils/loadEnvFile.js +26 -26
  48. package/dist/utils/missingDatasource.js +4 -4
  49. package/dist/utils/missingGeneratorMessage.js +6 -6
  50. package/dist/wasm.js +4 -4
  51. package/package.json +8 -8
@@ -26,8 +26,8 @@ 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_MG3I677L_exports = {};
30
- __export2(chunk_MG3I677L_exports, {
29
+ var chunk_FBHWUFLM_exports = {};
30
+ __export2(chunk_FBHWUFLM_exports, {
31
31
  checkTypeScriptVersion: () => checkTypeScriptVersion,
32
32
  checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
33
33
  debug: () => debug5,
@@ -50,16 +50,17 @@ __export2(chunk_MG3I677L_exports, {
50
50
  handlePanic: () => handlePanic,
51
51
  knownBinaryTargets: () => knownBinaryTargets,
52
52
  loadEnvFile: () => loadEnvFile,
53
+ loadSchemaContext: () => loadSchemaContext,
53
54
  prismaClientResolver: () => prismaClientResolver,
54
55
  sendPanic: () => sendPanic,
55
56
  skipIndex: () => skipIndex
56
57
  });
57
- module.exports = __toCommonJS2(chunk_MG3I677L_exports);
58
+ module.exports = __toCommonJS2(chunk_FBHWUFLM_exports);
59
+ var import_chunk_ETNCBIDF = require("./chunk-ETNCBIDF.js");
58
60
  var import_chunk_GHHABGYW = require("./chunk-GHHABGYW.js");
59
61
  var import_chunk_EUTJYQDW = require("./chunk-EUTJYQDW.js");
60
62
  var import_chunk_IPKE37QC = require("./chunk-IPKE37QC.js");
61
63
  var import_chunk_DGZO4GAJ = require("./chunk-DGZO4GAJ.js");
62
- var import_chunk_ETNCBIDF = require("./chunk-ETNCBIDF.js");
63
64
  var import_chunk_72UZXEBG = require("./chunk-72UZXEBG.js");
64
65
  var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
65
66
  var import_chunk_EIERU2IM = require("./chunk-EIERU2IM.js");
@@ -71,20 +72,20 @@ var import_chunk_ZCVVZ6U6 = require("./chunk-ZCVVZ6U6.js");
71
72
  var import_chunk_5V36RLCO = require("./chunk-5V36RLCO.js");
72
73
  var import_chunk_5FJ3MENK = require("./chunk-5FJ3MENK.js");
73
74
  var import_chunk_KDHESRKE = require("./chunk-KDHESRKE.js");
74
- var import_chunk_UJ725NXW = require("./chunk-UJ725NXW.js");
75
- var import_chunk_Z4ALPGAK = require("./chunk-Z4ALPGAK.js");
75
+ var import_chunk_EDPM4TAT = require("./chunk-EDPM4TAT.js");
76
+ var import_chunk_DB2ZXQNZ = require("./chunk-DB2ZXQNZ.js");
76
77
  var import_chunk_XXDGZSJ4 = require("./chunk-XXDGZSJ4.js");
77
78
  var import_chunk_J77ZIDXB = require("./chunk-J77ZIDXB.js");
78
79
  var import_chunk_2T4NJDHK = require("./chunk-2T4NJDHK.js");
79
- var import_chunk_FCYHZHVW = require("./chunk-FCYHZHVW.js");
80
+ var import_chunk_R3J2O23S = require("./chunk-R3J2O23S.js");
80
81
  var import_chunk_TSJICM5S = require("./chunk-TSJICM5S.js");
81
- var import_chunk_6NS6O6L4 = require("./chunk-6NS6O6L4.js");
82
- var import_chunk_WJ7TBF4E = require("./chunk-WJ7TBF4E.js");
83
- var import_chunk_H3PEAQWT = require("./chunk-H3PEAQWT.js");
84
- var import_chunk_G734OYOG = require("./chunk-G734OYOG.js");
82
+ var import_chunk_RZCTV2U3 = require("./chunk-RZCTV2U3.js");
83
+ var import_chunk_7W7UYM7C = require("./chunk-7W7UYM7C.js");
84
+ var import_chunk_4DBHGLDX = require("./chunk-4DBHGLDX.js");
85
+ var import_chunk_PVHEBSDI = require("./chunk-PVHEBSDI.js");
85
86
  var import_chunk_YRBRUREX = require("./chunk-YRBRUREX.js");
86
87
  var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
87
- var import_chunk_DBHRA3FT = require("./chunk-DBHRA3FT.js");
88
+ var import_chunk_IOF3PJAC = require("./chunk-IOF3PJAC.js");
88
89
  var import_chunk_CCQRDM7X = require("./chunk-CCQRDM7X.js");
89
90
  var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
90
91
  var import_chunk_RAYPCPVU = require("./chunk-RAYPCPVU.js");
@@ -116,21 +117,22 @@ var import_fs3 = __toESM2(require("fs"));
116
117
  var import_path2 = __toESM2(require("path"));
117
118
  var import_util = require("util");
118
119
  var import_crypto = __toESM2(require("crypto"));
120
+ var import_path3 = __toESM2(require("path"));
119
121
  var import_debug4 = __toESM2(require("@prisma/debug"));
120
122
  var import_engines = require("@prisma/engines");
121
123
  var import_fetch_engine = require("@prisma/fetch-engine");
122
124
  var import_get_platform = require("@prisma/get-platform");
123
- var import_path3 = __toESM2(require("path"));
125
+ var import_path4 = __toESM2(require("path"));
124
126
  var import_debug5 = __toESM2(require("@prisma/debug"));
125
127
  var import_fs4 = __toESM2(require("fs"));
126
- var import_path4 = __toESM2(require("path"));
128
+ var import_path5 = __toESM2(require("path"));
127
129
  var import_debug6 = __toESM2(require("@prisma/debug"));
128
130
  var import_fs5 = __toESM2(require("fs"));
129
- var import_path5 = __toESM2(require("path"));
131
+ var import_path6 = __toESM2(require("path"));
130
132
  var import_get_platform2 = require("@prisma/get-platform");
131
133
  var import_fs6 = __toESM2(require("fs"));
132
134
  var import_os = __toESM2(require("os"));
133
- var import_path6 = __toESM2(require("path"));
135
+ var import_path7 = __toESM2(require("path"));
134
136
  var import_prompts = __toESM2(require("prompts"));
135
137
  var import_get_platform3 = require("@prisma/get-platform");
136
138
  var require_readdir_glob = (0, import_chunk_2ESYSVXG.__commonJS)({
@@ -197,8 +199,8 @@ var require_readdir_glob = (0, import_chunk_2ESYSVXG.__commonJS)({
197
199
  });
198
200
  });
199
201
  }
200
- async function* exploreWalkAsync(dir2, path10, followSymlinks, useStat, shouldSkip, strict) {
201
- let files = await readdir(path10 + dir2, strict);
202
+ async function* exploreWalkAsync(dir2, path11, followSymlinks, useStat, shouldSkip, strict) {
203
+ let files = await readdir(path11 + dir2, strict);
202
204
  for (const file of files) {
203
205
  let name = file.name;
204
206
  if (name === void 0) {
@@ -207,7 +209,7 @@ var require_readdir_glob = (0, import_chunk_2ESYSVXG.__commonJS)({
207
209
  }
208
210
  const filename = dir2 + "/" + name;
209
211
  const relative = filename.slice(1);
210
- const absolute = path10 + "/" + relative;
212
+ const absolute = path11 + "/" + relative;
211
213
  let stats = null;
212
214
  if (useStat || followSymlinks) {
213
215
  stats = await stat2(absolute, followSymlinks);
@@ -221,15 +223,15 @@ var require_readdir_glob = (0, import_chunk_2ESYSVXG.__commonJS)({
221
223
  if (stats.isDirectory()) {
222
224
  if (!shouldSkip(relative)) {
223
225
  yield { relative, absolute, stats };
224
- yield* exploreWalkAsync(filename, path10, followSymlinks, useStat, shouldSkip, false);
226
+ yield* exploreWalkAsync(filename, path11, followSymlinks, useStat, shouldSkip, false);
225
227
  }
226
228
  } else {
227
229
  yield { relative, absolute, stats };
228
230
  }
229
231
  }
230
232
  }
231
- async function* explore(path10, followSymlinks, useStat, shouldSkip) {
232
- yield* exploreWalkAsync("", path10, followSymlinks, useStat, shouldSkip, true);
233
+ async function* explore(path11, followSymlinks, useStat, shouldSkip) {
234
+ yield* exploreWalkAsync("", path11, followSymlinks, useStat, shouldSkip, true);
233
235
  }
234
236
  function readOptions(options2) {
235
237
  return {
@@ -4162,22 +4164,22 @@ var require_lazystream = (0, import_chunk_2ESYSVXG.__commonJS)({
4162
4164
  var require_normalize_path = (0, import_chunk_2ESYSVXG.__commonJS)({
4163
4165
  "../../node_modules/.pnpm/normalize-path@3.0.0/node_modules/normalize-path/index.js"(exports2, module2) {
4164
4166
  "use strict";
4165
- module2.exports = function(path10, stripTrailing) {
4166
- if (typeof path10 !== "string") {
4167
+ module2.exports = function(path11, stripTrailing) {
4168
+ if (typeof path11 !== "string") {
4167
4169
  throw new TypeError("expected path to be a string");
4168
4170
  }
4169
- if (path10 === "\\" || path10 === "/") return "/";
4170
- var len = path10.length;
4171
- if (len <= 1) return path10;
4171
+ if (path11 === "\\" || path11 === "/") return "/";
4172
+ var len = path11.length;
4173
+ if (len <= 1) return path11;
4172
4174
  var prefix = "";
4173
- if (len > 4 && path10[3] === "\\") {
4174
- var ch = path10[2];
4175
- if ((ch === "?" || ch === ".") && path10.slice(0, 2) === "\\\\") {
4176
- path10 = path10.slice(2);
4175
+ if (len > 4 && path11[3] === "\\") {
4176
+ var ch = path11[2];
4177
+ if ((ch === "?" || ch === ".") && path11.slice(0, 2) === "\\\\") {
4178
+ path11 = path11.slice(2);
4177
4179
  prefix = "//";
4178
4180
  }
4179
4181
  }
4180
- var segs = path10.split(/[/\\]+/);
4182
+ var segs = path11.split(/[/\\]+/);
4181
4183
  if (stripTrailing !== false && segs[segs.length - 1] === "") {
4182
4184
  segs.pop();
4183
4185
  }
@@ -8247,7 +8249,7 @@ var require_file = (0, import_chunk_2ESYSVXG.__commonJS)({
8247
8249
  "../../node_modules/.pnpm/archiver-utils@4.0.1/node_modules/archiver-utils/file.js"(exports2, module2) {
8248
8250
  "use strict";
8249
8251
  var fs10 = (0, import_chunk_RAYPCPVU.require_graceful_fs)();
8250
- var path10 = (0, import_chunk_2ESYSVXG.__require)("path");
8252
+ var path11 = (0, import_chunk_2ESYSVXG.__require)("path");
8251
8253
  var flatten = require_flatten();
8252
8254
  var difference = require_difference();
8253
8255
  var union = require_union();
@@ -8272,7 +8274,7 @@ var require_file = (0, import_chunk_2ESYSVXG.__commonJS)({
8272
8274
  return result;
8273
8275
  };
8274
8276
  file.exists = function() {
8275
- var filepath = path10.join.apply(path10, arguments);
8277
+ var filepath = path11.join.apply(path11, arguments);
8276
8278
  return fs10.existsSync(filepath);
8277
8279
  };
8278
8280
  file.expand = function(...args) {
@@ -8286,7 +8288,7 @@ var require_file = (0, import_chunk_2ESYSVXG.__commonJS)({
8286
8288
  });
8287
8289
  if (options2.filter) {
8288
8290
  matches = matches.filter(function(filepath) {
8289
- filepath = path10.join(options2.cwd || "", filepath);
8291
+ filepath = path11.join(options2.cwd || "", filepath);
8290
8292
  try {
8291
8293
  if (typeof options2.filter === "function") {
8292
8294
  return options2.filter(filepath);
@@ -8303,7 +8305,7 @@ var require_file = (0, import_chunk_2ESYSVXG.__commonJS)({
8303
8305
  file.expandMapping = function(patterns, destBase, options2) {
8304
8306
  options2 = Object.assign({
8305
8307
  rename: function(destBase2, destPath) {
8306
- return path10.join(destBase2 || "", destPath);
8308
+ return path11.join(destBase2 || "", destPath);
8307
8309
  }
8308
8310
  }, options2);
8309
8311
  var files = [];
@@ -8311,14 +8313,14 @@ var require_file = (0, import_chunk_2ESYSVXG.__commonJS)({
8311
8313
  file.expand(options2, patterns).forEach(function(src) {
8312
8314
  var destPath = src;
8313
8315
  if (options2.flatten) {
8314
- destPath = path10.basename(destPath);
8316
+ destPath = path11.basename(destPath);
8315
8317
  }
8316
8318
  if (options2.ext) {
8317
8319
  destPath = destPath.replace(/(\.[^\/]*)?$/, options2.ext);
8318
8320
  }
8319
8321
  var dest = options2.rename(destBase, destPath, options2);
8320
8322
  if (options2.cwd) {
8321
- src = path10.join(options2.cwd, src);
8323
+ src = path11.join(options2.cwd, src);
8322
8324
  }
8323
8325
  dest = dest.replace(pathSeparatorRe, "/");
8324
8326
  src = src.replace(pathSeparatorRe, "/");
@@ -8399,7 +8401,7 @@ var require_archiver_utils = (0, import_chunk_2ESYSVXG.__commonJS)({
8399
8401
  "../../node_modules/.pnpm/archiver-utils@4.0.1/node_modules/archiver-utils/index.js"(exports2, module2) {
8400
8402
  "use strict";
8401
8403
  var fs10 = (0, import_chunk_RAYPCPVU.require_graceful_fs)();
8402
- var path10 = (0, import_chunk_2ESYSVXG.__require)("path");
8404
+ var path11 = (0, import_chunk_2ESYSVXG.__require)("path");
8403
8405
  var lazystream = require_lazystream();
8404
8406
  var normalizePath = require_normalize_path();
8405
8407
  var defaults = require_defaults();
@@ -8486,11 +8488,11 @@ var require_archiver_utils = (0, import_chunk_2ESYSVXG.__commonJS)({
8486
8488
  if (!file) {
8487
8489
  return callback(null, results);
8488
8490
  }
8489
- filepath = path10.join(dirpath, file);
8491
+ filepath = path11.join(dirpath, file);
8490
8492
  fs10.stat(filepath, function(err2, stats) {
8491
8493
  results.push({
8492
8494
  path: filepath,
8493
- relative: path10.relative(base, filepath).replace(/\\/g, "/"),
8495
+ relative: path11.relative(base, filepath).replace(/\\/g, "/"),
8494
8496
  stats
8495
8497
  });
8496
8498
  if (stats && stats.isDirectory()) {
@@ -8550,7 +8552,7 @@ var require_core = (0, import_chunk_2ESYSVXG.__commonJS)({
8550
8552
  var fs10 = (0, import_chunk_2ESYSVXG.__require)("fs");
8551
8553
  var glob = require_readdir_glob();
8552
8554
  var async = (init_async(), (0, import_chunk_2ESYSVXG.__toCommonJS)(async_exports));
8553
- var path10 = (0, import_chunk_2ESYSVXG.__require)("path");
8555
+ var path11 = (0, import_chunk_2ESYSVXG.__require)("path");
8554
8556
  var util = require_archiver_utils();
8555
8557
  var inherits = (0, import_chunk_2ESYSVXG.__require)("util").inherits;
8556
8558
  var ArchiverError = require_error();
@@ -8826,9 +8828,9 @@ var require_core = (0, import_chunk_2ESYSVXG.__commonJS)({
8826
8828
  task.source = Buffer.concat([]);
8827
8829
  } else if (stats.isSymbolicLink() && this._moduleSupports("symlink")) {
8828
8830
  var linkPath = fs10.readlinkSync(task.filepath);
8829
- var dirName = path10.dirname(task.filepath);
8831
+ var dirName = path11.dirname(task.filepath);
8830
8832
  task.data.type = "symlink";
8831
- task.data.linkname = path10.relative(dirName, path10.resolve(dirName, linkPath));
8833
+ task.data.linkname = path11.relative(dirName, path11.resolve(dirName, linkPath));
8832
8834
  task.data.sourceType = "buffer";
8833
8835
  task.source = Buffer.concat([]);
8834
8836
  } else {
@@ -14104,7 +14106,7 @@ var require_tmp = (0, import_chunk_2ESYSVXG.__commonJS)({
14104
14106
  "use strict";
14105
14107
  var fs10 = (0, import_chunk_2ESYSVXG.__require)("fs");
14106
14108
  var os3 = (0, import_chunk_2ESYSVXG.__require)("os");
14107
- var path10 = (0, import_chunk_2ESYSVXG.__require)("path");
14109
+ var path11 = (0, import_chunk_2ESYSVXG.__require)("path");
14108
14110
  var crypto3 = (0, import_chunk_2ESYSVXG.__require)("crypto");
14109
14111
  var _c = { fs: fs10.constants, os: os3.constants };
14110
14112
  var RANDOM_CHARS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
@@ -14318,9 +14320,9 @@ var require_tmp = (0, import_chunk_2ESYSVXG.__commonJS)({
14318
14320
  function _generateTmpName(opts) {
14319
14321
  const tmpDir = opts.tmpdir;
14320
14322
  if (!_isUndefined(opts.name))
14321
- return path10.join(tmpDir, opts.dir, opts.name);
14323
+ return path11.join(tmpDir, opts.dir, opts.name);
14322
14324
  if (!_isUndefined(opts.template))
14323
- return path10.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6));
14325
+ return path11.join(tmpDir, opts.dir, opts.template).replace(TEMPLATE_PATTERN, _randomChars(6));
14324
14326
  const name = [
14325
14327
  opts.prefix ? opts.prefix : "tmp",
14326
14328
  "-",
@@ -14329,7 +14331,7 @@ var require_tmp = (0, import_chunk_2ESYSVXG.__commonJS)({
14329
14331
  _randomChars(12),
14330
14332
  opts.postfix ? "-" + opts.postfix : ""
14331
14333
  ].join("");
14332
- return path10.join(tmpDir, opts.dir, name);
14334
+ return path11.join(tmpDir, opts.dir, name);
14333
14335
  }
14334
14336
  function _assertAndSanitizeOptions(options2) {
14335
14337
  options2.tmpdir = _getTmpDir(options2);
@@ -14350,29 +14352,29 @@ var require_tmp = (0, import_chunk_2ESYSVXG.__commonJS)({
14350
14352
  options2.detachDescriptor = !!options2.detachDescriptor;
14351
14353
  options2.discardDescriptor = !!options2.discardDescriptor;
14352
14354
  options2.unsafeCleanup = !!options2.unsafeCleanup;
14353
- options2.dir = _isUndefined(options2.dir) ? "" : path10.relative(tmpDir, _resolvePath(options2.dir, tmpDir));
14354
- options2.template = _isUndefined(options2.template) ? void 0 : path10.relative(tmpDir, _resolvePath(options2.template, tmpDir));
14355
- options2.template = _isBlank(options2.template) ? void 0 : path10.relative(options2.dir, options2.template);
14355
+ options2.dir = _isUndefined(options2.dir) ? "" : path11.relative(tmpDir, _resolvePath(options2.dir, tmpDir));
14356
+ options2.template = _isUndefined(options2.template) ? void 0 : path11.relative(tmpDir, _resolvePath(options2.template, tmpDir));
14357
+ options2.template = _isBlank(options2.template) ? void 0 : path11.relative(options2.dir, options2.template);
14356
14358
  options2.name = _isUndefined(options2.name) ? void 0 : options2.name;
14357
14359
  options2.prefix = _isUndefined(options2.prefix) ? "" : options2.prefix;
14358
14360
  options2.postfix = _isUndefined(options2.postfix) ? "" : options2.postfix;
14359
14361
  }
14360
14362
  function _resolvePath(name, tmpDir) {
14361
14363
  if (name.startsWith(tmpDir)) {
14362
- return path10.resolve(name);
14364
+ return path11.resolve(name);
14363
14365
  } else {
14364
- return path10.resolve(path10.join(tmpDir, name));
14366
+ return path11.resolve(path11.join(tmpDir, name));
14365
14367
  }
14366
14368
  }
14367
14369
  function _assertIsRelative(name, option, tmpDir) {
14368
14370
  if (option === "name") {
14369
- if (path10.isAbsolute(name))
14371
+ if (path11.isAbsolute(name))
14370
14372
  throw new Error(`${option} option must not contain an absolute path, found "${name}".`);
14371
- let basename = path10.basename(name);
14373
+ let basename = path11.basename(name);
14372
14374
  if (basename === ".." || basename === "." || basename !== name)
14373
14375
  throw new Error(`${option} option must not contain a path, found "${name}".`);
14374
14376
  } else {
14375
- if (path10.isAbsolute(name) && !name.startsWith(tmpDir)) {
14377
+ if (path11.isAbsolute(name) && !name.startsWith(tmpDir)) {
14376
14378
  throw new Error(`${option} option must be relative to "${tmpDir}", found "${name}".`);
14377
14379
  }
14378
14380
  let resolvedPath = _resolvePath(name, tmpDir);
@@ -14393,7 +14395,7 @@ var require_tmp = (0, import_chunk_2ESYSVXG.__commonJS)({
14393
14395
  _gracefulCleanup = true;
14394
14396
  }
14395
14397
  function _getTmpDir(options2) {
14396
- return path10.resolve(options2 && options2.tmpdir || os3.tmpdir());
14398
+ return path11.resolve(options2 && options2.tmpdir || os3.tmpdir());
14397
14399
  }
14398
14400
  process.addListener(EXIT, _garbageCollector);
14399
14401
  Object.defineProperty(module2.exports, "tmpdir", {
@@ -14447,9 +14449,9 @@ function locatePathSync(paths2, {
14447
14449
  }
14448
14450
  }
14449
14451
  }
14450
- function pathExistsSync(path10) {
14452
+ function pathExistsSync(path11) {
14451
14453
  try {
14452
- import_node_fs2.default.accessSync(path10);
14454
+ import_node_fs2.default.accessSync(path11);
14453
14455
  return true;
14454
14456
  } catch {
14455
14457
  return false;
@@ -14530,7 +14532,7 @@ async function readSchemaFromDirectory(schemaPath2) {
14530
14532
  }
14531
14533
  const files = await (0, import_schema_files_loader.loadSchemaFiles)(schemaPath2);
14532
14534
  debug2("Loading config");
14533
- const config2 = await (0, import_chunk_H3PEAQWT.getConfig)({
14535
+ const config2 = await (0, import_chunk_4DBHGLDX.getConfig)({
14534
14536
  datamodel: files,
14535
14537
  ignoreEnvVarErrors: true
14536
14538
  });
@@ -14856,8 +14858,8 @@ async function checkUnsupportedDataProxyMessage(command, args, schemaPathFromCon
14856
14858
  if (argName.includes("schema")) {
14857
14859
  await loadEnvFile({ schemaPath: argValue, printMessage: false, config: (0, import_config.defaultTestConfig)() });
14858
14860
  const datamodel = await import_fs.default.promises.readFile(argValue, "utf-8");
14859
- const config2 = await (0, import_chunk_H3PEAQWT.getConfig)({ datamodel, ignoreEnvVarErrors: true });
14860
- const url = (0, import_chunk_H3PEAQWT.resolveUrl)((0, import_chunk_H3PEAQWT.getEffectiveUrl)(config2.datasources[0]));
14861
+ const config2 = await (0, import_chunk_4DBHGLDX.getConfig)({ datamodel, ignoreEnvVarErrors: true });
14862
+ const url = (0, import_chunk_4DBHGLDX.resolveUrl)((0, import_chunk_4DBHGLDX.getEffectiveUrl)(config2.datasources[0]));
14861
14863
  if (url?.startsWith("prisma://")) {
14862
14864
  return forbiddenCmdWithDataProxyFlagMessage(command);
14863
14865
  }
@@ -14879,6 +14881,49 @@ function getCLIPathHash() {
14879
14881
  const cliPath = process.argv[1];
14880
14882
  return import_crypto.default.createHash("sha256").update(cliPath).digest("hex").substring(0, 8);
14881
14883
  }
14884
+ async function loadSchemaContext({
14885
+ schemaPathFromArg,
14886
+ schemaPathFromConfig,
14887
+ printLoadMessage = true,
14888
+ allowNull = false
14889
+ }) {
14890
+ let schemaResult2 = null;
14891
+ if (allowNull) {
14892
+ schemaResult2 = await getSchemaWithPathOptional(schemaPathFromArg, schemaPathFromConfig);
14893
+ if (!schemaResult2) return null;
14894
+ } else {
14895
+ schemaResult2 = await getSchemaWithPath(schemaPathFromArg, schemaPathFromConfig);
14896
+ }
14897
+ return processSchemaResult({ schemaResult: schemaResult2, printLoadMessage });
14898
+ }
14899
+ async function processSchemaResult({
14900
+ schemaResult: schemaResult2,
14901
+ printLoadMessage
14902
+ }) {
14903
+ const cwd = process.cwd();
14904
+ const loadedFromPathForLogMessages = import_path3.default.relative(cwd, schemaResult2.schemaPath);
14905
+ if (printLoadMessage) {
14906
+ process.stdout.write((0, import_chunk_PG5FDKSF.dim)(`Prisma schema loaded from ${loadedFromPathForLogMessages}`) + "\n");
14907
+ }
14908
+ const configFromPsl = await (0, import_chunk_4DBHGLDX.getConfig)({ datamodel: schemaResult2.schemas });
14909
+ const primaryDatasource = configFromPsl.datasources.at(0);
14910
+ return {
14911
+ schemaFiles: schemaResult2.schemas,
14912
+ schemaPath: schemaResult2.schemaPath,
14913
+ schemaRootDir: schemaResult2.schemaRootDir || cwd,
14914
+ generators: configFromPsl.generators,
14915
+ primaryDatasource,
14916
+ primaryDatasourceDirectory: primaryDatasourceDirectory(primaryDatasource) || schemaResult2.schemaRootDir || cwd,
14917
+ loadedFromPathForLogMessages
14918
+ };
14919
+ }
14920
+ function primaryDatasourceDirectory(primaryDatasource) {
14921
+ const datasourcePath = primaryDatasource?.sourceFilePath;
14922
+ if (datasourcePath) {
14923
+ return import_path3.default.dirname(datasourcePath);
14924
+ }
14925
+ return null;
14926
+ }
14882
14927
  var import_p_map = (0, import_chunk_2ESYSVXG.__toESM)((0, import_chunk_KYMYLH7F.require_p_map)());
14883
14928
  var debug4 = (0, import_debug6.default)("prisma:generator");
14884
14929
  async function checkTypeScriptVersion() {
@@ -14888,7 +14933,7 @@ async function checkTypeScriptVersion() {
14888
14933
  basedir: process.cwd()
14889
14934
  });
14890
14935
  debug4("typescriptPath", typescriptPath);
14891
- const typescriptPkg = typescriptPath && import_path5.default.join(typescriptPath, "package.json");
14936
+ const typescriptPkg = typescriptPath && import_path6.default.join(typescriptPath, "package.json");
14892
14937
  if (typescriptPkg && import_fs5.default.existsSync(typescriptPkg)) {
14893
14938
  const pjson = (0, import_chunk_2ESYSVXG.__require)(typescriptPkg);
14894
14939
  const currentVersion = pjson.version;
@@ -14924,7 +14969,7 @@ async function prismaClientResolver(baseDir, version3) {
14924
14969
  );
14925
14970
  projectRoot = baseDir;
14926
14971
  }
14927
- if (!import_fs4.default.existsSync(import_path4.default.join(projectRoot, "package.json"))) {
14972
+ if (!import_fs4.default.existsSync(import_path5.default.join(projectRoot, "package.json"))) {
14928
14973
  console.warn(
14929
14974
  (0, import_chunk_PG5FDKSF.yellow)(
14930
14975
  `${warningTag} Prisma could not find a ${(0, import_chunk_PG5FDKSF.bold)("package.json")} file in the inferred project root ${(0, import_chunk_PG5FDKSF.bold)(
@@ -14951,7 +14996,7 @@ async function prismaClientResolver(baseDir, version3) {
14951
14996
  await (0, import_chunk_ETNCBIDF.runPackageCmd)(projectRoot, "add", `prisma@${version3 ?? "latest"}`, "-D", "--silent");
14952
14997
  }
14953
14998
  await (0, import_chunk_ETNCBIDF.runPackageCmd)(projectRoot, "add", `@prisma/client@${version3 ?? "latest"}`, "--silent");
14954
- prismaClientDir = await (0, import_chunk_DGZO4GAJ.findPrismaClientDir)(import_path4.default.join(".", baseDir));
14999
+ prismaClientDir = await (0, import_chunk_DGZO4GAJ.findPrismaClientDir)(import_path5.default.join(".", baseDir));
14955
15000
  if (!prismaClientDir) {
14956
15001
  throw new Error(
14957
15002
  `Could not resolve @prisma/client despite the installation that we just tried.
@@ -14975,7 +15020,7 @@ Please try to install it with ${(0, import_chunk_PG5FDKSF.bold)((0, import_chunk
14975
15020
  }
14976
15021
  return {
14977
15022
  outputPath: prismaClientDir,
14978
- generatorPath: import_path4.default.resolve(prismaClientDir, "generator-build/index.js"),
15023
+ generatorPath: import_path5.default.resolve(prismaClientDir, "generator-build/index.js"),
14979
15024
  isNode: true
14980
15025
  };
14981
15026
  }
@@ -15030,18 +15075,18 @@ async function getGenerators(options) {
15030
15075
  prismaPath = binaryPathsWithEngineType[queryEngineBinaryType][binaryTarget];
15031
15076
  }
15032
15077
  }
15033
- const config = await (0, import_chunk_H3PEAQWT.getConfig)({
15078
+ const config = await (0, import_chunk_4DBHGLDX.getConfig)({
15034
15079
  datamodel: schemas,
15035
15080
  datamodelPath: schemaPath,
15036
15081
  prismaPath,
15037
15082
  ignoreEnvVarErrors: true
15038
15083
  });
15039
15084
  if (config.datasources.length === 0) {
15040
- throw new Error(import_chunk_UJ725NXW.missingDatasource);
15085
+ throw new Error(import_chunk_EDPM4TAT.missingDatasource);
15041
15086
  }
15042
15087
  (0, import_chunk_5FJ3MENK.printConfigWarnings)(config.warnings);
15043
15088
  const previewFeatures = (0, import_chunk_TSJICM5S.extractPreviewFeatures)(config);
15044
- const dmmf = await (0, import_chunk_G734OYOG.getDMMF)({
15089
+ const dmmf = await (0, import_chunk_PVHEBSDI.getDMMF)({
15045
15090
  datamodel: schemas,
15046
15091
  datamodelPath: schemaPath,
15047
15092
  prismaPath,
@@ -15049,9 +15094,9 @@ async function getGenerators(options) {
15049
15094
  });
15050
15095
  if (dmmf.datamodel.models.length === 0 && !allowNoModels) {
15051
15096
  if (config.datasources.some((d2) => d2.provider === "mongodb")) {
15052
- throw new Error(import_chunk_Z4ALPGAK.missingModelMessageMongoDB);
15097
+ throw new Error(import_chunk_DB2ZXQNZ.missingModelMessageMongoDB);
15053
15098
  }
15054
- throw new Error(import_chunk_Z4ALPGAK.missingModelMessage);
15099
+ throw new Error(import_chunk_DB2ZXQNZ.missingModelMessage);
15055
15100
  }
15056
15101
  (0, import_chunk_IPKE37QC.checkFeatureFlags)(config, options);
15057
15102
  const generatorConfigs = filterGenerators(overrideGenerators || config.generators, generatorNames);
@@ -15063,7 +15108,7 @@ async function getGenerators(options) {
15063
15108
  async (generator, index2) => {
15064
15109
  let generatorPath = (0, import_chunk_IOIAK7V7.parseEnvValue)(generator.provider);
15065
15110
  let paths2;
15066
- const baseDir = import_path3.default.dirname(generator.sourceFilePath ?? schemaPath);
15111
+ const baseDir = import_path4.default.dirname(generator.sourceFilePath ?? schemaPath);
15067
15112
  const providerValue = (0, import_chunk_IOIAK7V7.parseEnvValue)(generator.provider);
15068
15113
  if (aliases && aliases[providerValue]) {
15069
15114
  generatorPath = aliases[providerValue].generatorPath;
@@ -15076,7 +15121,7 @@ async function getGenerators(options) {
15076
15121
  await generatorInstance.init();
15077
15122
  if (generator.output) {
15078
15123
  generator.output = {
15079
- value: import_path3.default.resolve(baseDir, (0, import_chunk_IOIAK7V7.parseEnvValue)(generator.output)),
15124
+ value: import_path4.default.resolve(baseDir, (0, import_chunk_IOIAK7V7.parseEnvValue)(generator.output)),
15080
15125
  fromEnvVar: null
15081
15126
  };
15082
15127
  generator.isCustomOutput = true;
@@ -15102,7 +15147,7 @@ The generator needs to either define the \`defaultOutput\` path in the manifest
15102
15147
  fromEnvVar: null
15103
15148
  };
15104
15149
  }
15105
- const datamodel = (0, import_chunk_WJ7TBF4E.mergeSchemas)({ schemas });
15150
+ const datamodel = (0, import_chunk_7W7UYM7C.mergeSchemas)({ schemas });
15106
15151
  const envPaths2 = await getEnvPaths(schemaPath, { cwd: generator.output.value });
15107
15152
  const options2 = {
15108
15153
  datamodel,
@@ -15185,7 +15230,7 @@ generator gen {
15185
15230
  debug6({ generatorBinaryPaths });
15186
15231
  generator.setBinaryPaths(generatorBinaryPaths);
15187
15232
  if (engineVersion !== version && generator.options && generator.manifest.requiresEngines.includes(queryEngineType) && generatorBinaryPaths[queryEngineType] && generatorBinaryPaths[queryEngineType]?.[binaryTarget]) {
15188
- const customDmmf = await (0, import_chunk_G734OYOG.getDMMF)({
15233
+ const customDmmf = await (0, import_chunk_PVHEBSDI.getDMMF)({
15189
15234
  datamodel: schemas,
15190
15235
  datamodelPath: schemaPath,
15191
15236
  prismaPath: generatorBinaryPaths[queryEngineType]?.[binaryTarget],
@@ -15369,7 +15414,7 @@ function concatSchemaForReport(schemaFiles) {
15369
15414
  if (!schemaFiles) {
15370
15415
  return void 0;
15371
15416
  }
15372
- return schemaFiles.map(([path10, content]) => `// ${path10}
15417
+ return schemaFiles.map(([path11, content]) => `// ${path11}
15373
15418
  ${content}`).join("\n");
15374
15419
  }
15375
15420
  function getCommand() {
@@ -15384,13 +15429,13 @@ async function makeErrorZip(error) {
15384
15429
  if (!error.schemaPath) {
15385
15430
  throw new Error(`Can't make zip without schema path`);
15386
15431
  }
15387
- const schemaDir = import_path6.default.dirname(error.schemaPath);
15432
+ const schemaDir = import_path7.default.dirname(error.schemaPath);
15388
15433
  const tmpFileObj = import_tmp.default.fileSync();
15389
15434
  const outputFile = import_fs6.default.createWriteStream(tmpFileObj.name);
15390
15435
  const zip = (0, import_archiver.default)("zip", { zlib: { level: 9 } });
15391
15436
  zip.pipe(outputFile);
15392
15437
  const schemaFile = (0, import_chunk_KDHESRKE.maskSchema)(import_fs6.default.readFileSync(error.schemaPath, "utf-8"));
15393
- zip.append(schemaFile, { name: import_path6.default.basename(error.schemaPath) });
15438
+ zip.append(schemaFile, { name: import_path7.default.basename(error.schemaPath) });
15394
15439
  if (import_fs6.default.existsSync(schemaDir)) {
15395
15440
  const filePaths = await (0, import_globby.default)("migrations/**/*", {
15396
15441
  // globby doesn't have it in its types but it's part of mrmlnc/fast-glob
@@ -15398,11 +15443,11 @@ async function makeErrorZip(error) {
15398
15443
  cwd: schemaDir
15399
15444
  });
15400
15445
  for (const filePath of filePaths) {
15401
- let file = import_fs6.default.readFileSync(import_path6.default.resolve(schemaDir, filePath), "utf-8");
15402
- if (filePath.endsWith("schema.prisma") || filePath.endsWith(import_path6.default.basename(error.schemaPath))) {
15446
+ let file = import_fs6.default.readFileSync(import_path7.default.resolve(schemaDir, filePath), "utf-8");
15447
+ if (filePath.endsWith("schema.prisma") || filePath.endsWith(import_path7.default.basename(error.schemaPath))) {
15403
15448
  file = (0, import_chunk_KDHESRKE.maskSchema)(file);
15404
15449
  }
15405
- zip.append(file, { name: import_path6.default.basename(filePath) });
15450
+ zip.append(file, { name: import_path7.default.basename(filePath) });
15406
15451
  }
15407
15452
  }
15408
15453
  zip.finalize();
@@ -15417,7 +15462,7 @@ async function makeErrorZip(error) {
15417
15462
  });
15418
15463
  }
15419
15464
  async function handlePanic(args) {
15420
- if (!(0, import_chunk_FCYHZHVW.canPrompt)()) {
15465
+ if (!(0, import_chunk_R3J2O23S.canPrompt)()) {
15421
15466
  throw args.error;
15422
15467
  }
15423
15468
  await panicDialog(args);
@@ -15483,7 +15528,7 @@ async function formatSchema({ schemas: schemas2 }, inputFormattingOptions) {
15483
15528
  if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
15484
15529
  handleFormatPanic(
15485
15530
  () => {
15486
- import_chunk_DBHRA3FT.prismaSchemaWasm.debug_panic();
15531
+ import_chunk_IOF3PJAC.prismaSchemaWasm.debug_panic();
15487
15532
  },
15488
15533
  { schemas: schemas2 }
15489
15534
  );
@@ -15503,12 +15548,12 @@ async function formatSchema({ schemas: schemas2 }, inputFormattingOptions) {
15503
15548
  () => {
15504
15549
  const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas2), documentFormattingParams);
15505
15550
  const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
15506
- const lintDiagnostics2 = (0, import_chunk_6NS6O6L4.lintSchema)({ schemas: formattedMultipleSchemas2 });
15551
+ const lintDiagnostics2 = (0, import_chunk_RZCTV2U3.lintSchema)({ schemas: formattedMultipleSchemas2 });
15507
15552
  return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
15508
15553
  },
15509
15554
  { schemas: schemas2 }
15510
15555
  );
15511
- const lintWarnings = (0, import_chunk_6NS6O6L4.getLintWarningsAsText)(lintDiagnostics);
15556
+ const lintWarnings = (0, import_chunk_RZCTV2U3.getLintWarningsAsText)(lintDiagnostics);
15512
15557
  if (lintWarnings && import_chunk_MBB2KJWX.logger_exports.should.warn()) {
15513
15558
  console.warn(lintWarnings);
15514
15559
  }
@@ -15538,7 +15583,7 @@ function handleFormatPanic(tryCb, { schemas: schemas2 }) {
15538
15583
  }
15539
15584
  }
15540
15585
  function formatWasm(schema, documentFormattingParams) {
15541
- const formattedSchema = import_chunk_DBHRA3FT.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
15586
+ const formattedSchema = import_chunk_IOF3PJAC.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
15542
15587
  return formattedSchema;
15543
15588
  }
15544
15589
  /*! Bundled license information:
@@ -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_DBHRA3FT_exports = {};
30
- __export(chunk_DBHRA3FT_exports, {
29
+ var chunk_IOF3PJAC_exports = {};
30
+ __export(chunk_IOF3PJAC_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_DBHRA3FT_exports);
36
- var import_chunk_TEVID6C5 = require("./chunk-TEVID6C5.js");
35
+ module.exports = __toCommonJS(chunk_IOF3PJAC_exports);
36
+ var import_chunk_4QFYMU5Q = require("./chunk-4QFYMU5Q.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_TEVID6C5.require_package)();
45
+ var { dependencies } = (0, import_chunk_4QFYMU5Q.require_package)();
46
46
  var prismaSchemaWasmVersion = dependencies["@prisma/prisma-schema-wasm"];
47
47
  globalThis.PRISMA_WASM_PANIC_REGISTRY = new import_chunk_WXRVYSYN.WasmPanicRegistry();