@prisma/internals 6.20.0-integration-aqrln-wpvsvmvvnylq.1 → 6.20.0-integration-next.9

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 (43) hide show
  1. package/dist/{chunk-QUPYZRB3.js → chunk-2LK7IARS.js} +4 -4
  2. package/dist/{chunk-PKETVXFZ.js → chunk-636GLMJA.js} +8 -8
  3. package/dist/{chunk-RLWMHTFE.js → chunk-72QMYPDY.js} +5 -5
  4. package/dist/{chunk-LRBZTE4J.js → chunk-7NYREG5G.js} +7 -7
  5. package/dist/{chunk-NBWRGVYR.js → chunk-BCQZ6JQE.js} +6 -4
  6. package/dist/{chunk-QPD7JXMU.js → chunk-BEXD24W2.js} +8 -8
  7. package/dist/{chunk-2L3VMW23.js → chunk-CRAR67NP.js} +5 -5
  8. package/dist/{chunk-7SF6QSKE.js → chunk-ER4RE4VE.js} +5 -5
  9. package/dist/{chunk-WFPLYZFM.js → chunk-HNFDUV6I.js} +5 -5
  10. package/dist/{chunk-SP2ETLT2.js → chunk-OSHZ4P3G.js} +5 -5
  11. package/dist/{chunk-CKSBGY4B.js → chunk-PO2PPNKU.js} +5 -5
  12. package/dist/{chunk-PGLQ2MLS.js → chunk-R5OZXPSF.js} +18 -9
  13. package/dist/chunk-RFB2U4GQ.js +41 -0
  14. package/dist/{chunk-CIGXHXCG.js → chunk-TGA7DC5A.js} +7 -7
  15. package/dist/{chunk-VNIE2AZB.js → chunk-TQCLUNM2.js} +4 -4
  16. package/dist/{chunk-B7YQR5EW.js → chunk-UNYROOUA.js} +8 -8
  17. package/dist/{chunk-UXRSZNNZ.js → chunk-YU2W6APU.js} +30 -21
  18. package/dist/cli/checkUnsupportedDataProxy.js +24 -23
  19. package/dist/cli/directoryConfig.js +2 -2
  20. package/dist/cli/schemaContext.d.ts +6 -0
  21. package/dist/cli/schemaContext.js +25 -24
  22. package/dist/cli/types.d.ts +1 -1
  23. package/dist/engine-commands/errorHelpers.js +4 -4
  24. package/dist/engine-commands/formatSchema.js +23 -22
  25. package/dist/engine-commands/getConfig.js +7 -7
  26. package/dist/engine-commands/getDmmf.js +7 -7
  27. package/dist/engine-commands/index.js +30 -29
  28. package/dist/engine-commands/lintSchema.js +8 -8
  29. package/dist/engine-commands/mergeSchemas.js +7 -7
  30. package/dist/engine-commands/validate.js +7 -7
  31. package/dist/get-generators/getGenerators.js +26 -25
  32. package/dist/highlight/highlight.js +5 -5
  33. package/dist/index.d.ts +1 -0
  34. package/dist/index.js +47 -45
  35. package/dist/utils/getMigrateConfigDir.d.ts +2 -0
  36. package/dist/utils/getMigrateConfigDir.js +25 -0
  37. package/dist/utils/getVersionFromPackageJson.js +3 -3
  38. package/dist/utils/missingDatasource.js +4 -4
  39. package/dist/utils/missingGeneratorMessage.js +6 -6
  40. package/dist/utils/toSchemasContainer.d.ts +1 -1
  41. package/dist/utils/toSchemasContainer.js +3 -3
  42. package/dist/wasm.js +5 -5
  43. package/package.json +11 -11
@@ -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_QUPYZRB3_exports = {};
20
- __export(chunk_QUPYZRB3_exports, {
19
+ var chunk_2LK7IARS_exports = {};
20
+ __export(chunk_2LK7IARS_exports, {
21
21
  require_package: () => require_package
22
22
  });
23
- module.exports = __toCommonJS(chunk_QUPYZRB3_exports);
23
+ module.exports = __toCommonJS(chunk_2LK7IARS_exports);
24
24
  var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
25
25
  var require_package = (0, import_chunk_4VNS5WPM.__commonJS)({
26
26
  "package.json"(exports, module2) {
27
27
  module2.exports = {
28
28
  name: "@prisma/internals",
29
- version: "6.20.0-integration-aqrln-wpvsvmvvnylq.1",
29
+ version: "6.20.0-integration-next.9",
30
30
  description: "This package is intended for Prisma's internal use",
31
31
  main: "dist/index.js",
32
32
  types: "dist/index.d.ts",
@@ -26,16 +26,16 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_PKETVXFZ_exports = {};
30
- __export(chunk_PKETVXFZ_exports, {
29
+ var chunk_636GLMJA_exports = {};
30
+ __export(chunk_636GLMJA_exports, {
31
31
  GetDmmfError: () => GetDmmfError,
32
32
  getDMMF: () => getDMMF
33
33
  });
34
- module.exports = __toCommonJS(chunk_PKETVXFZ_exports);
34
+ module.exports = __toCommonJS(chunk_636GLMJA_exports);
35
35
  var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
36
36
  var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
37
- var import_chunk_CKSBGY4B = require("./chunk-CKSBGY4B.js");
38
- var import_chunk_WFPLYZFM = require("./chunk-WFPLYZFM.js");
37
+ var import_chunk_PO2PPNKU = require("./chunk-PO2PPNKU.js");
38
+ var import_chunk_HNFDUV6I = require("./chunk-HNFDUV6I.js");
39
39
  var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
40
40
  var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
41
41
  var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
@@ -58,7 +58,7 @@ ${detailsHeader} ${message}`;
58
58
  }).exhaustive();
59
59
  const errorMessageWithContext = `${constructedErrorMessage}
60
60
  [Context: getDmmf]`;
61
- super((0, import_chunk_CKSBGY4B.addVersionDetailsToErrorMessage)(errorMessageWithContext));
61
+ super((0, import_chunk_PO2PPNKU.addVersionDetailsToErrorMessage)(errorMessageWithContext));
62
62
  this.name = "GetDmmfError";
63
63
  }
64
64
  };
@@ -70,13 +70,13 @@ async function getDMMF(options) {
70
70
  () => {
71
71
  if (process.env.FORCE_PANIC_GET_DMMF) {
72
72
  debug("Triggering a Rust panic...");
73
- import_chunk_WFPLYZFM.prismaSchemaWasm.debug_panic();
73
+ import_chunk_HNFDUV6I.prismaSchemaWasm.debug_panic();
74
74
  }
75
75
  const params = JSON.stringify({
76
76
  prismaSchema: options.datamodel,
77
77
  noColor: Boolean(process.env.NO_COLOR)
78
78
  });
79
- const data = import_chunk_WFPLYZFM.prismaSchemaWasm.get_dmmf(params);
79
+ const data = import_chunk_HNFDUV6I.prismaSchemaWasm.get_dmmf(params);
80
80
  return data;
81
81
  },
82
82
  (e) => ({
@@ -16,11 +16,11 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_RLWMHTFE_exports = {};
20
- __export(chunk_RLWMHTFE_exports, {
19
+ var chunk_72QMYPDY_exports = {};
20
+ __export(chunk_72QMYPDY_exports, {
21
21
  version: () => version
22
22
  });
23
- module.exports = __toCommonJS(chunk_RLWMHTFE_exports);
24
- var import_chunk_QUPYZRB3 = require("./chunk-QUPYZRB3.js");
25
- var packageJson = (0, import_chunk_QUPYZRB3.require_package)();
23
+ module.exports = __toCommonJS(chunk_72QMYPDY_exports);
24
+ var import_chunk_2LK7IARS = require("./chunk-2LK7IARS.js");
25
+ var packageJson = (0, import_chunk_2LK7IARS.require_package)();
26
26
  var version = packageJson.version;
@@ -26,17 +26,17 @@ 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_LRBZTE4J_exports = {};
30
- __export(chunk_LRBZTE4J_exports, {
29
+ var chunk_7NYREG5G_exports = {};
30
+ __export(chunk_7NYREG5G_exports, {
31
31
  MergeSchemasError: () => MergeSchemasError,
32
32
  mergeSchemas: () => mergeSchemas
33
33
  });
34
- module.exports = __toCommonJS(chunk_LRBZTE4J_exports);
34
+ module.exports = __toCommonJS(chunk_7NYREG5G_exports);
35
35
  var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
36
36
  var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
37
37
  var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
38
- var import_chunk_CKSBGY4B = require("./chunk-CKSBGY4B.js");
39
- var import_chunk_WFPLYZFM = require("./chunk-WFPLYZFM.js");
38
+ var import_chunk_PO2PPNKU = require("./chunk-PO2PPNKU.js");
39
+ var import_chunk_HNFDUV6I = require("./chunk-HNFDUV6I.js");
40
40
  var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
41
41
  var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
42
42
  var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
@@ -59,7 +59,7 @@ ${detailsHeader} ${message}`;
59
59
  }).exhaustive();
60
60
  const errorMessageWithContext = `${constructedErrorMessage}
61
61
  [Context: mergeSchemas]`;
62
- super((0, import_chunk_CKSBGY4B.addVersionDetailsToErrorMessage)(errorMessageWithContext));
62
+ super((0, import_chunk_PO2PPNKU.addVersionDetailsToErrorMessage)(errorMessageWithContext));
63
63
  this.name = "MergeSchemasError";
64
64
  }
65
65
  };
@@ -72,7 +72,7 @@ function mergeSchemas(options) {
72
72
  const params = JSON.stringify({
73
73
  schema: options.schemas
74
74
  });
75
- return import_chunk_WFPLYZFM.prismaSchemaWasm.merge_schemas(params);
75
+ return import_chunk_HNFDUV6I.prismaSchemaWasm.merge_schemas(params);
76
76
  },
77
77
  (e) => ({
78
78
  type: "wasm-error",
@@ -26,15 +26,17 @@ 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_NBWRGVYR_exports = {};
30
- __export(chunk_NBWRGVYR_exports, {
29
+ var chunk_BCQZ6JQE_exports = {};
30
+ __export(chunk_BCQZ6JQE_exports, {
31
31
  inferDirectoryConfig: () => inferDirectoryConfig
32
32
  });
33
- module.exports = __toCommonJS(chunk_NBWRGVYR_exports);
33
+ module.exports = __toCommonJS(chunk_BCQZ6JQE_exports);
34
34
  var import_node_path = __toESM(require("node:path"));
35
35
  function inferDirectoryConfig(schemaContext, config, cwd = process.cwd()) {
36
36
  const baseDir = (
37
- // If no primary datasource exists we use the schemaRootDir.
37
+ // All default paths are relative to the `schema.prisma` file that contains the primary datasource.
38
+ // That schema file should usually be the users "root" aka main schema file.
39
+ schemaContext?.primaryDatasourceDirectory ?? // If no primary datasource exists we use the schemaRootDir.
38
40
  // `schemaRootDir` is either the directory the user supplied as schemaPath or the directory the single schema file is in.
39
41
  schemaContext?.schemaRootDir ?? // Should also that not be defined because there is no schema yet we fallback to CWD + `/prisma`.
40
42
  import_node_path.default.join(cwd, "prisma")
@@ -26,17 +26,17 @@ 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_QPD7JXMU_exports = {};
30
- __export(chunk_QPD7JXMU_exports, {
29
+ var chunk_BEXD24W2_exports = {};
30
+ __export(chunk_BEXD24W2_exports, {
31
31
  GetConfigError: () => GetConfigError,
32
32
  getConfig: () => getConfig
33
33
  });
34
- module.exports = __toCommonJS(chunk_QPD7JXMU_exports);
34
+ module.exports = __toCommonJS(chunk_BEXD24W2_exports);
35
35
  var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
36
36
  var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
37
37
  var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
38
- var import_chunk_CKSBGY4B = require("./chunk-CKSBGY4B.js");
39
- var import_chunk_WFPLYZFM = require("./chunk-WFPLYZFM.js");
38
+ var import_chunk_PO2PPNKU = require("./chunk-PO2PPNKU.js");
39
+ var import_chunk_HNFDUV6I = require("./chunk-HNFDUV6I.js");
40
40
  var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
41
41
  var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
42
42
  var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
@@ -61,7 +61,7 @@ ${detailsHeader} ${message}`;
61
61
  }).exhaustive();
62
62
  const errorMessageWithContext = `${constructedErrorMessage}
63
63
  [Context: getConfig]`;
64
- super((0, import_chunk_CKSBGY4B.addVersionDetailsToErrorMessage)(errorMessageWithContext));
64
+ super((0, import_chunk_PO2PPNKU.addVersionDetailsToErrorMessage)(errorMessageWithContext));
65
65
  this.name = "GetConfigError";
66
66
  }
67
67
  };
@@ -73,10 +73,10 @@ async function getConfig(options) {
73
73
  () => {
74
74
  if (process.env.FORCE_PANIC_GET_CONFIG) {
75
75
  debug("Triggering a Rust panic...");
76
- import_chunk_WFPLYZFM.prismaSchemaWasm.debug_panic();
76
+ import_chunk_HNFDUV6I.prismaSchemaWasm.debug_panic();
77
77
  }
78
78
  const params = JSON.stringify({ prismaSchema: options.datamodel });
79
- return import_chunk_WFPLYZFM.prismaSchemaWasm.get_config(params);
79
+ return import_chunk_HNFDUV6I.prismaSchemaWasm.get_config(params);
80
80
  },
81
81
  (e) => ({
82
82
  type: "wasm-error",
@@ -16,20 +16,20 @@ 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_2L3VMW23_exports = {};
20
- __export(chunk_2L3VMW23_exports, {
19
+ var chunk_CRAR67NP_exports = {};
20
+ __export(chunk_CRAR67NP_exports, {
21
21
  getLintWarnings: () => getLintWarnings,
22
22
  getLintWarningsAsText: () => getLintWarningsAsText,
23
23
  handleLintPanic: () => handleLintPanic,
24
24
  lintSchema: () => lintSchema,
25
25
  warningToString: () => warningToString
26
26
  });
27
- module.exports = __toCommonJS(chunk_2L3VMW23_exports);
28
- var import_chunk_WFPLYZFM = require("./chunk-WFPLYZFM.js");
27
+ module.exports = __toCommonJS(chunk_CRAR67NP_exports);
28
+ var import_chunk_HNFDUV6I = require("./chunk-HNFDUV6I.js");
29
29
  var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
30
30
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
31
31
  function lintSchema({ schemas }) {
32
- const lintResult = import_chunk_WFPLYZFM.prismaSchemaWasm.lint(JSON.stringify(schemas));
32
+ const lintResult = import_chunk_HNFDUV6I.prismaSchemaWasm.lint(JSON.stringify(schemas));
33
33
  const lintDiagnostics = JSON.parse(lintResult);
34
34
  return lintDiagnostics;
35
35
  }
@@ -16,20 +16,20 @@ 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_7SF6QSKE_exports = {};
20
- __export(chunk_7SF6QSKE_exports, {
19
+ var chunk_ER4RE4VE_exports = {};
20
+ __export(chunk_ER4RE4VE_exports, {
21
21
  missingDatasource: () => missingDatasource
22
22
  });
23
- module.exports = __toCommonJS(chunk_7SF6QSKE_exports);
23
+ module.exports = __toCommonJS(chunk_ER4RE4VE_exports);
24
24
  var import_chunk_3WXUQZS7 = require("./chunk-3WXUQZS7.js");
25
- var import_chunk_VNIE2AZB = require("./chunk-VNIE2AZB.js");
25
+ var import_chunk_TQCLUNM2 = require("./chunk-TQCLUNM2.js");
26
26
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
27
27
  var missingDatasource = `
28
28
  You don't have any ${(0, import_chunk_PG5FDKSF.bold)("datasource")} defined in your ${(0, import_chunk_PG5FDKSF.bold)("schema.prisma")}.
29
29
  You can define a datasource like this:
30
30
 
31
31
  ${(0, import_chunk_PG5FDKSF.bold)(
32
- (0, import_chunk_VNIE2AZB.highlightDatamodel)(`datasource db {
32
+ (0, import_chunk_TQCLUNM2.highlightDatamodel)(`datasource db {
33
33
  provider = "postgresql"
34
34
  }`)
35
35
  )}
@@ -26,15 +26,15 @@ 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_WFPLYZFM_exports = {};
30
- __export(chunk_WFPLYZFM_exports, {
29
+ var chunk_HNFDUV6I_exports = {};
30
+ __export(chunk_HNFDUV6I_exports, {
31
31
  prismaSchemaWasm: () => import_prisma_schema_wasm.default,
32
32
  prismaSchemaWasmVersion: () => prismaSchemaWasmVersion,
33
33
  schemaEngineWasmVersion: () => schemaEngineWasmVersion,
34
34
  wasm_exports: () => wasm_exports
35
35
  });
36
- module.exports = __toCommonJS(chunk_WFPLYZFM_exports);
37
- var import_chunk_QUPYZRB3 = require("./chunk-QUPYZRB3.js");
36
+ module.exports = __toCommonJS(chunk_HNFDUV6I_exports);
37
+ var import_chunk_2LK7IARS = require("./chunk-2LK7IARS.js");
38
38
  var import_chunk_WXRVYSYN = require("./chunk-WXRVYSYN.js");
39
39
  var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
40
40
  var import_prisma_schema_wasm = __toESM(require("@prisma/prisma-schema-wasm"));
@@ -46,6 +46,6 @@ var wasm_exports = {};
46
46
  });
47
47
  var globalWithPanicRegistry = globalThis;
48
48
  globalWithPanicRegistry.PRISMA_WASM_PANIC_REGISTRY = new import_chunk_WXRVYSYN.WasmPanicRegistry();
49
- var { dependencies } = (0, import_chunk_QUPYZRB3.require_package)();
49
+ var { dependencies } = (0, import_chunk_2LK7IARS.require_package)();
50
50
  var prismaSchemaWasmVersion = dependencies["@prisma/prisma-schema-wasm"];
51
51
  var schemaEngineWasmVersion = dependencies["@prisma/schema-engine-wasm"];
@@ -16,21 +16,21 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_SP2ETLT2_exports = {};
20
- __export(chunk_SP2ETLT2_exports, {
19
+ var chunk_OSHZ4P3G_exports = {};
20
+ __export(chunk_OSHZ4P3G_exports, {
21
21
  toSchemasContainer: () => toSchemasContainer,
22
22
  toSchemasWithConfigDir: () => toSchemasWithConfigDir
23
23
  });
24
- module.exports = __toCommonJS(chunk_SP2ETLT2_exports);
24
+ module.exports = __toCommonJS(chunk_OSHZ4P3G_exports);
25
25
  function toSchemasContainer(schemas) {
26
26
  return {
27
27
  files: multipleSchemasToSchemaContainers(schemas)
28
28
  };
29
29
  }
30
- function toSchemasWithConfigDir(schemaContext, configDir) {
30
+ function toSchemasWithConfigDir(schemaContext) {
31
31
  return {
32
32
  files: multipleSchemasToSchemaContainers(schemaContext.schemaFiles),
33
- configDir
33
+ configDir: schemaContext.primaryDatasourceDirectory
34
34
  };
35
35
  }
36
36
  function multipleSchemasToSchemaContainers(schemas) {
@@ -16,15 +16,15 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_CKSBGY4B_exports = {};
20
- __export(chunk_CKSBGY4B_exports, {
19
+ var chunk_PO2PPNKU_exports = {};
20
+ __export(chunk_PO2PPNKU_exports, {
21
21
  addVersionDetailsToErrorMessage: () => addVersionDetailsToErrorMessage
22
22
  });
23
- module.exports = __toCommonJS(chunk_CKSBGY4B_exports);
23
+ module.exports = __toCommonJS(chunk_PO2PPNKU_exports);
24
24
  var import_chunk_QN6PSQY7 = require("./chunk-QN6PSQY7.js");
25
- var import_chunk_RLWMHTFE = require("./chunk-RLWMHTFE.js");
25
+ var import_chunk_72QMYPDY = require("./chunk-72QMYPDY.js");
26
26
  function addVersionDetailsToErrorMessage(message) {
27
- const rows = [["Prisma CLI Version", import_chunk_RLWMHTFE.version]];
27
+ const rows = [["Prisma CLI Version", import_chunk_72QMYPDY.version]];
28
28
  return `${message}
29
29
 
30
30
  ${(0, import_chunk_QN6PSQY7.formatTable)(rows)}`;
@@ -26,8 +26,8 @@ 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_PGLQ2MLS_exports = {};
30
- __export(chunk_PGLQ2MLS_exports, {
29
+ var chunk_R5OZXPSF_exports = {};
30
+ __export(chunk_R5OZXPSF_exports, {
31
31
  checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
32
32
  forbiddenCmdWithDataProxyFlagMessage: () => forbiddenCmdWithDataProxyFlagMessage,
33
33
  formatSchema: () => formatSchema,
@@ -40,15 +40,15 @@ __export(chunk_PGLQ2MLS_exports, {
40
40
  processSchemaResult: () => processSchemaResult,
41
41
  skipIndex: () => skipIndex
42
42
  });
43
- module.exports = __toCommonJS(chunk_PGLQ2MLS_exports);
43
+ module.exports = __toCommonJS(chunk_R5OZXPSF_exports);
44
44
  var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
45
45
  var import_chunk_5MHUYAV3 = require("./chunk-5MHUYAV3.js");
46
46
  var import_chunk_X3P4J7WW = require("./chunk-X3P4J7WW.js");
47
47
  var import_chunk_LRU47BGE = require("./chunk-LRU47BGE.js");
48
- var import_chunk_5FJ3MENK = require("./chunk-5FJ3MENK.js");
49
- var import_chunk_CIGXHXCG = require("./chunk-CIGXHXCG.js");
50
48
  var import_chunk_GXW4NTU2 = require("./chunk-GXW4NTU2.js");
51
- var import_chunk_7SF6QSKE = require("./chunk-7SF6QSKE.js");
49
+ var import_chunk_5FJ3MENK = require("./chunk-5FJ3MENK.js");
50
+ var import_chunk_ER4RE4VE = require("./chunk-ER4RE4VE.js");
51
+ var import_chunk_TGA7DC5A = require("./chunk-TGA7DC5A.js");
52
52
  var import_chunk_3WXUQZS7 = require("./chunk-3WXUQZS7.js");
53
53
  var import_chunk_CRVLHWC5 = require("./chunk-CRVLHWC5.js");
54
54
  var import_chunk_2Z7PH5WX = require("./chunk-2Z7PH5WX.js");
@@ -162,6 +162,7 @@ async function processSchemaResult({
162
162
  }
163
163
  const configFromPsl = await (0, import_chunk_XHZ4TZUD.getConfig)({ datamodel: schemaResult.schemas });
164
164
  const primaryDatasource = configFromPsl.datasources.at(0);
165
+ const primaryDatasourceDirectory = getPrimaryDatasourceDirectory(primaryDatasource) || schemaRootDir;
165
166
  return {
166
167
  schemaFiles: schemaResult.schemas,
167
168
  schemaPath: schemaResult.schemaPath,
@@ -169,10 +170,18 @@ async function processSchemaResult({
169
170
  datasources: configFromPsl.datasources,
170
171
  generators: configFromPsl.generators,
171
172
  primaryDatasource,
173
+ primaryDatasourceDirectory,
172
174
  warnings: configFromPsl.warnings,
173
175
  loadedFromPathForLogMessages
174
176
  };
175
177
  }
178
+ function getPrimaryDatasourceDirectory(primaryDatasource) {
179
+ const datasourcePath = primaryDatasource?.sourceFilePath;
180
+ if (datasourcePath) {
181
+ return import_node_path.default.dirname(datasourcePath);
182
+ }
183
+ return null;
184
+ }
176
185
  function getSchemaDatasourceProvider(schemaContext) {
177
186
  if (schemaContext.primaryDatasource === void 0) {
178
187
  throw new Error("Schema must contain a datasource block");
@@ -211,7 +220,7 @@ async function getGenerators(options) {
211
220
  throw new Error(`no schema provided for getGenerators`);
212
221
  }
213
222
  if (!schemaContext.primaryDatasource) {
214
- throw new Error(import_chunk_7SF6QSKE.missingDatasource);
223
+ throw new Error(import_chunk_ER4RE4VE.missingDatasource);
215
224
  }
216
225
  (0, import_chunk_5FJ3MENK.printConfigWarnings)(schemaContext.warnings);
217
226
  const previewFeatures = (0, import_chunk_CRVLHWC5.extractPreviewFeatures)(schemaContext.generators);
@@ -221,9 +230,9 @@ async function getGenerators(options) {
221
230
  });
222
231
  if (dmmf.datamodel.models.length === 0 && !allowNoModels) {
223
232
  if (schemaContext.primaryDatasource.provider === "mongodb") {
224
- throw new Error(import_chunk_CIGXHXCG.missingModelMessageMongoDB);
233
+ throw new Error(import_chunk_TGA7DC5A.missingModelMessageMongoDB);
225
234
  }
226
- throw new Error(import_chunk_CIGXHXCG.missingModelMessage);
235
+ throw new Error(import_chunk_TGA7DC5A.missingModelMessage);
227
236
  }
228
237
  const generatorConfigs = filterGenerators(overrideGenerators || schemaContext.generators, generatorNames);
229
238
  await validateGenerators(generatorConfigs);
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var chunk_RFB2U4GQ_exports = {};
30
+ __export(chunk_RFB2U4GQ_exports, {
31
+ getMigrateConfigDir: () => getMigrateConfigDir
32
+ });
33
+ module.exports = __toCommonJS(chunk_RFB2U4GQ_exports);
34
+ var import_path = __toESM(require("path"));
35
+ function getMigrateConfigDir(config, schemaPath) {
36
+ const sourcePath = config?.datasources?.[0]?.sourceFilePath;
37
+ if (sourcePath) {
38
+ return import_path.default.dirname(sourcePath);
39
+ }
40
+ return schemaPath ? import_path.default.dirname(schemaPath) : process.cwd();
41
+ }
@@ -16,15 +16,15 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_CIGXHXCG_exports = {};
20
- __export(chunk_CIGXHXCG_exports, {
19
+ var chunk_TGA7DC5A_exports = {};
20
+ __export(chunk_TGA7DC5A_exports, {
21
21
  missingGeneratorMessage: () => missingGeneratorMessage,
22
22
  missingModelMessage: () => missingModelMessage,
23
23
  missingModelMessageMongoDB: () => missingModelMessageMongoDB
24
24
  });
25
- module.exports = __toCommonJS(chunk_CIGXHXCG_exports);
25
+ module.exports = __toCommonJS(chunk_TGA7DC5A_exports);
26
26
  var import_chunk_3WXUQZS7 = require("./chunk-3WXUQZS7.js");
27
- var import_chunk_VNIE2AZB = require("./chunk-VNIE2AZB.js");
27
+ var import_chunk_TQCLUNM2 = require("./chunk-TQCLUNM2.js");
28
28
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
29
29
  var missingGeneratorMessage = `
30
30
  ${(0, import_chunk_PG5FDKSF.blue)("info")} You don't have any generators defined in your ${(0, import_chunk_PG5FDKSF.bold)(
@@ -33,7 +33,7 @@ ${(0, import_chunk_PG5FDKSF.blue)("info")} You don't have any generators defined
33
33
  Add the Prisma Client generator like this:
34
34
 
35
35
  ${(0, import_chunk_PG5FDKSF.bold)(
36
- (0, import_chunk_VNIE2AZB.highlightDatamodel)(`generator client {
36
+ (0, import_chunk_TQCLUNM2.highlightDatamodel)(`generator client {
37
37
  provider = "prisma-client"
38
38
  output = "../src/generated/prisma"
39
39
  }`)
@@ -49,7 +49,7 @@ You don't have any ${(0, import_chunk_PG5FDKSF.bold)("models")} defined in your
49
49
  You can define a model like this:
50
50
 
51
51
  ${(0, import_chunk_PG5FDKSF.bold)(
52
- (0, import_chunk_VNIE2AZB.highlightDatamodel)(`model User {
52
+ (0, import_chunk_TQCLUNM2.highlightDatamodel)(`model User {
53
53
  id Int @id @default(autoincrement())
54
54
  email String @unique
55
55
  name String?
@@ -66,7 +66,7 @@ You don't have any ${(0, import_chunk_PG5FDKSF.bold)("models")} defined in your
66
66
  You can define a model like this:
67
67
 
68
68
  ${(0, import_chunk_PG5FDKSF.bold)(
69
- (0, import_chunk_VNIE2AZB.highlightDatamodel)(`model User {
69
+ (0, import_chunk_TQCLUNM2.highlightDatamodel)(`model User {
70
70
  id String @id @default(auto()) @map("_id") @db.ObjectId
71
71
  email String @unique
72
72
  name String?
@@ -16,15 +16,15 @@ var __copyProps = (to, from, except, desc) => {
16
16
  return to;
17
17
  };
18
18
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
- var chunk_VNIE2AZB_exports = {};
20
- __export(chunk_VNIE2AZB_exports, {
19
+ var chunk_TQCLUNM2_exports = {};
20
+ __export(chunk_TQCLUNM2_exports, {
21
21
  highlightDatamodel: () => highlightDatamodel,
22
22
  highlightSql: () => highlightSql,
23
23
  highlightTS: () => highlightTS
24
24
  });
25
- module.exports = __toCommonJS(chunk_VNIE2AZB_exports);
26
- var import_chunk_CYAS6B5N = require("./chunk-CYAS6B5N.js");
25
+ module.exports = __toCommonJS(chunk_TQCLUNM2_exports);
27
26
  var import_chunk_OIVPX3BR = require("./chunk-OIVPX3BR.js");
27
+ var import_chunk_CYAS6B5N = require("./chunk-CYAS6B5N.js");
28
28
  var import_chunk_HPVMQFIY = require("./chunk-HPVMQFIY.js");
29
29
  function highlightDatamodel(str) {
30
30
  return highlight(str, import_chunk_OIVPX3BR.dml);
@@ -26,17 +26,17 @@ 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_B7YQR5EW_exports = {};
30
- __export(chunk_B7YQR5EW_exports, {
29
+ var chunk_UNYROOUA_exports = {};
30
+ __export(chunk_UNYROOUA_exports, {
31
31
  ValidateError: () => ValidateError,
32
32
  validate: () => validate
33
33
  });
34
- module.exports = __toCommonJS(chunk_B7YQR5EW_exports);
34
+ module.exports = __toCommonJS(chunk_UNYROOUA_exports);
35
35
  var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
36
36
  var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
37
37
  var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
38
- var import_chunk_CKSBGY4B = require("./chunk-CKSBGY4B.js");
39
- var import_chunk_WFPLYZFM = require("./chunk-WFPLYZFM.js");
38
+ var import_chunk_PO2PPNKU = require("./chunk-PO2PPNKU.js");
39
+ var import_chunk_HNFDUV6I = require("./chunk-HNFDUV6I.js");
40
40
  var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
41
41
  var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
42
42
  var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
@@ -59,7 +59,7 @@ ${detailsHeader} ${message}`;
59
59
  }).exhaustive();
60
60
  const errorMessageWithContext = `${constructedErrorMessage}
61
61
  [Context: validate]`;
62
- super((0, import_chunk_CKSBGY4B.addVersionDetailsToErrorMessage)(errorMessageWithContext));
62
+ super((0, import_chunk_PO2PPNKU.addVersionDetailsToErrorMessage)(errorMessageWithContext));
63
63
  this.name = "ValidateError";
64
64
  }
65
65
  };
@@ -71,13 +71,13 @@ function validate(options) {
71
71
  () => {
72
72
  if (process.env.FORCE_PANIC_GET_DMMF) {
73
73
  debug("Triggering a Rust panic...");
74
- import_chunk_WFPLYZFM.prismaSchemaWasm.debug_panic();
74
+ import_chunk_HNFDUV6I.prismaSchemaWasm.debug_panic();
75
75
  }
76
76
  const params = JSON.stringify({
77
77
  prismaSchema: options.schemas,
78
78
  noColor: Boolean(process.env.NO_COLOR)
79
79
  });
80
- import_chunk_WFPLYZFM.prismaSchemaWasm.validate(params);
80
+ import_chunk_HNFDUV6I.prismaSchemaWasm.validate(params);
81
81
  },
82
82
  (e) => ({
83
83
  type: "wasm-error",