@prisma/internals 7.2.0-integration-engines-7-2-0-3-aqrln-zpupkzknszlw-04d61c41ec1a025cabe14093fa3121a5f45040ab.1 → 7.3.0-integration-fix-6-19-0-cloudflare-accelerate-engine.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-VBLGRBF2.js → chunk-262R2PBW.js} +5 -5
  2. package/dist/chunk-3FP46GUV.js +471 -0
  3. package/dist/chunk-46ABODUM.js +186 -0
  4. package/dist/{chunk-GJSFP4V4.js → chunk-4CGPN5SR.js} +9 -3
  5. package/dist/{chunk-TCDF53CN.js → chunk-4JCVHBYR.js} +6 -6
  6. package/dist/{chunk-Q6D7PXUU.js → chunk-55ZV2II2.js} +38 -16
  7. package/dist/{chunk-YQYFLEMT.js → chunk-5ETP2F4G.js} +5 -5
  8. package/dist/{chunk-Z64WCHZR.js → chunk-5PEHPZHO.js} +11 -11
  9. package/dist/{chunk-PNYEHZAU.js → chunk-656EKQL7.js} +5 -5
  10. package/dist/{chunk-OWVQILDA.js → chunk-65XSDXPY.js} +13 -13
  11. package/dist/chunk-6TTRTZXU.js +37 -0
  12. package/dist/{chunk-Q5XW7CMJ.js → chunk-75BIJ5PX.js} +9 -9
  13. package/dist/{chunk-DXWYZA7B.js → chunk-7QC5VORA.js} +4 -3
  14. package/dist/{chunk-5YZKJGXV.js → chunk-7QKLIARO.js} +10 -8
  15. package/dist/{chunk-CQVWHHIJ.js → chunk-AX5N26KG.js} +6 -11
  16. package/dist/{chunk-NBWRGVYR.js → chunk-BCQZ6JQE.js} +6 -4
  17. package/dist/{chunk-BXIKQUP5.js → chunk-BVJP43JS.js} +7 -7
  18. package/dist/chunk-D4VDA2TZ.js +66 -0
  19. package/dist/{chunk-EQ6XBXVV.js → chunk-D6JNJJI7.js} +146 -58
  20. package/dist/chunk-DZYINYAA.js +68 -0
  21. package/dist/{chunk-4QR3X56D.js → chunk-E2QTLJH5.js} +13 -13
  22. package/dist/chunk-ERSH2BQA.js +58 -0
  23. package/dist/{chunk-42R3EIRM.js → chunk-EYVG6XQS.js} +67 -55
  24. package/dist/{chunk-GH2WAX5Y.js → chunk-F2OZV76L.js} +7 -7
  25. package/dist/{chunk-R3J2O23S.js → chunk-FCYHZHVW.js} +4 -4
  26. package/dist/{chunk-DQWKFZPY.js → chunk-FYZCPL2Z.js} +7 -4
  27. package/dist/{chunk-2GPDFPDR.js → chunk-GMW36QQF.js} +7 -7
  28. package/dist/{chunk-US23KCBP.js → chunk-H43XC5ET.js} +5 -5
  29. package/dist/{chunk-YXCPS3WU.js → chunk-HFFWZTVM.js} +15 -5
  30. package/dist/chunk-HO5HRHFZ.js +30 -0
  31. package/dist/chunk-HW5RCZSE.js +1 -0
  32. package/dist/{chunk-YV4IFLW4.js → chunk-JOIIWB3U.js} +129 -128
  33. package/dist/chunk-KDHESRKE.js +49 -0
  34. package/dist/{chunk-B4NUBXXO.js → chunk-KH7FI42S.js} +11 -11
  35. package/dist/chunk-L6KOIJJ5.js +125 -0
  36. package/dist/{chunk-3U4QB2G3.js → chunk-LYFOJ5NK.js} +6 -4
  37. package/dist/{chunk-Q75TMXCR.js → chunk-OAT7ZJED.js} +20 -7
  38. package/dist/{chunk-WK3RWN6T.js → chunk-OPLMJ5WZ.js} +146 -58
  39. package/dist/{chunk-SP2ETLT2.js → chunk-OSHZ4P3G.js} +5 -5
  40. package/dist/{chunk-QFQIWWVN.js → chunk-OWUYXGDF.js} +12 -12
  41. package/dist/chunk-PZMRR772.js +41 -0
  42. package/dist/{chunk-RR7B6GH2.js → chunk-QDT7TGYZ.js} +5 -5
  43. package/dist/{chunk-QNSOKYEF.js → chunk-QLOP3Z4E.js} +38 -16
  44. package/dist/{chunk-Y5TWK45J.js → chunk-QPQF4VGD.js} +12 -12
  45. package/dist/chunk-RFB2U4GQ.js +41 -0
  46. package/dist/{chunk-5I4ERIIY.js → chunk-RS2R7COT.js} +9 -3
  47. package/dist/chunk-T2PM5TKT.js +55 -0
  48. package/dist/{chunk-X2DGDDLX.js → chunk-THADADEM.js} +9 -7
  49. package/dist/{chunk-5BRXEOYH.js → chunk-TQFONRJP.js} +5 -5
  50. package/dist/{chunk-WSZXPLJQ.js → chunk-TZJROXB3.js} +4 -4
  51. package/dist/{chunk-YJVCIN4F.js → chunk-UHI6VYFX.js} +14 -16
  52. package/dist/{chunk-NYNXYKR4.js → chunk-UQUWZJVN.js} +7 -7
  53. package/dist/{chunk-N3FJZLFP.js → chunk-W6J5YFD2.js} +5 -5
  54. package/dist/{chunk-AJALNZEH.js → chunk-WDPDHAFW.js} +5 -5
  55. package/dist/{chunk-ARC7TW3L.js → chunk-WFNB7VRA.js} +14 -4
  56. package/dist/{chunk-5IS5OH7Z.js → chunk-WKP2TVYB.js} +5 -5
  57. package/dist/cli/checkUnsupportedDataProxy.d.ts +9 -7
  58. package/dist/cli/checkUnsupportedDataProxy.js +65 -53
  59. package/dist/cli/checkUnsupportedSchemaEngineWasm.d.ts +22 -0
  60. package/dist/cli/checkUnsupportedSchemaEngineWasm.js +135 -0
  61. package/dist/cli/directoryConfig.d.ts +2 -5
  62. package/dist/cli/directoryConfig.js +2 -2
  63. package/dist/cli/getGeneratorSuccessMessage.js +3 -2
  64. package/dist/cli/getSchema.d.ts +20 -28
  65. package/dist/cli/getSchema.js +5 -7
  66. package/dist/cli/hashes.d.ts +1 -2
  67. package/dist/cli/hashes.js +4 -4
  68. package/dist/cli/schemaContext.d.ts +22 -5
  69. package/dist/cli/schemaContext.js +65 -54
  70. package/dist/cli/types.d.ts +1 -1
  71. package/dist/client/getClientEngineType.d.ts +7 -0
  72. package/dist/client/getClientEngineType.js +26 -0
  73. package/dist/convertCredentials.js +4 -4
  74. package/dist/dotenvExpand.d.ts +35 -0
  75. package/dist/dotenvExpand.js +25 -0
  76. package/dist/engine-commands/errorHelpers.js +4 -4
  77. package/dist/engine-commands/formatSchema.js +64 -52
  78. package/dist/engine-commands/getConfig.d.ts +5 -1
  79. package/dist/engine-commands/getConfig.js +13 -10
  80. package/dist/engine-commands/getDmmf.js +10 -10
  81. package/dist/engine-commands/getEngineVersion.js +9 -5
  82. package/dist/engine-commands/getEnginesInfo.d.ts +1 -0
  83. package/dist/engine-commands/getEnginesInfo.js +9 -6
  84. package/dist/engine-commands/index.d.ts +1 -1
  85. package/dist/engine-commands/index.js +76 -62
  86. package/dist/engine-commands/lintSchema.js +9 -9
  87. package/dist/engine-commands/mergeSchemas.js +10 -10
  88. package/dist/engine-commands/queryEngineCommons.js +6 -6
  89. package/dist/engine-commands/validate.js +10 -10
  90. package/dist/get-generators/getGenerators.d.ts +2 -0
  91. package/dist/get-generators/getGenerators.js +67 -55
  92. package/dist/get-generators/utils/binaryTypeToEngineType.js +2 -2
  93. package/dist/get-generators/utils/engineTypeToBinaryType.js +2 -2
  94. package/dist/get-generators/utils/getBinaryPathsByVersion.js +4 -4
  95. package/dist/getPackedPackage.js +3 -3
  96. package/dist/index.d.ts +19 -5
  97. package/dist/index.js +125 -99
  98. package/dist/resolveBinary.js +7 -7
  99. package/dist/schemaEngineCommands.js +8 -8
  100. package/dist/sendPanic.js +3 -2
  101. package/dist/tracing/types.d.ts +54 -0
  102. package/dist/tracing/types.js +2 -0
  103. package/dist/types.d.ts +0 -15
  104. package/dist/utils/__tests__/maskSchema.test.js +23 -0
  105. package/dist/utils/byline.d.ts +4 -0
  106. package/dist/utils/byline.js +28 -0
  107. package/dist/utils/canPrompt.js +3 -3
  108. package/dist/utils/cloudflareD1.d.ts +5 -0
  109. package/dist/utils/cloudflareD1.js +27 -0
  110. package/dist/utils/fs-functional.js +10 -10
  111. package/dist/utils/fs-utils.js +8 -8
  112. package/dist/utils/getEnvPaths.d.ts +14 -0
  113. package/dist/utils/{validatePrismaConfigWithDatasource.js → getEnvPaths.js} +8 -7
  114. package/dist/utils/getMigrateConfigDir.d.ts +2 -0
  115. package/dist/utils/getMigrateConfigDir.js +25 -0
  116. package/dist/utils/getVersionFromPackageJson.js +3 -3
  117. package/dist/utils/handleEngineLoadingErrors.d.ts +8 -0
  118. package/dist/utils/handleEngineLoadingErrors.js +27 -0
  119. package/dist/utils/handlePanic.js +7 -6
  120. package/dist/utils/load.d.ts +6 -0
  121. package/dist/utils/load.js +28 -0
  122. package/dist/utils/loadEnvFile.d.ts +10 -0
  123. package/dist/utils/loadEnvFile.js +30 -0
  124. package/dist/utils/maskSchema.d.ts +4 -0
  125. package/dist/utils/maskSchema.js +27 -0
  126. package/dist/utils/missingDatasource.js +2 -2
  127. package/dist/utils/missingGeneratorMessage.js +4 -4
  128. package/dist/utils/serializeQueryEngineName.d.ts +4 -0
  129. package/dist/utils/serializeQueryEngineName.js +25 -0
  130. package/dist/utils/toSchemasContainer.d.ts +1 -1
  131. package/dist/utils/toSchemasContainer.js +3 -3
  132. package/dist/utils/tryLoadEnvs.d.ts +25 -0
  133. package/dist/utils/tryLoadEnvs.js +30 -0
  134. package/dist/wasm.js +5 -5
  135. package/package.json +17 -15
  136. package/dist/chunk-5SAWCTGN.js +0 -46
  137. package/dist/utils/validatePrismaConfigWithDatasource.d.ts +0 -15
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var chunk_KDHESRKE_exports = {};
20
+ __export(chunk_KDHESRKE_exports, {
21
+ mapScalarValues: () => mapScalarValues,
22
+ maskSchema: () => maskSchema,
23
+ maskSchemas: () => maskSchemas
24
+ });
25
+ module.exports = __toCommonJS(chunk_KDHESRKE_exports);
26
+ function maskSchemas(schemas) {
27
+ return schemas.map(([path, content]) => [path, maskSchema(content)]);
28
+ }
29
+ function maskSchema(schema) {
30
+ const regex = /url\s*=\s*.+/;
31
+ return schema.split("\n").map((line) => {
32
+ const match = regex.exec(line);
33
+ if (match) {
34
+ return `${line.slice(0, match.index)}url = "***"`;
35
+ }
36
+ return line;
37
+ }).join("\n");
38
+ }
39
+ function mapScalarValues(obj, mapper) {
40
+ const result = {};
41
+ for (const key in obj) {
42
+ if (typeof obj[key] === "object") {
43
+ result[key] = mapScalarValues(obj[key], mapper);
44
+ } else {
45
+ result[key] = mapper(obj[key]);
46
+ }
47
+ }
48
+ return result;
49
+ }
@@ -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_B4NUBXXO_exports = {};
30
- __export(chunk_B4NUBXXO_exports, {
29
+ var chunk_KH7FI42S_exports = {};
30
+ __export(chunk_KH7FI42S_exports, {
31
31
  MergeSchemasError: () => MergeSchemasError,
32
32
  mergeSchemas: () => mergeSchemas
33
33
  });
34
- module.exports = __toCommonJS(chunk_B4NUBXXO_exports);
35
- var import_chunk_WSZXPLJQ = require("./chunk-WSZXPLJQ.js");
36
- var import_chunk_R6QH57HZ = require("./chunk-R6QH57HZ.js");
34
+ module.exports = __toCommonJS(chunk_KH7FI42S_exports);
35
+ var import_chunk_TZJROXB3 = require("./chunk-TZJROXB3.js");
37
36
  var import_chunk_C47SCASR = require("./chunk-C47SCASR.js");
38
- var import_chunk_RR7B6GH2 = require("./chunk-RR7B6GH2.js");
39
- var import_chunk_5IS5OH7Z = require("./chunk-5IS5OH7Z.js");
37
+ 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");
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_RR7B6GH2.addVersionDetailsToErrorMessage)(errorMessageWithContext));
62
+ super((0, import_chunk_WDPDHAFW.addVersionDetailsToErrorMessage)(errorMessageWithContext));
63
63
  this.name = "MergeSchemasError";
64
64
  }
65
65
  };
66
66
  function mergeSchemas(options) {
67
- const debugErrorType = (0, import_chunk_WSZXPLJQ.createDebugErrorType)(debug, "mergeSchemasWasm");
67
+ const debugErrorType = (0, import_chunk_TZJROXB3.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_5IS5OH7Z.prismaSchemaWasm.merge_schemas(params);
75
+ return import_chunk_262R2PBW.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_WSZXPLJQ.parseQueryEngineError)({ errorOutput, reason: e.reason }));
107
+ return new MergeSchemasError((0, import_chunk_TZJROXB3.parseQueryEngineError)({ errorOutput, reason: e.reason }));
108
108
  }).exhaustive();
109
109
  throw error;
110
110
  }
@@ -0,0 +1,125 @@
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_L6KOIJJ5_exports = {};
30
+ __export(chunk_L6KOIJJ5_exports, {
31
+ LineStream: () => LineStream,
32
+ byline: () => byline,
33
+ createLineStream: () => createLineStream,
34
+ createStream: () => createStream
35
+ });
36
+ module.exports = __toCommonJS(chunk_L6KOIJJ5_exports);
37
+ var import_stream = __toESM(require("stream"));
38
+ var import_util = __toESM(require("util"));
39
+ function byline(readStream, options) {
40
+ return createStream(readStream, options);
41
+ }
42
+ function createStream(readStream, options) {
43
+ if (readStream) {
44
+ return createLineStream(readStream, options);
45
+ } else {
46
+ return new LineStream(options);
47
+ }
48
+ }
49
+ function createLineStream(readStream, options) {
50
+ if (!readStream) {
51
+ throw new Error("expected readStream");
52
+ }
53
+ if (!readStream.readable) {
54
+ throw new Error("readStream must be readable");
55
+ }
56
+ const ls = new LineStream(options);
57
+ readStream.pipe(ls);
58
+ return ls;
59
+ }
60
+ function LineStream(options) {
61
+ import_stream.default.Transform.call(this, options);
62
+ options = options || {};
63
+ this._readableState.objectMode = true;
64
+ this._lineBuffer = [];
65
+ this._keepEmptyLines = options.keepEmptyLines || false;
66
+ this._lastChunkEndedWithCR = false;
67
+ this.on("pipe", function(src) {
68
+ if (!this.encoding) {
69
+ if (src instanceof import_stream.default.Readable) {
70
+ this.encoding = src._readableState.encoding;
71
+ }
72
+ }
73
+ });
74
+ }
75
+ import_util.default.inherits(LineStream, import_stream.default.Transform);
76
+ LineStream.prototype._transform = function(chunk, encoding, done) {
77
+ encoding = encoding || "utf8";
78
+ if (Buffer.isBuffer(chunk)) {
79
+ if (encoding == "buffer") {
80
+ chunk = chunk.toString();
81
+ encoding = "utf8";
82
+ } else {
83
+ chunk = chunk.toString(encoding);
84
+ }
85
+ }
86
+ this._chunkEncoding = encoding;
87
+ const lines = chunk.split(/\r\n|\r|\n/g);
88
+ if (this._lastChunkEndedWithCR && chunk[0] == "\n") {
89
+ lines.shift();
90
+ }
91
+ if (this._lineBuffer.length > 0) {
92
+ this._lineBuffer[this._lineBuffer.length - 1] += lines[0];
93
+ lines.shift();
94
+ }
95
+ this._lastChunkEndedWithCR = chunk[chunk.length - 1] == "\r";
96
+ this._lineBuffer = this._lineBuffer.concat(lines);
97
+ this._pushBuffer(encoding, 1, done);
98
+ };
99
+ LineStream.prototype._pushBuffer = function(encoding, keep, done) {
100
+ while (this._lineBuffer.length > keep) {
101
+ const line = this._lineBuffer.shift();
102
+ if (this._keepEmptyLines || line.length > 0) {
103
+ if (!this.push(this._reencode(line, encoding))) {
104
+ const self = this;
105
+ setImmediate(function() {
106
+ self._pushBuffer(encoding, keep, done);
107
+ });
108
+ return;
109
+ }
110
+ }
111
+ }
112
+ done();
113
+ };
114
+ LineStream.prototype._flush = function(done) {
115
+ this._pushBuffer(this._chunkEncoding, 0, done);
116
+ };
117
+ LineStream.prototype._reencode = function(line, chunkEncoding) {
118
+ if (this.encoding && this.encoding != chunkEncoding) {
119
+ return Buffer.from(line, chunkEncoding).toString(this.encoding);
120
+ } else if (this.encoding) {
121
+ return line;
122
+ } else {
123
+ return Buffer.from(line, chunkEncoding);
124
+ }
125
+ };
@@ -26,13 +26,13 @@ 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_3U4QB2G3_exports = {};
30
- __export(chunk_3U4QB2G3_exports, {
29
+ var chunk_LYFOJ5NK_exports = {};
30
+ __export(chunk_LYFOJ5NK_exports, {
31
31
  credentialsToUri: () => credentialsToUri,
32
32
  protocolToConnectorType: () => protocolToConnectorType,
33
33
  uriToCredentials: () => uriToCredentials
34
34
  });
35
- module.exports = __toCommonJS(chunk_3U4QB2G3_exports);
35
+ module.exports = __toCommonJS(chunk_LYFOJ5NK_exports);
36
36
  var import_chunk_LPNBWFQ3 = require("./chunk-LPNBWFQ3.js");
37
37
  var import_path = __toESM(require("path"));
38
38
  var NodeURL = __toESM(require("url"));
@@ -91,7 +91,9 @@ function uriToCredentials(connectionString) {
91
91
  try {
92
92
  uri = new NodeURL.URL(connectionString);
93
93
  } catch (e) {
94
- throw new Error("Invalid data source URL, see https://pris.ly/d/config-url");
94
+ throw new Error(
95
+ "Invalid data source URL, see https://www.prisma.io/docs/reference/database-reference/connection-urls"
96
+ );
95
97
  }
96
98
  const type = protocolToConnectorType(uri.protocol);
97
99
  const exists = (str) => str && str.length > 0;
@@ -16,20 +16,33 @@ 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_Q75TMXCR_exports = {};
20
- __export(chunk_Q75TMXCR_exports, {
19
+ var chunk_OAT7ZJED_exports = {};
20
+ __export(chunk_OAT7ZJED_exports, {
21
21
  getEngineVersion: () => getEngineVersion,
22
22
  safeGetEngineVersion: () => safeGetEngineVersion
23
23
  });
24
- module.exports = __toCommonJS(chunk_Q75TMXCR_exports);
24
+ module.exports = __toCommonJS(chunk_OAT7ZJED_exports);
25
+ var import_chunk_6TTRTZXU = require("./chunk-6TTRTZXU.js");
25
26
  var import_chunk_JOIHHXR6 = require("./chunk-JOIHHXR6.js");
26
- var import_chunk_DQWKFZPY = require("./chunk-DQWKFZPY.js");
27
+ var import_chunk_FYZCPL2Z = require("./chunk-FYZCPL2Z.js");
27
28
  var import_chunk_5DBOS77Y = require("./chunk-5DBOS77Y.js");
29
+ var import_engines = require("@prisma/engines");
28
30
  var import_fetch_engine = require("@prisma/fetch-engine");
31
+ var import_get_platform = require("@prisma/get-platform");
29
32
  async function getEngineVersion(enginePath, binaryName) {
30
- enginePath = await (0, import_chunk_DQWKFZPY.resolveBinary)(binaryName ?? import_fetch_engine.BinaryType.SchemaEngineBinary, enginePath);
31
- const { stdout } = await (0, import_chunk_JOIHHXR6.execa)(enginePath, ["--version"]);
32
- return stdout;
33
+ if (!binaryName) {
34
+ binaryName = (0, import_engines.getCliQueryEngineBinaryType)();
35
+ }
36
+ enginePath = await (0, import_chunk_FYZCPL2Z.resolveBinary)(binaryName, enginePath);
37
+ const platformInfo = await (0, import_get_platform.getPlatformInfo)();
38
+ if (binaryName === import_fetch_engine.BinaryType.QueryEngineLibrary) {
39
+ (0, import_get_platform.assertNodeAPISupported)();
40
+ const QE = (0, import_chunk_6TTRTZXU.loadLibrary)(enginePath, platformInfo);
41
+ return `${import_fetch_engine.BinaryType.QueryEngineLibrary} ${QE.version().commit}`;
42
+ } else {
43
+ const { stdout } = await (0, import_chunk_JOIHHXR6.execa)(enginePath, ["--version"]);
44
+ return stdout;
45
+ }
33
46
  }
34
47
  function safeGetEngineVersion(enginePath, binaryName) {
35
48
  return (0, import_chunk_5DBOS77Y.tryCatch2)(