@prisma/migrate 6.5.0-dev.4 → 6.5.0-dev.40

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.
@@ -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_73OPZA7N_exports = {};
20
- __export(chunk_73OPZA7N_exports, {
19
+ var chunk_EGPJABTW_exports = {};
20
+ __export(chunk_EGPJABTW_exports, {
21
21
  require_lib: () => require_lib2
22
22
  });
23
- module.exports = __toCommonJS(chunk_73OPZA7N_exports);
23
+ module.exports = __toCommonJS(chunk_EGPJABTW_exports);
24
24
  var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
25
25
  var require_postgres_array = (0, import_chunk_WWAWV7DQ.__commonJS)({
26
26
  "../../node_modules/.pnpm/postgres-array@2.0.0/node_modules/postgres-array/index.js"(exports) {
@@ -938,7 +938,7 @@ var require_pg_types = (0, import_chunk_WWAWV7DQ.__commonJS)({
938
938
  }
939
939
  });
940
940
  var require_defaults = (0, import_chunk_WWAWV7DQ.__commonJS)({
941
- "../../node_modules/.pnpm/pg@8.11.5/node_modules/pg/lib/defaults.js"(exports, module2) {
941
+ "../../node_modules/.pnpm/pg@8.13.3/node_modules/pg/lib/defaults.js"(exports, module2) {
942
942
  "use strict";
943
943
  module2.exports = {
944
944
  // database host. defaults to localhost
@@ -998,7 +998,7 @@ var require_defaults = (0, import_chunk_WWAWV7DQ.__commonJS)({
998
998
  }
999
999
  });
1000
1000
  var require_utils = (0, import_chunk_WWAWV7DQ.__commonJS)({
1001
- "../../node_modules/.pnpm/pg@8.11.5/node_modules/pg/lib/utils.js"(exports, module2) {
1001
+ "../../node_modules/.pnpm/pg@8.13.3/node_modules/pg/lib/utils.js"(exports, module2) {
1002
1002
  "use strict";
1003
1003
  var defaults = require_defaults();
1004
1004
  function escapeElement(elementRepresentation) {
@@ -1037,27 +1037,27 @@ var require_utils = (0, import_chunk_WWAWV7DQ.__commonJS)({
1037
1037
  if (val == null) {
1038
1038
  return null;
1039
1039
  }
1040
- if (val instanceof Buffer) {
1041
- return val;
1042
- }
1043
- if (ArrayBuffer.isView(val)) {
1044
- var buf = Buffer.from(val.buffer, val.byteOffset, val.byteLength);
1045
- if (buf.length === val.byteLength) {
1046
- return buf;
1040
+ if (typeof val === "object") {
1041
+ if (val instanceof Buffer) {
1042
+ return val;
1047
1043
  }
1048
- return buf.slice(val.byteOffset, val.byteOffset + val.byteLength);
1049
- }
1050
- if (val instanceof Date) {
1051
- if (defaults.parseInputDatesAsUTC) {
1052
- return dateToStringUTC(val);
1053
- } else {
1054
- return dateToString(val);
1044
+ if (ArrayBuffer.isView(val)) {
1045
+ var buf = Buffer.from(val.buffer, val.byteOffset, val.byteLength);
1046
+ if (buf.length === val.byteLength) {
1047
+ return buf;
1048
+ }
1049
+ return buf.slice(val.byteOffset, val.byteOffset + val.byteLength);
1050
+ }
1051
+ if (val instanceof Date) {
1052
+ if (defaults.parseInputDatesAsUTC) {
1053
+ return dateToStringUTC(val);
1054
+ } else {
1055
+ return dateToString(val);
1056
+ }
1057
+ }
1058
+ if (Array.isArray(val)) {
1059
+ return arrayString(val);
1055
1060
  }
1056
- }
1057
- if (Array.isArray(val)) {
1058
- return arrayString(val);
1059
- }
1060
- if (typeof val === "object") {
1061
1061
  return prepareObject(val, seen);
1062
1062
  }
1063
1063
  return val.toString();
@@ -1073,26 +1073,19 @@ var require_utils = (0, import_chunk_WWAWV7DQ.__commonJS)({
1073
1073
  }
1074
1074
  return JSON.stringify(val);
1075
1075
  }
1076
- function pad(number, digits) {
1077
- number = "" + number;
1078
- while (number.length < digits) {
1079
- number = "0" + number;
1080
- }
1081
- return number;
1082
- }
1083
1076
  function dateToString(date) {
1084
1077
  var offset = -date.getTimezoneOffset();
1085
1078
  var year = date.getFullYear();
1086
1079
  var isBCYear = year < 1;
1087
1080
  if (isBCYear) year = Math.abs(year) + 1;
1088
- var ret = pad(year, 4) + "-" + pad(date.getMonth() + 1, 2) + "-" + pad(date.getDate(), 2) + "T" + pad(date.getHours(), 2) + ":" + pad(date.getMinutes(), 2) + ":" + pad(date.getSeconds(), 2) + "." + pad(date.getMilliseconds(), 3);
1081
+ var ret = String(year).padStart(4, "0") + "-" + String(date.getMonth() + 1).padStart(2, "0") + "-" + String(date.getDate()).padStart(2, "0") + "T" + String(date.getHours()).padStart(2, "0") + ":" + String(date.getMinutes()).padStart(2, "0") + ":" + String(date.getSeconds()).padStart(2, "0") + "." + String(date.getMilliseconds()).padStart(3, "0");
1089
1082
  if (offset < 0) {
1090
1083
  ret += "-";
1091
1084
  offset *= -1;
1092
1085
  } else {
1093
1086
  ret += "+";
1094
1087
  }
1095
- ret += pad(Math.floor(offset / 60), 2) + ":" + pad(offset % 60, 2);
1088
+ ret += String(Math.floor(offset / 60)).padStart(2, "0") + ":" + String(offset % 60).padStart(2, "0");
1096
1089
  if (isBCYear) ret += " BC";
1097
1090
  return ret;
1098
1091
  }
@@ -1100,7 +1093,7 @@ var require_utils = (0, import_chunk_WWAWV7DQ.__commonJS)({
1100
1093
  var year = date.getUTCFullYear();
1101
1094
  var isBCYear = year < 1;
1102
1095
  if (isBCYear) year = Math.abs(year) + 1;
1103
- var ret = pad(year, 4) + "-" + pad(date.getUTCMonth() + 1, 2) + "-" + pad(date.getUTCDate(), 2) + "T" + pad(date.getUTCHours(), 2) + ":" + pad(date.getUTCMinutes(), 2) + ":" + pad(date.getUTCSeconds(), 2) + "." + pad(date.getUTCMilliseconds(), 3);
1096
+ var ret = String(year).padStart(4, "0") + "-" + String(date.getUTCMonth() + 1).padStart(2, "0") + "-" + String(date.getUTCDate()).padStart(2, "0") + "T" + String(date.getUTCHours()).padStart(2, "0") + ":" + String(date.getUTCMinutes()).padStart(2, "0") + ":" + String(date.getUTCSeconds()).padStart(2, "0") + "." + String(date.getUTCMilliseconds()).padStart(3, "0");
1104
1097
  ret += "+00:00";
1105
1098
  if (isBCYear) ret += " BC";
1106
1099
  return ret;
@@ -1153,7 +1146,7 @@ var require_utils = (0, import_chunk_WWAWV7DQ.__commonJS)({
1153
1146
  }
1154
1147
  });
1155
1148
  var require_utils_legacy = (0, import_chunk_WWAWV7DQ.__commonJS)({
1156
- "../../node_modules/.pnpm/pg@8.11.5/node_modules/pg/lib/crypto/utils-legacy.js"(exports, module2) {
1149
+ "../../node_modules/.pnpm/pg@8.13.3/node_modules/pg/lib/crypto/utils-legacy.js"(exports, module2) {
1157
1150
  "use strict";
1158
1151
  var nodeCrypto = (0, import_chunk_WWAWV7DQ.__require)("crypto");
1159
1152
  function md5(string) {
@@ -1184,7 +1177,7 @@ var require_utils_legacy = (0, import_chunk_WWAWV7DQ.__commonJS)({
1184
1177
  }
1185
1178
  });
1186
1179
  var require_utils_webcrypto = (0, import_chunk_WWAWV7DQ.__commonJS)({
1187
- "../../node_modules/.pnpm/pg@8.11.5/node_modules/pg/lib/crypto/utils-webcrypto.js"(exports, module2) {
1180
+ "../../node_modules/.pnpm/pg@8.13.3/node_modules/pg/lib/crypto/utils-webcrypto.js"(exports, module2) {
1188
1181
  "use strict";
1189
1182
  var nodeCrypto = (0, import_chunk_WWAWV7DQ.__require)("crypto");
1190
1183
  module2.exports = {
@@ -1230,7 +1223,7 @@ var require_utils_webcrypto = (0, import_chunk_WWAWV7DQ.__commonJS)({
1230
1223
  }
1231
1224
  });
1232
1225
  var require_utils2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
1233
- "../../node_modules/.pnpm/pg@8.11.5/node_modules/pg/lib/crypto/utils.js"(exports, module2) {
1226
+ "../../node_modules/.pnpm/pg@8.13.3/node_modules/pg/lib/crypto/utils.js"(exports, module2) {
1234
1227
  "use strict";
1235
1228
  var useLegacyCrypto = parseInt(process.versions && process.versions.node && process.versions.node.split(".")[0]) < 15;
1236
1229
  if (useLegacyCrypto) {
@@ -1241,7 +1234,7 @@ var require_utils2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
1241
1234
  }
1242
1235
  });
1243
1236
  var require_sasl = (0, import_chunk_WWAWV7DQ.__commonJS)({
1244
- "../../node_modules/.pnpm/pg@8.11.5/node_modules/pg/lib/crypto/sasl.js"(exports, module2) {
1237
+ "../../node_modules/.pnpm/pg@8.13.3/node_modules/pg/lib/crypto/sasl.js"(exports, module2) {
1245
1238
  "use strict";
1246
1239
  var crypto = require_utils2();
1247
1240
  function startSession(mechanisms) {
@@ -1389,7 +1382,7 @@ var require_sasl = (0, import_chunk_WWAWV7DQ.__commonJS)({
1389
1382
  }
1390
1383
  });
1391
1384
  var require_type_overrides = (0, import_chunk_WWAWV7DQ.__commonJS)({
1392
- "../../node_modules/.pnpm/pg@8.11.5/node_modules/pg/lib/type-overrides.js"(exports, module2) {
1385
+ "../../node_modules/.pnpm/pg@8.13.3/node_modules/pg/lib/type-overrides.js"(exports, module2) {
1393
1386
  "use strict";
1394
1387
  var types = require_pg_types();
1395
1388
  function TypeOverrides(userTypes) {
@@ -1422,7 +1415,7 @@ var require_type_overrides = (0, import_chunk_WWAWV7DQ.__commonJS)({
1422
1415
  }
1423
1416
  });
1424
1417
  var require_pg_connection_string = (0, import_chunk_WWAWV7DQ.__commonJS)({
1425
- "../../node_modules/.pnpm/pg-connection-string@2.6.4/node_modules/pg-connection-string/index.js"(exports, module2) {
1418
+ "../../node_modules/.pnpm/pg-connection-string@2.7.0/node_modules/pg-connection-string/index.js"(exports, module2) {
1426
1419
  "use strict";
1427
1420
  function parse(str) {
1428
1421
  if (str.charAt(0) === "/") {
@@ -1505,7 +1498,7 @@ var require_pg_connection_string = (0, import_chunk_WWAWV7DQ.__commonJS)({
1505
1498
  }
1506
1499
  });
1507
1500
  var require_connection_parameters = (0, import_chunk_WWAWV7DQ.__commonJS)({
1508
- "../../node_modules/.pnpm/pg@8.11.5/node_modules/pg/lib/connection-parameters.js"(exports, module2) {
1501
+ "../../node_modules/.pnpm/pg@8.13.3/node_modules/pg/lib/connection-parameters.js"(exports, module2) {
1509
1502
  "use strict";
1510
1503
  var dns = (0, import_chunk_WWAWV7DQ.__require)("dns");
1511
1504
  var defaults = require_defaults();
@@ -1641,7 +1634,7 @@ var require_connection_parameters = (0, import_chunk_WWAWV7DQ.__commonJS)({
1641
1634
  }
1642
1635
  });
1643
1636
  var require_result = (0, import_chunk_WWAWV7DQ.__commonJS)({
1644
- "../../node_modules/.pnpm/pg@8.11.5/node_modules/pg/lib/result.js"(exports, module2) {
1637
+ "../../node_modules/.pnpm/pg@8.13.3/node_modules/pg/lib/result.js"(exports, module2) {
1645
1638
  "use strict";
1646
1639
  var types = require_pg_types();
1647
1640
  var matchRegexp = /^([A-Za-z]+)(?: (\d+))?(?: (\d+))?/;
@@ -1729,7 +1722,7 @@ var require_result = (0, import_chunk_WWAWV7DQ.__commonJS)({
1729
1722
  }
1730
1723
  });
1731
1724
  var require_query = (0, import_chunk_WWAWV7DQ.__commonJS)({
1732
- "../../node_modules/.pnpm/pg@8.11.5/node_modules/pg/lib/query.js"(exports, module2) {
1725
+ "../../node_modules/.pnpm/pg@8.13.3/node_modules/pg/lib/query.js"(exports, module2) {
1733
1726
  "use strict";
1734
1727
  var { EventEmitter } = (0, import_chunk_WWAWV7DQ.__require)("events");
1735
1728
  var Result = require_result();
@@ -1743,6 +1736,7 @@ var require_query = (0, import_chunk_WWAWV7DQ.__commonJS)({
1743
1736
  this.rows = config.rows;
1744
1737
  this.types = config.types;
1745
1738
  this.name = config.name;
1739
+ this.queryMode = config.queryMode;
1746
1740
  this.binary = config.binary;
1747
1741
  this.portal = config.portal || "";
1748
1742
  this.callback = config.callback;
@@ -1755,6 +1749,9 @@ var require_query = (0, import_chunk_WWAWV7DQ.__commonJS)({
1755
1749
  this._canceledDueToError = false;
1756
1750
  }
1757
1751
  requiresPreparation() {
1752
+ if (this.queryMode === "extended") {
1753
+ return true;
1754
+ }
1758
1755
  if (this.name) {
1759
1756
  return true;
1760
1757
  }
@@ -1774,7 +1771,7 @@ var require_query = (0, import_chunk_WWAWV7DQ.__commonJS)({
1774
1771
  if (!Array.isArray(this._results)) {
1775
1772
  this._results = [this._result];
1776
1773
  }
1777
- this._result = new Result(this._rowMode, this.types);
1774
+ this._result = new Result(this._rowMode, this._result._types);
1778
1775
  this._results.push(this._result);
1779
1776
  }
1780
1777
  }
@@ -1916,7 +1913,7 @@ var require_query = (0, import_chunk_WWAWV7DQ.__commonJS)({
1916
1913
  }
1917
1914
  });
1918
1915
  var require_messages = (0, import_chunk_WWAWV7DQ.__commonJS)({
1919
- "../../node_modules/.pnpm/pg-protocol@1.6.1/node_modules/pg-protocol/dist/messages.js"(exports) {
1916
+ "../../node_modules/.pnpm/pg-protocol@1.7.1/node_modules/pg-protocol/dist/messages.js"(exports) {
1920
1917
  "use strict";
1921
1918
  Object.defineProperty(exports, "__esModule", { value: true });
1922
1919
  exports.NoticeMessage = exports.DataRowMessage = exports.CommandCompleteMessage = exports.ReadyForQueryMessage = exports.NotificationResponseMessage = exports.BackendKeyDataMessage = exports.AuthenticationMD5Password = exports.ParameterStatusMessage = exports.ParameterDescriptionMessage = exports.RowDescriptionMessage = exports.Field = exports.CopyResponse = exports.CopyDataMessage = exports.DatabaseError = exports.copyDone = exports.emptyQuery = exports.replicationStart = exports.portalSuspended = exports.noData = exports.closeComplete = exports.bindComplete = exports.parseComplete = void 0;
@@ -2079,7 +2076,7 @@ var require_messages = (0, import_chunk_WWAWV7DQ.__commonJS)({
2079
2076
  }
2080
2077
  });
2081
2078
  var require_buffer_writer = (0, import_chunk_WWAWV7DQ.__commonJS)({
2082
- "../../node_modules/.pnpm/pg-protocol@1.6.1/node_modules/pg-protocol/dist/buffer-writer.js"(exports) {
2079
+ "../../node_modules/.pnpm/pg-protocol@1.7.1/node_modules/pg-protocol/dist/buffer-writer.js"(exports) {
2083
2080
  "use strict";
2084
2081
  Object.defineProperty(exports, "__esModule", { value: true });
2085
2082
  exports.Writer = void 0;
@@ -2158,7 +2155,7 @@ var require_buffer_writer = (0, import_chunk_WWAWV7DQ.__commonJS)({
2158
2155
  }
2159
2156
  });
2160
2157
  var require_serializer = (0, import_chunk_WWAWV7DQ.__commonJS)({
2161
- "../../node_modules/.pnpm/pg-protocol@1.6.1/node_modules/pg-protocol/dist/serializer.js"(exports) {
2158
+ "../../node_modules/.pnpm/pg-protocol@1.7.1/node_modules/pg-protocol/dist/serializer.js"(exports) {
2162
2159
  "use strict";
2163
2160
  Object.defineProperty(exports, "__esModule", { value: true });
2164
2161
  exports.serialize = void 0;
@@ -2372,7 +2369,7 @@ var require_serializer = (0, import_chunk_WWAWV7DQ.__commonJS)({
2372
2369
  }
2373
2370
  });
2374
2371
  var require_buffer_reader = (0, import_chunk_WWAWV7DQ.__commonJS)({
2375
- "../../node_modules/.pnpm/pg-protocol@1.6.1/node_modules/pg-protocol/dist/buffer-reader.js"(exports) {
2372
+ "../../node_modules/.pnpm/pg-protocol@1.7.1/node_modules/pg-protocol/dist/buffer-reader.js"(exports) {
2376
2373
  "use strict";
2377
2374
  Object.defineProperty(exports, "__esModule", { value: true });
2378
2375
  exports.BufferReader = void 0;
@@ -2402,6 +2399,11 @@ var require_buffer_reader = (0, import_chunk_WWAWV7DQ.__commonJS)({
2402
2399
  this.offset += 4;
2403
2400
  return result;
2404
2401
  }
2402
+ uint32() {
2403
+ const result = this.buffer.readUInt32BE(this.offset);
2404
+ this.offset += 4;
2405
+ return result;
2406
+ }
2405
2407
  string(length) {
2406
2408
  const result = this.buffer.toString(this.encoding, this.offset, this.offset + length);
2407
2409
  this.offset += length;
@@ -2425,7 +2427,7 @@ var require_buffer_reader = (0, import_chunk_WWAWV7DQ.__commonJS)({
2425
2427
  }
2426
2428
  });
2427
2429
  var require_parser = (0, import_chunk_WWAWV7DQ.__commonJS)({
2428
- "../../node_modules/.pnpm/pg-protocol@1.6.1/node_modules/pg-protocol/dist/parser.js"(exports) {
2430
+ "../../node_modules/.pnpm/pg-protocol@1.7.1/node_modules/pg-protocol/dist/parser.js"(exports) {
2429
2431
  "use strict";
2430
2432
  Object.defineProperty(exports, "__esModule", { value: true });
2431
2433
  exports.Parser = void 0;
@@ -2596,9 +2598,9 @@ var require_parser = (0, import_chunk_WWAWV7DQ.__commonJS)({
2596
2598
  }
2597
2599
  parseField() {
2598
2600
  const name = this.reader.cstring();
2599
- const tableID = this.reader.int32();
2601
+ const tableID = this.reader.uint32();
2600
2602
  const columnID = this.reader.int16();
2601
- const dataTypeID = this.reader.int32();
2603
+ const dataTypeID = this.reader.uint32();
2602
2604
  const dataTypeSize = this.reader.int16();
2603
2605
  const dataTypeModifier = this.reader.int32();
2604
2606
  const mode = this.reader.int16() === 0 ? "text" : "binary";
@@ -2714,7 +2716,7 @@ var require_parser = (0, import_chunk_WWAWV7DQ.__commonJS)({
2714
2716
  }
2715
2717
  });
2716
2718
  var require_dist = (0, import_chunk_WWAWV7DQ.__commonJS)({
2717
- "../../node_modules/.pnpm/pg-protocol@1.6.1/node_modules/pg-protocol/dist/index.js"(exports) {
2719
+ "../../node_modules/.pnpm/pg-protocol@1.7.1/node_modules/pg-protocol/dist/index.js"(exports) {
2718
2720
  "use strict";
2719
2721
  Object.defineProperty(exports, "__esModule", { value: true });
2720
2722
  exports.DatabaseError = exports.serialize = exports.parse = void 0;
@@ -2747,32 +2749,73 @@ var init_empty = (0, import_chunk_WWAWV7DQ.__esm)({
2747
2749
  }
2748
2750
  });
2749
2751
  var require_stream = (0, import_chunk_WWAWV7DQ.__commonJS)({
2750
- "../../node_modules/.pnpm/pg@8.11.5/node_modules/pg/lib/stream.js"(exports, module2) {
2752
+ "../../node_modules/.pnpm/pg@8.13.3/node_modules/pg/lib/stream.js"(exports, module2) {
2751
2753
  "use strict";
2752
- module2.exports.getStream = function getStream(ssl) {
2753
- const net = (0, import_chunk_WWAWV7DQ.__require)("net");
2754
- if (typeof net.Socket === "function") {
2754
+ var { getStream, getSecureStream } = getStreamFuncs();
2755
+ module2.exports = {
2756
+ /**
2757
+ * Get a socket stream compatible with the current runtime environment.
2758
+ * @returns {Duplex}
2759
+ */
2760
+ getStream,
2761
+ /**
2762
+ * Get a TLS secured socket, compatible with the current environment,
2763
+ * using the socket and other settings given in `options`.
2764
+ * @returns {Duplex}
2765
+ */
2766
+ getSecureStream
2767
+ };
2768
+ function getNodejsStreamFuncs() {
2769
+ function getStream2(ssl) {
2770
+ const net = (0, import_chunk_WWAWV7DQ.__require)("net");
2755
2771
  return new net.Socket();
2756
- } else {
2772
+ }
2773
+ function getSecureStream2(options) {
2774
+ var tls = (0, import_chunk_WWAWV7DQ.__require)("tls");
2775
+ return tls.connect(options);
2776
+ }
2777
+ return {
2778
+ getStream: getStream2,
2779
+ getSecureStream: getSecureStream2
2780
+ };
2781
+ }
2782
+ function getCloudflareStreamFuncs() {
2783
+ function getStream2(ssl) {
2757
2784
  const { CloudflareSocket } = (init_empty(), (0, import_chunk_WWAWV7DQ.__toCommonJS)(empty_exports));
2758
2785
  return new CloudflareSocket(ssl);
2759
2786
  }
2760
- };
2761
- module2.exports.getSecureStream = function getSecureStream(options) {
2762
- var tls = (0, import_chunk_WWAWV7DQ.__require)("tls");
2763
- if (tls.connect) {
2764
- return tls.connect(options);
2765
- } else {
2787
+ function getSecureStream2(options) {
2766
2788
  options.socket.startTls(options);
2767
2789
  return options.socket;
2768
2790
  }
2769
- };
2791
+ return {
2792
+ getStream: getStream2,
2793
+ getSecureStream: getSecureStream2
2794
+ };
2795
+ }
2796
+ function isCloudflareRuntime() {
2797
+ if (typeof navigator === "object" && navigator !== null && typeof navigator.userAgent === "string") {
2798
+ return navigator.userAgent === "Cloudflare-Workers";
2799
+ }
2800
+ if (typeof Response === "function") {
2801
+ const resp = new Response(null, { cf: { thing: true } });
2802
+ if (typeof resp.cf === "object" && resp.cf !== null && resp.cf.thing) {
2803
+ return true;
2804
+ }
2805
+ }
2806
+ return false;
2807
+ }
2808
+ function getStreamFuncs() {
2809
+ if (isCloudflareRuntime()) {
2810
+ return getCloudflareStreamFuncs();
2811
+ }
2812
+ return getNodejsStreamFuncs();
2813
+ }
2770
2814
  }
2771
2815
  });
2772
2816
  var require_connection = (0, import_chunk_WWAWV7DQ.__commonJS)({
2773
- "../../node_modules/.pnpm/pg@8.11.5/node_modules/pg/lib/connection.js"(exports, module2) {
2817
+ "../../node_modules/.pnpm/pg@8.13.3/node_modules/pg/lib/connection.js"(exports, module2) {
2774
2818
  "use strict";
2775
- var net = (0, import_chunk_WWAWV7DQ.__require)("net");
2776
2819
  var EventEmitter = (0, import_chunk_WWAWV7DQ.__require)("events").EventEmitter;
2777
2820
  var { parse, serialize } = require_dist();
2778
2821
  var { getStream, getSecureStream } = require_stream();
@@ -2846,8 +2889,8 @@ var require_connection = (0, import_chunk_WWAWV7DQ.__commonJS)({
2846
2889
  options.key = self.ssl.key;
2847
2890
  }
2848
2891
  }
2849
- var net2 = (0, import_chunk_WWAWV7DQ.__require)("net");
2850
- if (net2.isIP && net2.isIP(host) === 0) {
2892
+ var net = (0, import_chunk_WWAWV7DQ.__require)("net");
2893
+ if (net.isIP && net.isIP(host) === 0) {
2851
2894
  options.servername = host;
2852
2895
  }
2853
2896
  try {
@@ -2953,7 +2996,7 @@ var require_connection = (0, import_chunk_WWAWV7DQ.__commonJS)({
2953
2996
  }
2954
2997
  });
2955
2998
  var require_split2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
2956
- "../../node_modules/.pnpm/split2@4.1.0/node_modules/split2/index.js"(exports, module2) {
2999
+ "../../node_modules/.pnpm/split2@4.2.0/node_modules/split2/index.js"(exports, module2) {
2957
3000
  "use strict";
2958
3001
  var { Transform } = (0, import_chunk_WWAWV7DQ.__require)("stream");
2959
3002
  var { StringDecoder } = (0, import_chunk_WWAWV7DQ.__require)("string_decoder");
@@ -3014,7 +3057,7 @@ var require_split2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
3014
3057
  if (typeof matcher === "function") {
3015
3058
  mapper = matcher;
3016
3059
  matcher = /\r?\n/;
3017
- } else if (typeof matcher === "object" && !(matcher instanceof RegExp)) {
3060
+ } else if (typeof matcher === "object" && !(matcher instanceof RegExp) && !matcher[Symbol.split]) {
3018
3061
  options = matcher;
3019
3062
  matcher = /\r?\n/;
3020
3063
  }
@@ -3240,7 +3283,7 @@ var require_lib = (0, import_chunk_WWAWV7DQ.__commonJS)({
3240
3283
  }
3241
3284
  });
3242
3285
  var require_client = (0, import_chunk_WWAWV7DQ.__commonJS)({
3243
- "../../node_modules/.pnpm/pg@8.11.5/node_modules/pg/lib/client.js"(exports, module2) {
3286
+ "../../node_modules/.pnpm/pg@8.13.3/node_modules/pg/lib/client.js"(exports, module2) {
3244
3287
  "use strict";
3245
3288
  var EventEmitter = (0, import_chunk_WWAWV7DQ.__require)("events").EventEmitter;
3246
3289
  var utils = require_utils();
@@ -3319,7 +3362,6 @@ var require_client = (0, import_chunk_WWAWV7DQ.__commonJS)({
3319
3362
  return;
3320
3363
  }
3321
3364
  this._connecting = true;
3322
- this.connectionTimeoutHandle;
3323
3365
  if (this._connectionTimeoutMillis > 0) {
3324
3366
  this.connectionTimeoutHandle = setTimeout(() => {
3325
3367
  con._ending = true;
@@ -3548,9 +3590,19 @@ var require_client = (0, import_chunk_WWAWV7DQ.__commonJS)({
3548
3590
  this.activeQuery.handleEmptyQuery(this.connection);
3549
3591
  }
3550
3592
  _handleCommandComplete(msg) {
3593
+ if (this.activeQuery == null) {
3594
+ const error = new Error("Received unexpected commandComplete message from backend.");
3595
+ this._handleErrorEvent(error);
3596
+ return;
3597
+ }
3551
3598
  this.activeQuery.handleCommandComplete(msg, this.connection);
3552
3599
  }
3553
- _handleParseComplete(msg) {
3600
+ _handleParseComplete() {
3601
+ if (this.activeQuery == null) {
3602
+ const error = new Error("Received unexpected parseComplete message from backend.");
3603
+ this._handleErrorEvent(error);
3604
+ return;
3605
+ }
3554
3606
  if (this.activeQuery.name) {
3555
3607
  this.connection.parsedStatements[this.activeQuery.name] = this.activeQuery.text;
3556
3608
  }
@@ -3659,7 +3711,7 @@ var require_client = (0, import_chunk_WWAWV7DQ.__commonJS)({
3659
3711
  query.callback = query.callback || values;
3660
3712
  }
3661
3713
  } else {
3662
- readTimeout = this.connectionParameters.query_timeout;
3714
+ readTimeout = config.query_timeout || this.connectionParameters.query_timeout;
3663
3715
  query = new Query(config, values, callback);
3664
3716
  if (!query.callback) {
3665
3717
  result = new this._Promise((resolve, reject) => {
@@ -3747,7 +3799,7 @@ var require_client = (0, import_chunk_WWAWV7DQ.__commonJS)({
3747
3799
  }
3748
3800
  });
3749
3801
  var require_pg_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
3750
- "../../node_modules/.pnpm/pg-pool@3.6.2_pg@8.11.5/node_modules/pg-pool/index.js"(exports, module2) {
3802
+ "../../node_modules/.pnpm/pg-pool@3.7.1_pg@8.13.3/node_modules/pg-pool/index.js"(exports, module2) {
3751
3803
  "use strict";
3752
3804
  var EventEmitter = (0, import_chunk_WWAWV7DQ.__require)("events").EventEmitter;
3753
3805
  var NOOP = function() {
@@ -3943,7 +3995,7 @@ var require_pg_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
3943
3995
  this.log("client failed to connect", err);
3944
3996
  this._clients = this._clients.filter((c) => c !== client);
3945
3997
  if (timeoutHit) {
3946
- err.message = "Connection terminated due to connection timeout";
3998
+ err = new Error("Connection terminated due to connection timeout", { cause: err });
3947
3999
  }
3948
4000
  this._pulseQueue();
3949
4001
  if (!pendingItem.timedOut) {
@@ -4128,7 +4180,7 @@ var require_pg_pool = (0, import_chunk_WWAWV7DQ.__commonJS)({
4128
4180
  }
4129
4181
  });
4130
4182
  var require_query2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
4131
- "../../node_modules/.pnpm/pg@8.11.5/node_modules/pg/lib/native/query.js"(exports, module2) {
4183
+ "../../node_modules/.pnpm/pg@8.13.3/node_modules/pg/lib/native/query.js"(exports, module2) {
4132
4184
  "use strict";
4133
4185
  var EventEmitter = (0, import_chunk_WWAWV7DQ.__require)("events").EventEmitter;
4134
4186
  var util = (0, import_chunk_WWAWV7DQ.__require)("util");
@@ -4139,6 +4191,7 @@ var require_query2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
4139
4191
  this.text = config.text;
4140
4192
  this.values = config.values;
4141
4193
  this.name = config.name;
4194
+ this.queryMode = config.queryMode;
4142
4195
  this.callback = config.callback;
4143
4196
  this.state = "new";
4144
4197
  this._arrayMode = config.rowMode === "array";
@@ -4258,6 +4311,8 @@ var require_query2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
4258
4311
  }
4259
4312
  var vals = this.values.map(utils.prepareValue);
4260
4313
  client.native.query(this.text, vals, after);
4314
+ } else if (this.queryMode === "extended") {
4315
+ client.native.query(this.text, [], after);
4261
4316
  } else {
4262
4317
  client.native.query(this.text, after);
4263
4318
  }
@@ -4265,7 +4320,7 @@ var require_query2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
4265
4320
  }
4266
4321
  });
4267
4322
  var require_client2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
4268
- "../../node_modules/.pnpm/pg@8.11.5/node_modules/pg/lib/native/client.js"(exports, module2) {
4323
+ "../../node_modules/.pnpm/pg@8.13.3/node_modules/pg/lib/native/client.js"(exports, module2) {
4269
4324
  "use strict";
4270
4325
  var Native;
4271
4326
  try {
@@ -4384,7 +4439,7 @@ var require_client2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
4384
4439
  config.callback = values;
4385
4440
  }
4386
4441
  } else {
4387
- readTimeout = this.connectionParameters.query_timeout;
4442
+ readTimeout = config.query_timeout || this.connectionParameters.query_timeout;
4388
4443
  query = new NativeQuery(config, values, callback);
4389
4444
  if (!query.callback) {
4390
4445
  let resolveOut, rejectOut;
@@ -4503,13 +4558,13 @@ var require_client2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
4503
4558
  }
4504
4559
  });
4505
4560
  var require_native = (0, import_chunk_WWAWV7DQ.__commonJS)({
4506
- "../../node_modules/.pnpm/pg@8.11.5/node_modules/pg/lib/native/index.js"(exports, module2) {
4561
+ "../../node_modules/.pnpm/pg@8.13.3/node_modules/pg/lib/native/index.js"(exports, module2) {
4507
4562
  "use strict";
4508
4563
  module2.exports = require_client2();
4509
4564
  }
4510
4565
  });
4511
4566
  var require_lib2 = (0, import_chunk_WWAWV7DQ.__commonJS)({
4512
- "../../node_modules/.pnpm/pg@8.11.5/node_modules/pg/lib/index.js"(exports, module2) {
4567
+ "../../node_modules/.pnpm/pg@8.13.3/node_modules/pg/lib/index.js"(exports, module2) {
4513
4568
  "use strict";
4514
4569
  var Client = require_client();
4515
4570
  var defaults = require_defaults();
@@ -26,47 +26,40 @@ 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_4EV2RVXY_exports = {};
30
- __export(chunk_4EV2RVXY_exports, {
29
+ var chunk_TPQ5YBLK_exports = {};
30
+ __export(chunk_TPQ5YBLK_exports, {
31
31
  DbExecute: () => DbExecute
32
32
  });
33
- module.exports = __toCommonJS(chunk_4EV2RVXY_exports);
33
+ module.exports = __toCommonJS(chunk_TPQ5YBLK_exports);
34
34
  var import_chunk_DDHPSYC4 = require("./chunk-DDHPSYC4.js");
35
35
  var import_chunk_SKRR5WT4 = require("./chunk-SKRR5WT4.js");
36
- var import_chunk_WWAWV7DQ = require("./chunk-WWAWV7DQ.js");
37
36
  var import_internals = require("@prisma/internals");
38
37
  var import_fs = __toESM(require("fs"));
39
38
  var import_path = __toESM(require("path"));
40
- var require_get_stdin = (0, import_chunk_WWAWV7DQ.__commonJS)({
41
- "../../node_modules/.pnpm/get-stdin@8.0.0/node_modules/get-stdin/index.js"(exports, module2) {
42
- "use strict";
43
- var { stdin } = process;
44
- module2.exports = async () => {
45
- let result = "";
46
- if (stdin.isTTY) {
47
- return result;
48
- }
49
- stdin.setEncoding("utf8");
50
- for await (const chunk of stdin) {
51
- result += chunk;
52
- }
53
- return result;
54
- };
55
- module2.exports.buffer = async () => {
56
- const result = [];
57
- let length = 0;
58
- if (stdin.isTTY) {
59
- return Buffer.concat([]);
60
- }
61
- for await (const chunk of stdin) {
62
- result.push(chunk);
63
- length += chunk.length;
64
- }
65
- return Buffer.concat(result, length);
66
- };
39
+ var { stdin } = process;
40
+ async function getStdin() {
41
+ let result = "";
42
+ if (stdin.isTTY) {
43
+ return result;
67
44
  }
68
- });
69
- var import_get_stdin = (0, import_chunk_WWAWV7DQ.__toESM)(require_get_stdin());
45
+ stdin.setEncoding("utf8");
46
+ for await (const chunk of stdin) {
47
+ result += chunk;
48
+ }
49
+ return result;
50
+ }
51
+ getStdin.buffer = async () => {
52
+ const result = [];
53
+ let length = 0;
54
+ if (stdin.isTTY) {
55
+ return Buffer.concat([]);
56
+ }
57
+ for await (const chunk of stdin) {
58
+ result.push(chunk);
59
+ length += chunk.length;
60
+ }
61
+ return Buffer.concat(result, length);
62
+ };
70
63
  var helpOptions = (0, import_internals.format)(
71
64
  `${(0, import_chunk_SKRR5WT4.bold)("Usage")}
72
65
 
@@ -151,7 +144,7 @@ See \`${(0, import_chunk_SKRR5WT4.green)((0, import_internals.getCommandWithExec
151
144
  }
152
145
  }
153
146
  if (args["--stdin"]) {
154
- script = await (0, import_get_stdin.default)();
147
+ script = await getStdin();
155
148
  }
156
149
  let datasourceType;
157
150
  if (args["--url"]) {