@prisma/internals 7.3.0-integration-prisma6-fix-cloudflare-engine.3 → 7.3.0-integration-engines-7-3-0-10-fix-fix-mapped-enum-issue-0b7e6564db7dc3dac7f9312aa84e9ed81d805521.1

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 (137) hide show
  1. package/dist/{chunk-EYVG6XQS.js → chunk-2BXDHSSY.js} +56 -68
  2. package/dist/{chunk-GMW36QQF.js → chunk-2GPDFPDR.js} +7 -7
  3. package/dist/{chunk-656EKQL7.js → chunk-334ZBKRR.js} +5 -5
  4. package/dist/{chunk-OPLMJ5WZ.js → chunk-3PNJ6ZQE.js} +58 -146
  5. package/dist/{chunk-LYFOJ5NK.js → chunk-3U4QB2G3.js} +4 -6
  6. package/dist/{chunk-5TXBB44O.js → chunk-4A2DO32A.js} +11 -11
  7. package/dist/{chunk-QPQF4VGD.js → chunk-4UM3NWZ3.js} +12 -12
  8. package/dist/{chunk-TQFONRJP.js → chunk-5BRXEOYH.js} +5 -5
  9. package/dist/{chunk-RS2R7COT.js → chunk-5I4ERIIY.js} +3 -9
  10. package/dist/{chunk-DGNPNS5E.js → chunk-5X46R434.js} +13 -13
  11. package/dist/{chunk-T2KHWQCJ.js → chunk-6ZQTRCHC.js} +12 -12
  12. package/dist/{chunk-W6J5YFD2.js → chunk-7IBWXVWK.js} +5 -5
  13. package/dist/{chunk-WFNB7VRA.js → chunk-ARC7TW3L.js} +4 -14
  14. package/dist/{chunk-QLOP3Z4E.js → chunk-AYPKO22A.js} +16 -38
  15. package/dist/{chunk-BVJP43JS.js → chunk-BXIKQUP5.js} +7 -7
  16. package/dist/{chunk-AX5N26KG.js → chunk-CQVWHHIJ.js} +11 -6
  17. package/dist/{chunk-FYZCPL2Z.js → chunk-DQWKFZPY.js} +4 -7
  18. package/dist/{chunk-7QC5VORA.js → chunk-DXWYZA7B.js} +3 -4
  19. package/dist/{chunk-WDPDHAFW.js → chunk-ECN6H47Y.js} +5 -5
  20. package/dist/{chunk-F2OZV76L.js → chunk-GH2WAX5Y.js} +7 -7
  21. package/dist/{chunk-4CGPN5SR.js → chunk-GJSFP4V4.js} +3 -9
  22. package/dist/{chunk-UOUZG6WG.js → chunk-IAKPRMGI.js} +5 -5
  23. package/dist/{chunk-THADADEM.js → chunk-JB7YT5XG.js} +7 -9
  24. package/dist/{chunk-4JCVHBYR.js → chunk-KAH2NIWC.js} +6 -6
  25. package/dist/{chunk-262R2PBW.js → chunk-KOBX6GKI.js} +5 -5
  26. package/dist/{chunk-5HT4F7QV.js → chunk-MOW746GL.js} +5 -5
  27. package/dist/{chunk-BCQZ6JQE.js → chunk-NBWRGVYR.js} +4 -6
  28. package/dist/{chunk-UQUWZJVN.js → chunk-NYNXYKR4.js} +7 -7
  29. package/dist/{chunk-UQQPN22O.js → chunk-OVRS2CD6.js} +16 -38
  30. package/dist/{chunk-Q2EPFAR2.js → chunk-P3F2U57W.js} +58 -146
  31. package/dist/{chunk-JMUOROWG.js → chunk-PRGRB27V.js} +5 -5
  32. package/dist/{chunk-75BIJ5PX.js → chunk-Q5XW7CMJ.js} +9 -9
  33. package/dist/{chunk-OAT7ZJED.js → chunk-Q75TMXCR.js} +7 -20
  34. package/dist/{chunk-ROGQXXQA.js → chunk-QDIUK75K.js} +8 -10
  35. package/dist/chunk-QKQKSUQO.js +46 -0
  36. package/dist/{chunk-FCYHZHVW.js → chunk-R3J2O23S.js} +4 -4
  37. package/dist/{chunk-OSHZ4P3G.js → chunk-SP2ETLT2.js} +5 -5
  38. package/dist/{chunk-E2QTLJH5.js → chunk-SZXZZWNK.js} +13 -13
  39. package/dist/{chunk-DFIP5FHB.js → chunk-T7XMJ6KH.js} +5 -5
  40. package/dist/{chunk-KH7FI42S.js → chunk-VPLQF2ZV.js} +11 -11
  41. package/dist/{chunk-TZJROXB3.js → chunk-WSZXPLJQ.js} +4 -4
  42. package/dist/{chunk-UHI6VYFX.js → chunk-YJVCIN4F.js} +16 -14
  43. package/dist/{chunk-JOIIWB3U.js → chunk-YV4IFLW4.js} +128 -129
  44. package/dist/{chunk-HFFWZTVM.js → chunk-YXCPS3WU.js} +5 -15
  45. package/dist/cli/checkUnsupportedDataProxy.d.ts +7 -9
  46. package/dist/cli/checkUnsupportedDataProxy.js +53 -65
  47. package/dist/cli/directoryConfig.d.ts +5 -2
  48. package/dist/cli/directoryConfig.js +2 -2
  49. package/dist/cli/getGeneratorSuccessMessage.js +2 -3
  50. package/dist/cli/getSchema.d.ts +28 -20
  51. package/dist/cli/getSchema.js +7 -5
  52. package/dist/cli/hashes.d.ts +2 -1
  53. package/dist/cli/hashes.js +4 -4
  54. package/dist/cli/schemaContext.d.ts +5 -22
  55. package/dist/cli/schemaContext.js +54 -65
  56. package/dist/cli/types.d.ts +1 -1
  57. package/dist/convertCredentials.js +4 -4
  58. package/dist/engine-commands/errorHelpers.js +4 -4
  59. package/dist/engine-commands/formatSchema.js +52 -64
  60. package/dist/engine-commands/getConfig.d.ts +1 -5
  61. package/dist/engine-commands/getConfig.js +10 -13
  62. package/dist/engine-commands/getDmmf.js +10 -10
  63. package/dist/engine-commands/getEngineVersion.js +5 -9
  64. package/dist/engine-commands/getEnginesInfo.d.ts +0 -1
  65. package/dist/engine-commands/getEnginesInfo.js +6 -9
  66. package/dist/engine-commands/index.d.ts +1 -1
  67. package/dist/engine-commands/index.js +62 -76
  68. package/dist/engine-commands/lintSchema.js +9 -9
  69. package/dist/engine-commands/mergeSchemas.js +10 -10
  70. package/dist/engine-commands/queryEngineCommons.js +6 -6
  71. package/dist/engine-commands/validate.js +10 -10
  72. package/dist/get-generators/getGenerators.d.ts +0 -2
  73. package/dist/get-generators/getGenerators.js +55 -67
  74. package/dist/get-generators/utils/binaryTypeToEngineType.js +2 -2
  75. package/dist/get-generators/utils/engineTypeToBinaryType.js +2 -2
  76. package/dist/get-generators/utils/getBinaryPathsByVersion.js +4 -4
  77. package/dist/getPackedPackage.js +3 -3
  78. package/dist/index.d.ts +5 -19
  79. package/dist/index.js +99 -125
  80. package/dist/resolveBinary.js +7 -7
  81. package/dist/schemaEngineCommands.js +8 -8
  82. package/dist/sendPanic.js +2 -3
  83. package/dist/types.d.ts +15 -0
  84. package/dist/utils/canPrompt.js +3 -3
  85. package/dist/utils/fs-functional.js +10 -10
  86. package/dist/utils/fs-utils.js +8 -8
  87. package/dist/utils/getVersionFromPackageJson.js +3 -3
  88. package/dist/utils/handlePanic.js +6 -7
  89. package/dist/utils/missingDatasource.js +2 -2
  90. package/dist/utils/missingGeneratorMessage.js +4 -4
  91. package/dist/utils/toSchemasContainer.d.ts +1 -1
  92. package/dist/utils/toSchemasContainer.js +3 -3
  93. package/dist/utils/validatePrismaConfigWithDatasource.d.ts +17 -0
  94. package/dist/utils/{handleEngineLoadingErrors.js → validatePrismaConfigWithDatasource.js} +7 -6
  95. package/dist/wasm.js +5 -5
  96. package/package.json +15 -17
  97. package/dist/chunk-3FP46GUV.js +0 -471
  98. package/dist/chunk-46ABODUM.js +0 -186
  99. package/dist/chunk-6TTRTZXU.js +0 -37
  100. package/dist/chunk-D4VDA2TZ.js +0 -66
  101. package/dist/chunk-DZYINYAA.js +0 -68
  102. package/dist/chunk-ERSH2BQA.js +0 -58
  103. package/dist/chunk-HO5HRHFZ.js +0 -30
  104. package/dist/chunk-HW5RCZSE.js +0 -1
  105. package/dist/chunk-KDHESRKE.js +0 -49
  106. package/dist/chunk-L6KOIJJ5.js +0 -125
  107. package/dist/chunk-PZMRR772.js +0 -41
  108. package/dist/chunk-RFB2U4GQ.js +0 -41
  109. package/dist/chunk-T2PM5TKT.js +0 -55
  110. package/dist/cli/checkUnsupportedSchemaEngineWasm.d.ts +0 -22
  111. package/dist/cli/checkUnsupportedSchemaEngineWasm.js +0 -135
  112. package/dist/client/getClientEngineType.d.ts +0 -7
  113. package/dist/client/getClientEngineType.js +0 -26
  114. package/dist/dotenvExpand.d.ts +0 -35
  115. package/dist/dotenvExpand.js +0 -25
  116. package/dist/tracing/types.d.ts +0 -54
  117. package/dist/tracing/types.js +0 -2
  118. package/dist/utils/__tests__/maskSchema.test.js +0 -23
  119. package/dist/utils/byline.d.ts +0 -4
  120. package/dist/utils/byline.js +0 -28
  121. package/dist/utils/cloudflareD1.d.ts +0 -5
  122. package/dist/utils/cloudflareD1.js +0 -27
  123. package/dist/utils/getEnvPaths.d.ts +0 -14
  124. package/dist/utils/getEnvPaths.js +0 -29
  125. package/dist/utils/getMigrateConfigDir.d.ts +0 -2
  126. package/dist/utils/getMigrateConfigDir.js +0 -25
  127. package/dist/utils/handleEngineLoadingErrors.d.ts +0 -8
  128. package/dist/utils/load.d.ts +0 -6
  129. package/dist/utils/load.js +0 -28
  130. package/dist/utils/loadEnvFile.d.ts +0 -10
  131. package/dist/utils/loadEnvFile.js +0 -30
  132. package/dist/utils/maskSchema.d.ts +0 -4
  133. package/dist/utils/maskSchema.js +0 -27
  134. package/dist/utils/serializeQueryEngineName.d.ts +0 -4
  135. package/dist/utils/serializeQueryEngineName.js +0 -25
  136. package/dist/utils/tryLoadEnvs.d.ts +0 -25
  137. package/dist/utils/tryLoadEnvs.js +0 -30
@@ -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_E2QTLJH5_exports = {};
30
- __export(chunk_E2QTLJH5_exports, {
29
+ var chunk_SZXZZWNK_exports = {};
30
+ __export(chunk_SZXZZWNK_exports, {
31
31
  ValidateError: () => ValidateError,
32
32
  validate: () => validate
33
33
  });
34
- module.exports = __toCommonJS(chunk_E2QTLJH5_exports);
35
- var import_chunk_TZJROXB3 = require("./chunk-TZJROXB3.js");
36
- var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
34
+ module.exports = __toCommonJS(chunk_SZXZZWNK_exports);
35
+ var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
37
36
  var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
38
- var import_chunk_WDPDHAFW = require("./chunk-WDPDHAFW.js");
39
- var import_chunk_262R2PBW = require("./chunk-262R2PBW.js");
37
+ var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
38
+ var import_chunk_MOW746GL = require("./chunk-MOW746GL.js");
39
+ var import_chunk_KOBX6GKI = require("./chunk-KOBX6GKI.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,25 +59,25 @@ ${detailsHeader} ${message}`;
59
59
  }).exhaustive();
60
60
  const errorMessageWithContext = `${constructedErrorMessage}
61
61
  [Context: validate]`;
62
- super((0, import_chunk_WDPDHAFW.addVersionDetailsToErrorMessage)(errorMessageWithContext));
62
+ super((0, import_chunk_MOW746GL.addVersionDetailsToErrorMessage)(errorMessageWithContext));
63
63
  this.name = "ValidateError";
64
64
  }
65
65
  };
66
66
  function validate(options) {
67
- const debugErrorType = (0, import_chunk_TZJROXB3.createDebugErrorType)(debug, "validateWasm");
67
+ const debugErrorType = (0, import_chunk_WSZXPLJQ.createDebugErrorType)(debug, "validateWasm");
68
68
  debug(`Using validate Wasm`);
69
69
  const validateEither = (0, import_function.pipe)(
70
70
  (0, import_chunk_5DBOS77Y.tryCatch)(
71
71
  () => {
72
- if (process.env.FORCE_PANIC_QUERY_ENGINE_GET_DMMF) {
72
+ if (process.env.FORCE_PANIC_GET_DMMF) {
73
73
  debug("Triggering a Rust panic...");
74
- import_chunk_262R2PBW.prismaSchemaWasm.debug_panic();
74
+ import_chunk_KOBX6GKI.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_262R2PBW.prismaSchemaWasm.validate(params);
80
+ import_chunk_KOBX6GKI.prismaSchemaWasm.validate(params);
81
81
  },
82
82
  (e) => ({
83
83
  type: "wasm-error",
@@ -109,7 +109,7 @@ function validate(options) {
109
109
  return panic;
110
110
  }
111
111
  const errorOutput = e.error.message;
112
- return new ValidateError((0, import_chunk_TZJROXB3.parseQueryEngineError)({ errorOutput, reason: e.reason }));
112
+ return new ValidateError((0, import_chunk_WSZXPLJQ.parseQueryEngineError)({ errorOutput, reason: e.reason }));
113
113
  }).exhaustive();
114
114
  throw error;
115
115
  }
@@ -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_DFIP5FHB_exports = {};
30
- __export(chunk_DFIP5FHB_exports, {
29
+ var chunk_T7XMJ6KH_exports = {};
30
+ __export(chunk_T7XMJ6KH_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_DFIP5FHB_exports);
37
- var import_chunk_ROGQXXQA = require("./chunk-ROGQXXQA.js");
36
+ module.exports = __toCommonJS(chunk_T7XMJ6KH_exports);
37
+ var import_chunk_QDIUK75K = require("./chunk-QDIUK75K.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_ROGQXXQA.require_package)();
49
+ var { dependencies } = (0, import_chunk_QDIUK75K.require_package)();
50
50
  var prismaSchemaWasmVersion = dependencies["@prisma/prisma-schema-wasm"];
51
51
  var schemaEngineWasmVersion = dependencies["@prisma/schema-engine-wasm"];
@@ -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_KH7FI42S_exports = {};
30
- __export(chunk_KH7FI42S_exports, {
29
+ var chunk_VPLQF2ZV_exports = {};
30
+ __export(chunk_VPLQF2ZV_exports, {
31
31
  MergeSchemasError: () => MergeSchemasError,
32
32
  mergeSchemas: () => mergeSchemas
33
33
  });
34
- module.exports = __toCommonJS(chunk_KH7FI42S_exports);
35
- var import_chunk_TZJROXB3 = require("./chunk-TZJROXB3.js");
36
- var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
34
+ module.exports = __toCommonJS(chunk_VPLQF2ZV_exports);
35
+ var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
37
36
  var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
38
- var import_chunk_WDPDHAFW = require("./chunk-WDPDHAFW.js");
39
- var import_chunk_262R2PBW = require("./chunk-262R2PBW.js");
37
+ var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
38
+ var import_chunk_MOW746GL = require("./chunk-MOW746GL.js");
39
+ var import_chunk_KOBX6GKI = require("./chunk-KOBX6GKI.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,12 +59,12 @@ ${detailsHeader} ${message}`;
59
59
  }).exhaustive();
60
60
  const errorMessageWithContext = `${constructedErrorMessage}
61
61
  [Context: mergeSchemas]`;
62
- super((0, import_chunk_WDPDHAFW.addVersionDetailsToErrorMessage)(errorMessageWithContext));
62
+ super((0, import_chunk_MOW746GL.addVersionDetailsToErrorMessage)(errorMessageWithContext));
63
63
  this.name = "MergeSchemasError";
64
64
  }
65
65
  };
66
66
  function mergeSchemas(options) {
67
- const debugErrorType = (0, import_chunk_TZJROXB3.createDebugErrorType)(debug, "mergeSchemasWasm");
67
+ const debugErrorType = (0, import_chunk_WSZXPLJQ.createDebugErrorType)(debug, "mergeSchemasWasm");
68
68
  debug(`Using mergeSchemas Wasm`);
69
69
  const mergeSchemasEither = (0, import_function.pipe)(
70
70
  (0, import_chunk_5DBOS77Y.tryCatch)(
@@ -72,7 +72,7 @@ function mergeSchemas(options) {
72
72
  const params = JSON.stringify({
73
73
  schema: options.schemas
74
74
  });
75
- return import_chunk_262R2PBW.prismaSchemaWasm.merge_schemas(params);
75
+ return import_chunk_KOBX6GKI.prismaSchemaWasm.merge_schemas(params);
76
76
  },
77
77
  (e) => ({
78
78
  type: "wasm-error",
@@ -104,7 +104,7 @@ function mergeSchemas(options) {
104
104
  return panic;
105
105
  }
106
106
  const errorOutput = e.error.message;
107
- return new MergeSchemasError((0, import_chunk_TZJROXB3.parseQueryEngineError)({ errorOutput, reason: e.reason }));
107
+ return new MergeSchemasError((0, import_chunk_WSZXPLJQ.parseQueryEngineError)({ errorOutput, reason: e.reason }));
108
108
  }).exhaustive();
109
109
  throw error;
110
110
  }
@@ -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_TZJROXB3_exports = {};
30
- __export(chunk_TZJROXB3_exports, {
29
+ var chunk_WSZXPLJQ_exports = {};
30
+ __export(chunk_WSZXPLJQ_exports, {
31
31
  createDebugErrorType: () => createDebugErrorType,
32
32
  createSchemaValidationError: () => createSchemaValidationError,
33
33
  parseQueryEngineError: () => parseQueryEngineError,
34
34
  unlinkTempDatamodelPath: () => unlinkTempDatamodelPath
35
35
  });
36
- module.exports = __toCommonJS(chunk_TZJROXB3_exports);
37
- var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
36
+ module.exports = __toCommonJS(chunk_WSZXPLJQ_exports);
38
37
  var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
38
+ var import_chunk_C47SCASR = require("./chunk-C47SCASR.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_PG5FDKSF = require("./chunk-PG5FDKSF.js");
@@ -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_UHI6VYFX_exports = {};
20
- __export(chunk_UHI6VYFX_exports, {
19
+ var chunk_YJVCIN4F_exports = {};
20
+ __export(chunk_YJVCIN4F_exports, {
21
21
  SchemaEngineExitCode: () => SchemaEngineExitCode,
22
22
  canConnectToDatabase: () => canConnectToDatabase,
23
23
  createDatabase: () => createDatabase,
24
24
  dropDatabase: () => dropDatabase,
25
25
  execaCommand: () => execaCommand
26
26
  });
27
- module.exports = __toCommonJS(chunk_UHI6VYFX_exports);
27
+ module.exports = __toCommonJS(chunk_YJVCIN4F_exports);
28
28
  var import_chunk_JOIHHXR6 = require("./chunk-JOIHHXR6.js");
29
- var import_chunk_FYZCPL2Z = require("./chunk-FYZCPL2Z.js");
29
+ var import_chunk_DQWKFZPY = require("./chunk-DQWKFZPY.js");
30
30
  var import_fetch_engine = require("@prisma/fetch-engine");
31
31
  var SchemaEngineExitCode = /* @__PURE__ */ ((SchemaEngineExitCode2) => {
32
32
  SchemaEngineExitCode2[SchemaEngineExitCode2["Success"] = 0] = "Success";
@@ -50,9 +50,7 @@ function parseJsonFromStderr(stderr) {
50
50
  }
51
51
  async function canConnectToDatabase(connectionString, cwd = process.cwd(), schemaEnginePath) {
52
52
  if (!connectionString) {
53
- throw new Error(
54
- "Connection url is empty. See https://www.prisma.io/docs/reference/database-reference/connection-urls"
55
- );
53
+ throw new Error("Connection url is empty. See https://pris.ly/d/config-url");
56
54
  }
57
55
  try {
58
56
  await execaCommand({
@@ -139,15 +137,19 @@ async function execaCommand({
139
137
  schemaEnginePath,
140
138
  engineCommandName
141
139
  }) {
142
- schemaEnginePath = schemaEnginePath || await (0, import_chunk_FYZCPL2Z.resolveBinary)(import_fetch_engine.BinaryType.SchemaEngineBinary);
140
+ schemaEnginePath = schemaEnginePath || await (0, import_chunk_DQWKFZPY.resolveBinary)(import_fetch_engine.BinaryType.SchemaEngineBinary);
143
141
  try {
144
- return await (0, import_chunk_JOIHHXR6.execa)(schemaEnginePath, ["cli", "--datasource", connectionString, engineCommandName], {
145
- cwd,
146
- env: {
147
- RUST_BACKTRACE: process.env.RUST_BACKTRACE ?? "1",
148
- RUST_LOG: process.env.RUST_LOG ?? "info"
142
+ return await (0, import_chunk_JOIHHXR6.execa)(
143
+ schemaEnginePath,
144
+ ["--datasource", JSON.stringify({ url: connectionString }), "cli", engineCommandName],
145
+ {
146
+ cwd,
147
+ env: {
148
+ RUST_BACKTRACE: process.env.RUST_BACKTRACE ?? "1",
149
+ RUST_LOG: process.env.RUST_LOG ?? "info"
150
+ }
149
151
  }
150
- });
152
+ );
151
153
  } catch (_e) {
152
154
  const e = _e;
153
155
  if (e.message) {
@@ -16,15 +16,139 @@ 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_JOIIWB3U_exports = {};
20
- __export(chunk_JOIIWB3U_exports, {
19
+ var chunk_YV4IFLW4_exports = {};
20
+ __export(chunk_YV4IFLW4_exports, {
21
21
  require_globby: () => require_globby,
22
22
  require_is_glob: () => require_is_glob,
23
- require_out: () => require_out4,
24
23
  require_slash: () => require_slash
25
24
  });
26
- module.exports = __toCommonJS(chunk_JOIIWB3U_exports);
25
+ module.exports = __toCommonJS(chunk_YV4IFLW4_exports);
27
26
  var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
27
+ var require_array_union = (0, import_chunk_4VNS5WPM.__commonJS)({
28
+ "../../node_modules/.pnpm/array-union@2.1.0/node_modules/array-union/index.js"(exports, module2) {
29
+ "use strict";
30
+ module2.exports = (...arguments_) => {
31
+ return [...new Set([].concat(...arguments_))];
32
+ };
33
+ }
34
+ });
35
+ var require_merge2 = (0, import_chunk_4VNS5WPM.__commonJS)({
36
+ "../../node_modules/.pnpm/merge2@1.4.1/node_modules/merge2/index.js"(exports, module2) {
37
+ "use strict";
38
+ var Stream = (0, import_chunk_4VNS5WPM.__require)("stream");
39
+ var PassThrough = Stream.PassThrough;
40
+ var slice = Array.prototype.slice;
41
+ module2.exports = merge2;
42
+ function merge2() {
43
+ const streamsQueue = [];
44
+ const args = slice.call(arguments);
45
+ let merging = false;
46
+ let options = args[args.length - 1];
47
+ if (options && !Array.isArray(options) && options.pipe == null) {
48
+ args.pop();
49
+ } else {
50
+ options = {};
51
+ }
52
+ const doEnd = options.end !== false;
53
+ const doPipeError = options.pipeError === true;
54
+ if (options.objectMode == null) {
55
+ options.objectMode = true;
56
+ }
57
+ if (options.highWaterMark == null) {
58
+ options.highWaterMark = 64 * 1024;
59
+ }
60
+ const mergedStream = PassThrough(options);
61
+ function addStream() {
62
+ for (let i = 0, len = arguments.length; i < len; i++) {
63
+ streamsQueue.push(pauseStreams(arguments[i], options));
64
+ }
65
+ mergeStream();
66
+ return this;
67
+ }
68
+ function mergeStream() {
69
+ if (merging) {
70
+ return;
71
+ }
72
+ merging = true;
73
+ let streams = streamsQueue.shift();
74
+ if (!streams) {
75
+ process.nextTick(endStream);
76
+ return;
77
+ }
78
+ if (!Array.isArray(streams)) {
79
+ streams = [streams];
80
+ }
81
+ let pipesCount = streams.length + 1;
82
+ function next() {
83
+ if (--pipesCount > 0) {
84
+ return;
85
+ }
86
+ merging = false;
87
+ mergeStream();
88
+ }
89
+ function pipe(stream) {
90
+ function onend() {
91
+ stream.removeListener("merge2UnpipeEnd", onend);
92
+ stream.removeListener("end", onend);
93
+ if (doPipeError) {
94
+ stream.removeListener("error", onerror);
95
+ }
96
+ next();
97
+ }
98
+ function onerror(err) {
99
+ mergedStream.emit("error", err);
100
+ }
101
+ if (stream._readableState.endEmitted) {
102
+ return next();
103
+ }
104
+ stream.on("merge2UnpipeEnd", onend);
105
+ stream.on("end", onend);
106
+ if (doPipeError) {
107
+ stream.on("error", onerror);
108
+ }
109
+ stream.pipe(mergedStream, { end: false });
110
+ stream.resume();
111
+ }
112
+ for (let i = 0; i < streams.length; i++) {
113
+ pipe(streams[i]);
114
+ }
115
+ next();
116
+ }
117
+ function endStream() {
118
+ merging = false;
119
+ mergedStream.emit("queueDrain");
120
+ if (doEnd) {
121
+ mergedStream.end();
122
+ }
123
+ }
124
+ mergedStream.setMaxListeners(0);
125
+ mergedStream.add = addStream;
126
+ mergedStream.on("unpipe", function(stream) {
127
+ stream.emit("merge2UnpipeEnd");
128
+ });
129
+ if (args.length) {
130
+ addStream.apply(null, args);
131
+ }
132
+ return mergedStream;
133
+ }
134
+ function pauseStreams(streams, options) {
135
+ if (!Array.isArray(streams)) {
136
+ if (!streams._readableState && streams.pipe) {
137
+ streams = streams.pipe(PassThrough(options));
138
+ }
139
+ if (!streams._readableState || !streams.pause || !streams.pipe) {
140
+ throw new Error("Only readable stream can be merged.");
141
+ }
142
+ streams.pause();
143
+ } else {
144
+ for (let i = 0, len = streams.length; i < len; i++) {
145
+ streams[i] = pauseStreams(streams[i], options);
146
+ }
147
+ }
148
+ return streams;
149
+ }
150
+ }
151
+ });
28
152
  var require_array = (0, import_chunk_4VNS5WPM.__commonJS)({
29
153
  "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/array.js"(exports) {
30
154
  "use strict";
@@ -3190,123 +3314,6 @@ var require_pattern = (0, import_chunk_4VNS5WPM.__commonJS)({
3190
3314
  exports.isAbsolute = isAbsolute;
3191
3315
  }
3192
3316
  });
3193
- var require_merge2 = (0, import_chunk_4VNS5WPM.__commonJS)({
3194
- "../../node_modules/.pnpm/merge2@1.4.1/node_modules/merge2/index.js"(exports, module2) {
3195
- "use strict";
3196
- var Stream = (0, import_chunk_4VNS5WPM.__require)("stream");
3197
- var PassThrough = Stream.PassThrough;
3198
- var slice = Array.prototype.slice;
3199
- module2.exports = merge2;
3200
- function merge2() {
3201
- const streamsQueue = [];
3202
- const args = slice.call(arguments);
3203
- let merging = false;
3204
- let options = args[args.length - 1];
3205
- if (options && !Array.isArray(options) && options.pipe == null) {
3206
- args.pop();
3207
- } else {
3208
- options = {};
3209
- }
3210
- const doEnd = options.end !== false;
3211
- const doPipeError = options.pipeError === true;
3212
- if (options.objectMode == null) {
3213
- options.objectMode = true;
3214
- }
3215
- if (options.highWaterMark == null) {
3216
- options.highWaterMark = 64 * 1024;
3217
- }
3218
- const mergedStream = PassThrough(options);
3219
- function addStream() {
3220
- for (let i = 0, len = arguments.length; i < len; i++) {
3221
- streamsQueue.push(pauseStreams(arguments[i], options));
3222
- }
3223
- mergeStream();
3224
- return this;
3225
- }
3226
- function mergeStream() {
3227
- if (merging) {
3228
- return;
3229
- }
3230
- merging = true;
3231
- let streams = streamsQueue.shift();
3232
- if (!streams) {
3233
- process.nextTick(endStream);
3234
- return;
3235
- }
3236
- if (!Array.isArray(streams)) {
3237
- streams = [streams];
3238
- }
3239
- let pipesCount = streams.length + 1;
3240
- function next() {
3241
- if (--pipesCount > 0) {
3242
- return;
3243
- }
3244
- merging = false;
3245
- mergeStream();
3246
- }
3247
- function pipe(stream) {
3248
- function onend() {
3249
- stream.removeListener("merge2UnpipeEnd", onend);
3250
- stream.removeListener("end", onend);
3251
- if (doPipeError) {
3252
- stream.removeListener("error", onerror);
3253
- }
3254
- next();
3255
- }
3256
- function onerror(err) {
3257
- mergedStream.emit("error", err);
3258
- }
3259
- if (stream._readableState.endEmitted) {
3260
- return next();
3261
- }
3262
- stream.on("merge2UnpipeEnd", onend);
3263
- stream.on("end", onend);
3264
- if (doPipeError) {
3265
- stream.on("error", onerror);
3266
- }
3267
- stream.pipe(mergedStream, { end: false });
3268
- stream.resume();
3269
- }
3270
- for (let i = 0; i < streams.length; i++) {
3271
- pipe(streams[i]);
3272
- }
3273
- next();
3274
- }
3275
- function endStream() {
3276
- merging = false;
3277
- mergedStream.emit("queueDrain");
3278
- if (doEnd) {
3279
- mergedStream.end();
3280
- }
3281
- }
3282
- mergedStream.setMaxListeners(0);
3283
- mergedStream.add = addStream;
3284
- mergedStream.on("unpipe", function(stream) {
3285
- stream.emit("merge2UnpipeEnd");
3286
- });
3287
- if (args.length) {
3288
- addStream.apply(null, args);
3289
- }
3290
- return mergedStream;
3291
- }
3292
- function pauseStreams(streams, options) {
3293
- if (!Array.isArray(streams)) {
3294
- if (!streams._readableState && streams.pipe) {
3295
- streams = streams.pipe(PassThrough(options));
3296
- }
3297
- if (!streams._readableState || !streams.pause || !streams.pipe) {
3298
- throw new Error("Only readable stream can be merged.");
3299
- }
3300
- streams.pause();
3301
- } else {
3302
- for (let i = 0, len = streams.length; i < len; i++) {
3303
- streams[i] = pauseStreams(streams[i], options);
3304
- }
3305
- }
3306
- return streams;
3307
- }
3308
- }
3309
- });
3310
3317
  var require_stream = (0, import_chunk_4VNS5WPM.__commonJS)({
3311
3318
  "../../node_modules/.pnpm/fast-glob@3.3.3/node_modules/fast-glob/out/utils/stream.js"(exports) {
3312
3319
  "use strict";
@@ -5351,14 +5358,6 @@ var require_out4 = (0, import_chunk_4VNS5WPM.__commonJS)({
5351
5358
  module2.exports = FastGlob;
5352
5359
  }
5353
5360
  });
5354
- var require_array_union = (0, import_chunk_4VNS5WPM.__commonJS)({
5355
- "../../node_modules/.pnpm/array-union@2.1.0/node_modules/array-union/index.js"(exports, module2) {
5356
- "use strict";
5357
- module2.exports = (...arguments_) => {
5358
- return [...new Set([].concat(...arguments_))];
5359
- };
5360
- }
5361
- });
5362
5361
  var require_path_type = (0, import_chunk_4VNS5WPM.__commonJS)({
5363
5362
  "../../node_modules/.pnpm/path-type@4.0.0/node_modules/path-type/index.js"(exports) {
5364
5363
  "use strict";
@@ -26,12 +26,11 @@ var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create(__g
26
26
  mod
27
27
  ));
28
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
- var chunk_HFFWZTVM_exports = {};
30
- __export(chunk_HFFWZTVM_exports, {
29
+ var chunk_YXCPS3WU_exports = {};
30
+ __export(chunk_YXCPS3WU_exports, {
31
31
  sendPanic: () => sendPanic
32
32
  });
33
- module.exports = __toCommonJS(chunk_HFFWZTVM_exports);
34
- var import_chunk_KDHESRKE = require("./chunk-KDHESRKE.js");
33
+ module.exports = __toCommonJS(chunk_YXCPS3WU_exports);
35
34
  var import_chunk_XKZ6CBLA = require("./chunk-XKZ6CBLA.js");
36
35
  var import_chunk_5AI4FIZ3 = require("./chunk-5AI4FIZ3.js");
37
36
  var import_chunk_4VNS5WPM = require("./chunk-4VNS5WPM.js");
@@ -1785,14 +1784,7 @@ async function sendPanic({
1785
1784
  }).otherwise(() => void 0);
1786
1785
  dbVersion = await getDatabaseVersionSafe(getDatabaseVersionParams);
1787
1786
  }
1788
- const migrateRequest = error.request ? JSON.stringify(
1789
- (0, import_chunk_KDHESRKE.mapScalarValues)(error.request, (value) => {
1790
- if (typeof value === "string") {
1791
- return (0, import_chunk_KDHESRKE.maskSchema)(value);
1792
- }
1793
- return value;
1794
- })
1795
- ) : void 0;
1787
+ const migrateRequest = error.request ? JSON.stringify(error.request) : void 0;
1796
1788
  const params = {
1797
1789
  area: error.area,
1798
1790
  kind: "RUST_PANIC",
@@ -1813,9 +1805,7 @@ async function sendPanic({
1813
1805
  return id;
1814
1806
  }
1815
1807
  function getCommand() {
1816
- if (process.argv[2] === "introspect") {
1817
- return "introspect";
1818
- } else if (process.argv[2] === "db" && process.argv[3] === "pull") {
1808
+ if (process.argv[2] === "db" && process.argv[3] === "pull") {
1819
1809
  return "db pull";
1820
1810
  }
1821
1811
  return process.argv.slice(2).join(" ");
@@ -1,18 +1,16 @@
1
- import { SchemaContext } from '..';
1
+ import type { PrismaConfigWithDatasource } from '../utils/validatePrismaConfigWithDatasource';
2
2
  /**
3
3
  * Get the message to display when a command is forbidden with a data proxy flag
4
- * @param command the cli command (eg. db push)
4
+ * @param cmd the cli command (eg. db push)
5
5
  * @returns
6
6
  */
7
- export declare const forbiddenCmdWithDataProxyFlagMessage: (command: string) => string;
7
+ export declare const forbiddenCmdWithDataProxyFlagMessage: (cmd: string) => string;
8
8
  /**
9
9
  * Check that the data proxy cannot be used through the given urls and schema contexts
10
- * @param command the cli command (eg. db push)
11
- * @param urls list of urls to check
12
- * @param schemaContexts list of schema contexts to check
10
+ * @param cmd the cli command (eg. db push)
11
+ * @param validatedConfig the validated Prisma Config value
13
12
  */
14
- export declare function checkUnsupportedDataProxy({ cmd, schemaContext, urls, }: {
13
+ export declare function checkUnsupportedDataProxy({ cmd, validatedConfig, }: {
15
14
  cmd: string;
16
- schemaContext?: SchemaContext;
17
- urls?: (string | undefined)[];
15
+ validatedConfig: PrismaConfigWithDatasource;
18
16
  }): void;