@prisma/internals 7.1.0-dev.24 → 7.1.0-dev.25

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 (35) hide show
  1. package/dist/{chunk-5LLB3I23.js → chunk-2GPKMSOD.js} +8 -8
  2. package/dist/{chunk-OKVM3CW4.js → chunk-42R3EIRM.js} +55 -31
  3. package/dist/{chunk-WSDTB37U.js → chunk-BSTKI4C6.js} +7 -7
  4. package/dist/{chunk-APENA6OU.js → chunk-DHXFLZH6.js} +5 -5
  5. package/dist/{chunk-YJ5MOWNO.js → chunk-EP55SKQT.js} +5 -5
  6. package/dist/{chunk-YJT2VCZV.js → chunk-IRWN7VWI.js} +5 -5
  7. package/dist/{chunk-PXHCDUNQ.js → chunk-JBCREIAZ.js} +8 -8
  8. package/dist/{chunk-G4PGY4QB.js → chunk-NOI2AJX3.js} +15 -22
  9. package/dist/{chunk-FMAY4ZPE.js → chunk-P5XU7RDL.js} +27 -34
  10. package/dist/{chunk-PTJ2L4H6.js → chunk-T552BHW2.js} +8 -8
  11. package/dist/{chunk-GL7OANR6.js → chunk-TCDF53CN.js} +6 -6
  12. package/dist/{chunk-TDOFVXHC.js → chunk-V62WWVGA.js} +5 -5
  13. package/dist/{chunk-6SRPH7EV.js → chunk-WOYGJR7Y.js} +4 -4
  14. package/dist/cli/checkUnsupportedDataProxy.js +14 -14
  15. package/dist/cli/getSchema.d.ts +27 -5
  16. package/dist/cli/getSchema.js +7 -4
  17. package/dist/cli/hashes.d.ts +2 -1
  18. package/dist/cli/hashes.js +4 -4
  19. package/dist/cli/schemaContext.d.ts +2 -2
  20. package/dist/cli/schemaContext.js +15 -15
  21. package/dist/cli/types.d.ts +1 -1
  22. package/dist/engine-commands/errorHelpers.js +4 -4
  23. package/dist/engine-commands/formatSchema.js +13 -13
  24. package/dist/engine-commands/getConfig.js +7 -7
  25. package/dist/engine-commands/getDmmf.js +7 -7
  26. package/dist/engine-commands/index.js +20 -20
  27. package/dist/engine-commands/lintSchema.js +8 -8
  28. package/dist/engine-commands/mergeSchemas.js +7 -7
  29. package/dist/engine-commands/validate.js +7 -7
  30. package/dist/get-generators/getGenerators.js +16 -16
  31. package/dist/index.d.ts +1 -1
  32. package/dist/index.js +35 -34
  33. package/dist/utils/getVersionFromPackageJson.js +3 -3
  34. package/dist/wasm.js +5 -5
  35. package/package.json +11 -11
@@ -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_5LLB3I23_exports = {};
30
- __export(chunk_5LLB3I23_exports, {
29
+ var chunk_2GPKMSOD_exports = {};
30
+ __export(chunk_2GPKMSOD_exports, {
31
31
  GetDmmfError: () => GetDmmfError,
32
32
  getDMMF: () => getDMMF
33
33
  });
34
- module.exports = __toCommonJS(chunk_5LLB3I23_exports);
34
+ module.exports = __toCommonJS(chunk_2GPKMSOD_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_YJ5MOWNO = require("./chunk-YJ5MOWNO.js");
38
- var import_chunk_TDOFVXHC = require("./chunk-TDOFVXHC.js");
37
+ var import_chunk_EP55SKQT = require("./chunk-EP55SKQT.js");
38
+ var import_chunk_V62WWVGA = require("./chunk-V62WWVGA.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_YJ5MOWNO.addVersionDetailsToErrorMessage)(errorMessageWithContext));
61
+ super((0, import_chunk_EP55SKQT.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_TDOFVXHC.prismaSchemaWasm.debug_panic();
73
+ import_chunk_V62WWVGA.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_TDOFVXHC.prismaSchemaWasm.get_dmmf(params);
79
+ const data = import_chunk_V62WWVGA.prismaSchemaWasm.get_dmmf(params);
80
80
  return data;
81
81
  },
82
82
  (e) => ({
@@ -26,13 +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_OKVM3CW4_exports = {};
30
- __export(chunk_OKVM3CW4_exports, {
29
+ var chunk_42R3EIRM_exports = {};
30
+ __export(chunk_42R3EIRM_exports, {
31
+ createSchemaPathInput: () => createSchemaPathInput,
32
+ getCliProvidedSchemaFile: () => getCliProvidedSchemaFile,
33
+ getConfigProvidedSchemaFile: () => getConfigProvidedSchemaFile,
31
34
  getSchemaWithPath: () => getSchemaWithPath,
32
35
  getSchemaWithPathOptional: () => getSchemaWithPathOptional,
33
36
  printSchemaLoadedMessage: () => printSchemaLoadedMessage
34
37
  });
35
- module.exports = __toCommonJS(chunk_OKVM3CW4_exports);
38
+ module.exports = __toCommonJS(chunk_42R3EIRM_exports);
36
39
  var import_chunk_PG5FDKSF = require("./chunk-PG5FDKSF.js");
37
40
  var import_debug = require("@prisma/debug");
38
41
  var import_schema_files_loader = require("@prisma/schema-files-loader");
@@ -42,15 +45,30 @@ var import_util = require("util");
42
45
  var readFile = (0, import_util.promisify)(import_fs.default.readFile);
43
46
  var stat = (0, import_util.promisify)(import_fs.default.stat);
44
47
  var debug = (0, import_debug.Debug)("prisma:getSchema");
45
- async function getSchemaWithPath(schemaPathFromArgs, schemaPathFromConfig, { cwd = process.cwd(), argumentName = "--schema" } = {}) {
46
- const result = await getSchemaWithPathInternal(schemaPathFromArgs, schemaPathFromConfig, { cwd, argumentName });
48
+ function createSchemaPathInput({
49
+ schemaPathFromArgs,
50
+ schemaPathFromConfig,
51
+ baseDir
52
+ }) {
53
+ return schemaPathFromArgs ? { cliProvidedPath: schemaPathFromArgs } : schemaPathFromConfig ? { configProvidedPath: schemaPathFromConfig } : { baseDir };
54
+ }
55
+ async function getSchemaWithPath({
56
+ schemaPath,
57
+ cwd = process.cwd(),
58
+ argumentName = "--schema"
59
+ }) {
60
+ const result = await getSchemaWithPathInternal({ schemaPath, cwd, argumentName });
47
61
  if (result.ok) {
48
62
  return result.schema;
49
63
  }
50
64
  throw new Error(renderDefaultLookupError(result.error, cwd));
51
65
  }
52
- async function getSchemaWithPathOptional(schemaPathFromArgs, schemaPathFromConfig, { cwd = process.cwd(), argumentName = "--schema" } = {}) {
53
- const result = await getSchemaWithPathInternal(schemaPathFromArgs, schemaPathFromConfig, { cwd, argumentName });
66
+ async function getSchemaWithPathOptional({
67
+ schemaPath,
68
+ cwd = process.cwd(),
69
+ argumentName = "--schema"
70
+ }) {
71
+ const result = await getSchemaWithPathInternal({ schemaPath, cwd, argumentName });
54
72
  if (result.ok) {
55
73
  return result.schema;
56
74
  }
@@ -99,25 +117,24 @@ async function readSchemaFromFileOrDirectory(schemaPath) {
99
117
  }
100
118
  return { ok: false, error: { kind: "WrongType", path: schemaPath, expectedTypes: ["file", "directory"] } };
101
119
  }
102
- async function getSchemaWithPathInternal(schemaPathFromArgs, schemaPathFromConfig, { cwd, argumentName }) {
103
- if (schemaPathFromArgs) {
104
- const absPath = import_path.default.resolve(cwd, schemaPathFromArgs);
105
- const customSchemaResult = await readSchemaFromFileOrDirectory(absPath);
106
- if (!customSchemaResult.ok) {
107
- const relPath = import_path.default.relative(cwd, absPath);
108
- throw new Error(
109
- `Could not load \`${argumentName}\` from provided path \`${relPath}\`: ${renderLookupError(
110
- customSchemaResult.error
111
- )}`
112
- );
113
- }
114
- return customSchemaResult;
120
+ async function getSchemaWithPathInternal({
121
+ schemaPath,
122
+ cwd,
123
+ argumentName
124
+ }) {
125
+ if ("cliProvidedPath" in schemaPath) {
126
+ return {
127
+ ok: true,
128
+ schema: await getCliProvidedSchemaFile(schemaPath.cliProvidedPath, cwd, argumentName)
129
+ };
115
130
  }
116
- const prismaConfigResult = await readSchemaFromPrismaConfigBasedLocation(schemaPathFromConfig);
117
- if (prismaConfigResult.ok) {
118
- return prismaConfigResult;
131
+ if ("configProvidedPath" in schemaPath) {
132
+ return {
133
+ ok: true,
134
+ schema: await getConfigProvidedSchemaFile(schemaPath.configProvidedPath)
135
+ };
119
136
  }
120
- const defaultResult = await getDefaultSchema(cwd);
137
+ const defaultResult = await getDefaultSchema(schemaPath.baseDir);
121
138
  if (defaultResult.ok) {
122
139
  return defaultResult;
123
140
  }
@@ -156,13 +173,20 @@ function renderDefaultLookupError(error, cwd) {
156
173
  parts.push("\nSee also https://pris.ly/d/prisma-schema-location");
157
174
  return parts.join("\n");
158
175
  }
159
- async function readSchemaFromPrismaConfigBasedLocation(schemaPathFromConfig) {
160
- if (!schemaPathFromConfig) {
161
- return {
162
- ok: false,
163
- error: { kind: "PrismaConfigNotConfigured" }
164
- };
176
+ async function getCliProvidedSchemaFile(schemaPathFromArgs, cwd = process.cwd(), argumentName = "--schema") {
177
+ const absPath = import_path.default.resolve(cwd, schemaPathFromArgs);
178
+ const customSchemaResult = await readSchemaFromFileOrDirectory(absPath);
179
+ if (!customSchemaResult.ok) {
180
+ const relPath = import_path.default.relative(cwd, absPath);
181
+ throw new Error(
182
+ `Could not load \`${argumentName}\` from provided path \`${relPath}\`: ${renderLookupError(
183
+ customSchemaResult.error
184
+ )}`
185
+ );
165
186
  }
187
+ return customSchemaResult.schema;
188
+ }
189
+ async function getConfigProvidedSchemaFile(schemaPathFromConfig) {
166
190
  const schemaResult = await readSchemaFromFileOrDirectory(schemaPathFromConfig);
167
191
  if (!schemaResult.ok) {
168
192
  throw new Error(
@@ -171,7 +195,7 @@ async function readSchemaFromPrismaConfigBasedLocation(schemaPathFromConfig) {
171
195
  )}`
172
196
  );
173
197
  }
174
- return schemaResult;
198
+ return schemaResult.schema;
175
199
  }
176
200
  async function getDefaultSchema(cwd, failures = []) {
177
201
  const lookupPaths = [import_path.default.join(cwd, "schema.prisma"), import_path.default.join(cwd, "prisma", "schema.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_WSDTB37U_exports = {};
30
- __export(chunk_WSDTB37U_exports, {
29
+ var chunk_BSTKI4C6_exports = {};
30
+ __export(chunk_BSTKI4C6_exports, {
31
31
  MergeSchemasError: () => MergeSchemasError,
32
32
  mergeSchemas: () => mergeSchemas
33
33
  });
34
- module.exports = __toCommonJS(chunk_WSDTB37U_exports);
34
+ module.exports = __toCommonJS(chunk_BSTKI4C6_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_YJ5MOWNO = require("./chunk-YJ5MOWNO.js");
39
- var import_chunk_TDOFVXHC = require("./chunk-TDOFVXHC.js");
38
+ var import_chunk_EP55SKQT = require("./chunk-EP55SKQT.js");
39
+ var import_chunk_V62WWVGA = require("./chunk-V62WWVGA.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_YJ5MOWNO.addVersionDetailsToErrorMessage)(errorMessageWithContext));
62
+ super((0, import_chunk_EP55SKQT.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_TDOFVXHC.prismaSchemaWasm.merge_schemas(params);
75
+ return import_chunk_V62WWVGA.prismaSchemaWasm.merge_schemas(params);
76
76
  },
77
77
  (e) => ({
78
78
  type: "wasm-error",
@@ -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_APENA6OU_exports = {};
20
- __export(chunk_APENA6OU_exports, {
19
+ var chunk_DHXFLZH6_exports = {};
20
+ __export(chunk_DHXFLZH6_exports, {
21
21
  version: () => version
22
22
  });
23
- module.exports = __toCommonJS(chunk_APENA6OU_exports);
24
- var import_chunk_6SRPH7EV = require("./chunk-6SRPH7EV.js");
25
- var packageJson = (0, import_chunk_6SRPH7EV.require_package)();
23
+ module.exports = __toCommonJS(chunk_DHXFLZH6_exports);
24
+ var import_chunk_WOYGJR7Y = require("./chunk-WOYGJR7Y.js");
25
+ var packageJson = (0, import_chunk_WOYGJR7Y.require_package)();
26
26
  var version = packageJson.version;
@@ -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_YJ5MOWNO_exports = {};
20
- __export(chunk_YJ5MOWNO_exports, {
19
+ var chunk_EP55SKQT_exports = {};
20
+ __export(chunk_EP55SKQT_exports, {
21
21
  addVersionDetailsToErrorMessage: () => addVersionDetailsToErrorMessage
22
22
  });
23
- module.exports = __toCommonJS(chunk_YJ5MOWNO_exports);
23
+ module.exports = __toCommonJS(chunk_EP55SKQT_exports);
24
24
  var import_chunk_QN6PSQY7 = require("./chunk-QN6PSQY7.js");
25
- var import_chunk_APENA6OU = require("./chunk-APENA6OU.js");
25
+ var import_chunk_DHXFLZH6 = require("./chunk-DHXFLZH6.js");
26
26
  function addVersionDetailsToErrorMessage(message) {
27
- const rows = [["Prisma CLI Version", import_chunk_APENA6OU.version]];
27
+ const rows = [["Prisma CLI Version", import_chunk_DHXFLZH6.version]];
28
28
  return `${message}
29
29
 
30
30
  ${(0, import_chunk_QN6PSQY7.formatTable)(rows)}`;
@@ -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_YJT2VCZV_exports = {};
20
- __export(chunk_YJT2VCZV_exports, {
19
+ var chunk_IRWN7VWI_exports = {};
20
+ __export(chunk_IRWN7VWI_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_YJT2VCZV_exports);
28
- var import_chunk_TDOFVXHC = require("./chunk-TDOFVXHC.js");
27
+ module.exports = __toCommonJS(chunk_IRWN7VWI_exports);
28
+ var import_chunk_V62WWVGA = require("./chunk-V62WWVGA.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_TDOFVXHC.prismaSchemaWasm.lint(JSON.stringify(schemas));
32
+ const lintResult = import_chunk_V62WWVGA.prismaSchemaWasm.lint(JSON.stringify(schemas));
33
33
  const lintDiagnostics = JSON.parse(lintResult);
34
34
  return lintDiagnostics;
35
35
  }
@@ -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_PXHCDUNQ_exports = {};
30
- __export(chunk_PXHCDUNQ_exports, {
29
+ var chunk_JBCREIAZ_exports = {};
30
+ __export(chunk_JBCREIAZ_exports, {
31
31
  ValidateError: () => ValidateError,
32
32
  validate: () => validate
33
33
  });
34
- module.exports = __toCommonJS(chunk_PXHCDUNQ_exports);
34
+ module.exports = __toCommonJS(chunk_JBCREIAZ_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_YJ5MOWNO = require("./chunk-YJ5MOWNO.js");
39
- var import_chunk_TDOFVXHC = require("./chunk-TDOFVXHC.js");
38
+ var import_chunk_EP55SKQT = require("./chunk-EP55SKQT.js");
39
+ var import_chunk_V62WWVGA = require("./chunk-V62WWVGA.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_YJ5MOWNO.addVersionDetailsToErrorMessage)(errorMessageWithContext));
62
+ super((0, import_chunk_EP55SKQT.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_TDOFVXHC.prismaSchemaWasm.debug_panic();
74
+ import_chunk_V62WWVGA.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_TDOFVXHC.prismaSchemaWasm.validate(params);
80
+ import_chunk_V62WWVGA.prismaSchemaWasm.validate(params);
81
81
  },
82
82
  (e) => ({
83
83
  type: "wasm-error",
@@ -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_G4PGY4QB_exports = {};
30
- __export(chunk_G4PGY4QB_exports, {
29
+ var chunk_NOI2AJX3_exports = {};
30
+ __export(chunk_NOI2AJX3_exports, {
31
31
  checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
32
32
  forbiddenCmdWithDataProxyFlagMessage: () => forbiddenCmdWithDataProxyFlagMessage,
33
33
  formatSchema: () => formatSchema,
@@ -40,7 +40,7 @@ __export(chunk_G4PGY4QB_exports, {
40
40
  processSchemaResult: () => processSchemaResult,
41
41
  skipIndex: () => skipIndex
42
42
  });
43
- module.exports = __toCommonJS(chunk_G4PGY4QB_exports);
43
+ module.exports = __toCommonJS(chunk_NOI2AJX3_exports);
44
44
  var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
45
45
  var import_chunk_PKOQQT7I = require("./chunk-PKOQQT7I.js");
46
46
  var import_chunk_X3P4J7WW = require("./chunk-X3P4J7WW.js");
@@ -56,7 +56,7 @@ var import_chunk_N45JGAVD = require("./chunk-N45JGAVD.js");
56
56
  var import_chunk_KXRZEF4O = require("./chunk-KXRZEF4O.js");
57
57
  var import_chunk_5HY5O3QI = require("./chunk-5HY5O3QI.js");
58
58
  var import_chunk_BJ6ZRB4X = require("./chunk-BJ6ZRB4X.js");
59
- var import_chunk_OKVM3CW4 = require("./chunk-OKVM3CW4.js");
59
+ var import_chunk_42R3EIRM = require("./chunk-42R3EIRM.js");
60
60
  var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
61
61
  var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
62
62
  var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
@@ -127,26 +127,19 @@ function formatWasm(schema, documentFormattingParams) {
127
127
  const formattedSchema = import_chunk_BJ6ZRB4X.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
128
128
  return formattedSchema;
129
129
  }
130
- async function loadSchemaContext({
131
- schemaPathFromArg,
132
- schemaPathFromConfig,
133
- printLoadMessage = true,
134
- allowNull = false,
135
- schemaPathArgumentName = "--schema",
136
- cwd = process.cwd()
137
- } = {}) {
130
+ async function loadSchemaContext({ schemaPath, printLoadMessage, allowNull, schemaPathArgumentName, cwd } = {
131
+ schemaPath: { baseDir: process.cwd() },
132
+ printLoadMessage: true,
133
+ allowNull: false,
134
+ schemaPathArgumentName: "--schema",
135
+ cwd: process.cwd()
136
+ }) {
138
137
  let schemaResult = null;
139
138
  if (allowNull) {
140
- schemaResult = await (0, import_chunk_OKVM3CW4.getSchemaWithPathOptional)(schemaPathFromArg, schemaPathFromConfig, {
141
- argumentName: schemaPathArgumentName,
142
- cwd
143
- });
139
+ schemaResult = await (0, import_chunk_42R3EIRM.getSchemaWithPathOptional)({ schemaPath, cwd, argumentName: schemaPathArgumentName });
144
140
  if (!schemaResult) return null;
145
141
  } else {
146
- schemaResult = await (0, import_chunk_OKVM3CW4.getSchemaWithPath)(schemaPathFromArg, schemaPathFromConfig, {
147
- argumentName: schemaPathArgumentName,
148
- cwd
149
- });
142
+ schemaResult = await (0, import_chunk_42R3EIRM.getSchemaWithPath)({ schemaPath, cwd, argumentName: schemaPathArgumentName });
150
143
  }
151
144
  return processSchemaResult({ schemaResult, printLoadMessage, cwd });
152
145
  }
@@ -158,7 +151,7 @@ async function processSchemaResult({
158
151
  const loadedFromPathForLogMessages = import_node_path.default.relative(cwd, schemaResult.schemaPath);
159
152
  const schemaRootDir = schemaResult.schemaRootDir || cwd;
160
153
  if (printLoadMessage) {
161
- (0, import_chunk_OKVM3CW4.printSchemaLoadedMessage)(loadedFromPathForLogMessages);
154
+ (0, import_chunk_42R3EIRM.printSchemaLoadedMessage)(loadedFromPathForLogMessages);
162
155
  }
163
156
  const configFromPsl = await (0, import_chunk_KXRZEF4O.getConfig)({ datamodel: schemaResult.schemas });
164
157
  const primaryDatasource = configFromPsl.datasources.at(0);
@@ -206,7 +199,7 @@ async function getGenerators(options) {
206
199
  allowNoModels = true,
207
200
  typedSql
208
201
  } = options;
209
- const schemaContext = !options.schemaContext && schemaPath ? await loadSchemaContext({ schemaPathFromArg: schemaPath }) : options.schemaContext;
202
+ const schemaContext = !options.schemaContext && schemaPath ? await loadSchemaContext({ schemaPath: { cliProvidedPath: schemaPath } }) : options.schemaContext;
210
203
  if (!schemaContext) {
211
204
  throw new Error(`no schema provided for getGenerators`);
212
205
  }
@@ -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_FMAY4ZPE_exports = {};
30
- __export(chunk_FMAY4ZPE_exports, {
29
+ var chunk_P5XU7RDL_exports = {};
30
+ __export(chunk_P5XU7RDL_exports, {
31
31
  checkUnsupportedDataProxy: () => checkUnsupportedDataProxy,
32
32
  forbiddenCmdWithDataProxyFlagMessage: () => forbiddenCmdWithDataProxyFlagMessage,
33
33
  formatSchema: () => formatSchema,
@@ -40,7 +40,7 @@ __export(chunk_FMAY4ZPE_exports, {
40
40
  processSchemaResult: () => processSchemaResult,
41
41
  skipIndex: () => skipIndex
42
42
  });
43
- module.exports = __toCommonJS(chunk_FMAY4ZPE_exports);
43
+ module.exports = __toCommonJS(chunk_P5XU7RDL_exports);
44
44
  var import_chunk_X77CS5RK = require("./chunk-X77CS5RK.js");
45
45
  var import_chunk_PKOQQT7I = require("./chunk-PKOQQT7I.js");
46
46
  var import_chunk_X3P4J7WW = require("./chunk-X3P4J7WW.js");
@@ -51,12 +51,12 @@ var import_chunk_GXW4NTU2 = require("./chunk-GXW4NTU2.js");
51
51
  var import_chunk_BGMZPA2F = require("./chunk-BGMZPA2F.js");
52
52
  var import_chunk_I6WLABB2 = require("./chunk-I6WLABB2.js");
53
53
  var import_chunk_CRVLHWC5 = require("./chunk-CRVLHWC5.js");
54
- var import_chunk_YJT2VCZV = require("./chunk-YJT2VCZV.js");
55
- var import_chunk_WSDTB37U = require("./chunk-WSDTB37U.js");
56
- var import_chunk_PTJ2L4H6 = require("./chunk-PTJ2L4H6.js");
57
- var import_chunk_5LLB3I23 = require("./chunk-5LLB3I23.js");
58
- var import_chunk_TDOFVXHC = require("./chunk-TDOFVXHC.js");
59
- var import_chunk_OKVM3CW4 = require("./chunk-OKVM3CW4.js");
54
+ var import_chunk_IRWN7VWI = require("./chunk-IRWN7VWI.js");
55
+ var import_chunk_BSTKI4C6 = require("./chunk-BSTKI4C6.js");
56
+ var import_chunk_T552BHW2 = require("./chunk-T552BHW2.js");
57
+ var import_chunk_2GPKMSOD = require("./chunk-2GPKMSOD.js");
58
+ var import_chunk_V62WWVGA = require("./chunk-V62WWVGA.js");
59
+ var import_chunk_42R3EIRM = require("./chunk-42R3EIRM.js");
60
60
  var import_chunk_2B26F5N3 = require("./chunk-2B26F5N3.js");
61
61
  var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
62
62
  var import_chunk_LMVSIVKQ = require("./chunk-LMVSIVKQ.js");
@@ -77,7 +77,7 @@ var debug = (0, import_debug.default)("prisma:format");
77
77
  async function formatSchema({ schemas }, inputFormattingOptions) {
78
78
  if (process.env.FORCE_PANIC_PRISMA_SCHEMA) {
79
79
  handleFormatPanic(() => {
80
- import_chunk_TDOFVXHC.prismaSchemaWasm.debug_panic();
80
+ import_chunk_V62WWVGA.prismaSchemaWasm.debug_panic();
81
81
  });
82
82
  }
83
83
  const defaultFormattingOptions = {
@@ -94,10 +94,10 @@ async function formatSchema({ schemas }, inputFormattingOptions) {
94
94
  const { formattedMultipleSchemas, lintDiagnostics } = handleFormatPanic(() => {
95
95
  const formattedMultipleSchemasRaw = formatWasm(JSON.stringify(schemas), documentFormattingParams);
96
96
  const formattedMultipleSchemas2 = JSON.parse(formattedMultipleSchemasRaw);
97
- const lintDiagnostics2 = (0, import_chunk_YJT2VCZV.lintSchema)({ schemas: formattedMultipleSchemas2 });
97
+ const lintDiagnostics2 = (0, import_chunk_IRWN7VWI.lintSchema)({ schemas: formattedMultipleSchemas2 });
98
98
  return { formattedMultipleSchemas: formattedMultipleSchemas2, lintDiagnostics: lintDiagnostics2 };
99
99
  });
100
- const lintWarnings = (0, import_chunk_YJT2VCZV.getLintWarningsAsText)(lintDiagnostics);
100
+ const lintWarnings = (0, import_chunk_IRWN7VWI.getLintWarningsAsText)(lintDiagnostics);
101
101
  if (lintWarnings && import_chunk_ZJWZK45Z.logger_exports.should.warn()) {
102
102
  console.warn(lintWarnings);
103
103
  }
@@ -124,29 +124,22 @@ function handleFormatPanic(tryCb) {
124
124
  }
125
125
  }
126
126
  function formatWasm(schema, documentFormattingParams) {
127
- const formattedSchema = import_chunk_TDOFVXHC.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
127
+ const formattedSchema = import_chunk_V62WWVGA.prismaSchemaWasm.format(schema, JSON.stringify(documentFormattingParams));
128
128
  return formattedSchema;
129
129
  }
130
- async function loadSchemaContext({
131
- schemaPathFromArg,
132
- schemaPathFromConfig,
133
- printLoadMessage = true,
134
- allowNull = false,
135
- schemaPathArgumentName = "--schema",
136
- cwd = process.cwd()
137
- } = {}) {
130
+ async function loadSchemaContext({ schemaPath, printLoadMessage, allowNull, schemaPathArgumentName, cwd } = {
131
+ schemaPath: { baseDir: process.cwd() },
132
+ printLoadMessage: true,
133
+ allowNull: false,
134
+ schemaPathArgumentName: "--schema",
135
+ cwd: process.cwd()
136
+ }) {
138
137
  let schemaResult = null;
139
138
  if (allowNull) {
140
- schemaResult = await (0, import_chunk_OKVM3CW4.getSchemaWithPathOptional)(schemaPathFromArg, schemaPathFromConfig, {
141
- argumentName: schemaPathArgumentName,
142
- cwd
143
- });
139
+ schemaResult = await (0, import_chunk_42R3EIRM.getSchemaWithPathOptional)({ schemaPath, cwd, argumentName: schemaPathArgumentName });
144
140
  if (!schemaResult) return null;
145
141
  } else {
146
- schemaResult = await (0, import_chunk_OKVM3CW4.getSchemaWithPath)(schemaPathFromArg, schemaPathFromConfig, {
147
- argumentName: schemaPathArgumentName,
148
- cwd
149
- });
142
+ schemaResult = await (0, import_chunk_42R3EIRM.getSchemaWithPath)({ schemaPath, cwd, argumentName: schemaPathArgumentName });
150
143
  }
151
144
  return processSchemaResult({ schemaResult, printLoadMessage, cwd });
152
145
  }
@@ -158,9 +151,9 @@ async function processSchemaResult({
158
151
  const loadedFromPathForLogMessages = import_node_path.default.relative(cwd, schemaResult.schemaPath);
159
152
  const schemaRootDir = schemaResult.schemaRootDir || cwd;
160
153
  if (printLoadMessage) {
161
- (0, import_chunk_OKVM3CW4.printSchemaLoadedMessage)(loadedFromPathForLogMessages);
154
+ (0, import_chunk_42R3EIRM.printSchemaLoadedMessage)(loadedFromPathForLogMessages);
162
155
  }
163
- const configFromPsl = await (0, import_chunk_PTJ2L4H6.getConfig)({ datamodel: schemaResult.schemas });
156
+ const configFromPsl = await (0, import_chunk_T552BHW2.getConfig)({ datamodel: schemaResult.schemas });
164
157
  const primaryDatasource = configFromPsl.datasources.at(0);
165
158
  return {
166
159
  schemaFiles: schemaResult.schemas,
@@ -206,7 +199,7 @@ async function getGenerators(options) {
206
199
  allowNoModels = true,
207
200
  typedSql
208
201
  } = options;
209
- const schemaContext = !options.schemaContext && schemaPath ? await loadSchemaContext({ schemaPathFromArg: schemaPath }) : options.schemaContext;
202
+ const schemaContext = !options.schemaContext && schemaPath ? await loadSchemaContext({ schemaPath: { cliProvidedPath: schemaPath } }) : options.schemaContext;
210
203
  if (!schemaContext) {
211
204
  throw new Error(`no schema provided for getGenerators`);
212
205
  }
@@ -215,7 +208,7 @@ async function getGenerators(options) {
215
208
  }
216
209
  (0, import_chunk_5FJ3MENK.printConfigWarnings)(schemaContext.warnings);
217
210
  const previewFeatures = (0, import_chunk_CRVLHWC5.extractPreviewFeatures)(schemaContext.generators);
218
- const dmmf = await (0, import_chunk_5LLB3I23.getDMMF)({
211
+ const dmmf = await (0, import_chunk_2GPKMSOD.getDMMF)({
219
212
  datamodel: schemaContext.schemaFiles,
220
213
  previewFeatures
221
214
  });
@@ -266,7 +259,7 @@ You need to define \`output\` in the generator block in the schema file.`
266
259
  fromEnvVar: null
267
260
  };
268
261
  }
269
- const datamodel = (0, import_chunk_WSDTB37U.mergeSchemas)({ schemas: schemaContext.schemaFiles });
262
+ const datamodel = (0, import_chunk_BSTKI4C6.mergeSchemas)({ schemas: schemaContext.schemaFiles });
270
263
  const options2 = {
271
264
  datamodel,
272
265
  datasources: schemaContext.datasources,
@@ -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_PTJ2L4H6_exports = {};
30
- __export(chunk_PTJ2L4H6_exports, {
29
+ var chunk_T552BHW2_exports = {};
30
+ __export(chunk_T552BHW2_exports, {
31
31
  GetConfigError: () => GetConfigError,
32
32
  getConfig: () => getConfig
33
33
  });
34
- module.exports = __toCommonJS(chunk_PTJ2L4H6_exports);
34
+ module.exports = __toCommonJS(chunk_T552BHW2_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_YJ5MOWNO = require("./chunk-YJ5MOWNO.js");
39
- var import_chunk_TDOFVXHC = require("./chunk-TDOFVXHC.js");
38
+ var import_chunk_EP55SKQT = require("./chunk-EP55SKQT.js");
39
+ var import_chunk_V62WWVGA = require("./chunk-V62WWVGA.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_YJ5MOWNO.addVersionDetailsToErrorMessage)(errorMessageWithContext));
64
+ super((0, import_chunk_EP55SKQT.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_TDOFVXHC.prismaSchemaWasm.debug_panic();
76
+ import_chunk_V62WWVGA.prismaSchemaWasm.debug_panic();
77
77
  }
78
78
  const params = JSON.stringify({ prismaSchema: options.datamodel });
79
- return import_chunk_TDOFVXHC.prismaSchemaWasm.get_config(params);
79
+ return import_chunk_V62WWVGA.prismaSchemaWasm.get_config(params);
80
80
  },
81
81
  (e) => ({
82
82
  type: "wasm-error",
@@ -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_GL7OANR6_exports = {};
30
- __export(chunk_GL7OANR6_exports, {
29
+ var chunk_TCDF53CN_exports = {};
30
+ __export(chunk_TCDF53CN_exports, {
31
31
  getCLIPathHash: () => getCLIPathHash,
32
32
  getProjectHash: () => getProjectHash
33
33
  });
34
- module.exports = __toCommonJS(chunk_GL7OANR6_exports);
35
- var import_chunk_OKVM3CW4 = require("./chunk-OKVM3CW4.js");
34
+ module.exports = __toCommonJS(chunk_TCDF53CN_exports);
35
+ var import_chunk_42R3EIRM = require("./chunk-42R3EIRM.js");
36
36
  var import_crypto = __toESM(require("crypto"));
37
- async function getProjectHash(schemaPathFromArgs, schemaPathFromConfig) {
38
- const projectPath = (await (0, import_chunk_OKVM3CW4.getSchemaWithPath)(schemaPathFromArgs, schemaPathFromConfig))?.schemaPath ?? process.cwd();
37
+ async function getProjectHash(schemaPath) {
38
+ const projectPath = (await (0, import_chunk_42R3EIRM.getSchemaWithPath)({ schemaPath }))?.schemaPath ?? process.cwd();
39
39
  return import_crypto.default.createHash("sha256").update(projectPath).digest("hex").substring(0, 8);
40
40
  }
41
41
  function getCLIPathHash() {