logixia 1.8.2 → 1.8.3

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 (54) hide show
  1. package/dist/.tsbuildinfo +1 -1
  2. package/dist/{index-CthBT3t8.d.mts → index-BFUPvkkQ.d.mts} +12 -1
  3. package/dist/index-BFUPvkkQ.d.mts.map +1 -0
  4. package/dist/{index-ClPZrfIU.d.ts → index-DknhKCCg.d.ts} +12 -1
  5. package/dist/index-DknhKCCg.d.ts.map +1 -0
  6. package/dist/index.d.mts +54 -15
  7. package/dist/index.d.mts.map +1 -1
  8. package/dist/index.d.ts +54 -15
  9. package/dist/index.d.ts.map +1 -1
  10. package/dist/index.js +54 -24
  11. package/dist/index.js.map +1 -1
  12. package/dist/index.mjs +54 -23
  13. package/dist/index.mjs.map +1 -1
  14. package/dist/{logitron-logger.module-Fof9Er2E.js → logitron-logger.module-B-sUxEiz.js} +159 -33
  15. package/dist/logitron-logger.module-B-sUxEiz.js.map +1 -0
  16. package/dist/{logitron-logger.module-DucvDnxZ.mjs → logitron-logger.module-B0A-mnc7.mjs} +154 -34
  17. package/dist/logitron-logger.module-B0A-mnc7.mjs.map +1 -0
  18. package/dist/{logitron-logger.module-Dx2mUz-g.d.ts → logitron-logger.module-BcxoyFoO.d.ts} +99 -7
  19. package/dist/logitron-logger.module-BcxoyFoO.d.ts.map +1 -0
  20. package/dist/{logitron-logger.module-KU_L04y1.d.mts → logitron-logger.module-HaMh8Nh7.d.mts} +99 -7
  21. package/dist/logitron-logger.module-HaMh8Nh7.d.mts.map +1 -0
  22. package/dist/middleware.d.mts +1 -1
  23. package/dist/middleware.d.ts +1 -1
  24. package/dist/nest.d.mts +4 -44
  25. package/dist/nest.d.mts.map +1 -1
  26. package/dist/nest.d.ts +4 -44
  27. package/dist/nest.d.ts.map +1 -1
  28. package/dist/nest.js +3 -93
  29. package/dist/nest.mjs +3 -92
  30. package/dist/{promise-BrZcjavs.mjs → promise-B4HzEg1I.mjs} +413 -261
  31. package/dist/promise-B4HzEg1I.mjs.map +1 -0
  32. package/dist/{promise-BI-3eI4n.js → promise-FtXoEiT6.js} +413 -261
  33. package/dist/promise-FtXoEiT6.js.map +1 -0
  34. package/dist/testing.d.mts +1 -1
  35. package/dist/testing.d.ts +1 -1
  36. package/dist/{transport.manager-DU1W0wV3.js → transport.manager-CqPyddCV.js} +2 -2
  37. package/dist/{transport.manager-DU1W0wV3.js.map → transport.manager-CqPyddCV.js.map} +1 -1
  38. package/dist/{transport.manager-BCnLEmOy.mjs → transport.manager-DMdotLoQ.mjs} +2 -2
  39. package/dist/{transport.manager-BCnLEmOy.mjs.map → transport.manager-DMdotLoQ.mjs.map} +1 -1
  40. package/dist/transports.d.mts +1 -1
  41. package/dist/transports.d.ts +1 -1
  42. package/dist/transports.js +1 -1
  43. package/dist/transports.mjs +1 -1
  44. package/package.json +2 -1
  45. package/dist/index-ClPZrfIU.d.ts.map +0 -1
  46. package/dist/index-CthBT3t8.d.mts.map +0 -1
  47. package/dist/logitron-logger.module-DucvDnxZ.mjs.map +0 -1
  48. package/dist/logitron-logger.module-Dx2mUz-g.d.ts.map +0 -1
  49. package/dist/logitron-logger.module-Fof9Er2E.js.map +0 -1
  50. package/dist/logitron-logger.module-KU_L04y1.d.mts.map +0 -1
  51. package/dist/nest.js.map +0 -1
  52. package/dist/nest.mjs.map +0 -1
  53. package/dist/promise-BI-3eI4n.js.map +0 -1
  54. package/dist/promise-BrZcjavs.mjs.map +0 -1
@@ -15215,7 +15215,7 @@ var require_packet = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/my
15215
15215
  const NativeBuffer = require("buffer").Buffer;
15216
15216
  const Long = require_umd();
15217
15217
  const StringParser$3 = require_string();
15218
- const Types$6 = require_types();
15218
+ const Types$8 = require_types();
15219
15219
  const INVALID_DATE = /* @__PURE__ */ new Date(NaN);
15220
15220
  const pad = "000000000000";
15221
15221
  function leftPad(num, value) {
@@ -15228,7 +15228,7 @@ var require_packet = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/my
15228
15228
  const dot = ".".charCodeAt(0);
15229
15229
  const exponent = "e".charCodeAt(0);
15230
15230
  const exponentCapital = "E".charCodeAt(0);
15231
- var Packet$22 = class Packet$22 {
15231
+ var Packet$24 = class Packet$24 {
15232
15232
  constructor(id, buffer$1, start, end) {
15233
15233
  this.sequenceId = id;
15234
15234
  this.numPackets = 1;
@@ -15296,18 +15296,14 @@ var require_packet = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/my
15296
15296
  return new Long(this.readInt32(), this.readInt32(), false).toString();
15297
15297
  }
15298
15298
  readInt64() {
15299
- let res = new Long(this.readInt32(), this.readInt32(), true);
15299
+ const res = new Long(this.readInt32(), this.readInt32(), true);
15300
15300
  const resNumber = res.toNumber();
15301
- const resString = res.toString();
15302
- res = resNumber.toString() === resString ? resNumber : resString;
15303
- return res;
15301
+ return Number.isSafeInteger(resNumber) ? resNumber : res.toString();
15304
15302
  }
15305
15303
  readSInt64() {
15306
- let res = new Long(this.readInt32(), this.readInt32(), false);
15304
+ const res = new Long(this.readInt32(), this.readInt32(), false);
15307
15305
  const resNumber = res.toNumber();
15308
- const resString = res.toString();
15309
- res = resNumber.toString() === resString ? resNumber : resString;
15310
- return res;
15306
+ return Number.isSafeInteger(resNumber) ? resNumber : res.toString();
15311
15307
  }
15312
15308
  isEOF() {
15313
15309
  return this.buffer[this.offset] === 254 && this.length() < 13;
@@ -15340,8 +15336,8 @@ var require_packet = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/my
15340
15336
  res = new Long(word0, word1, !signed);
15341
15337
  const resNumber = res.toNumber();
15342
15338
  const resString = res.toString();
15343
- res = resNumber.toString() === resString ? resNumber : resString;
15344
- return bigNumberStrings ? resString : res;
15339
+ if (bigNumberStrings || !Number.isSafeInteger(resNumber)) return resString;
15340
+ return resNumber;
15345
15341
  }
15346
15342
  console.trace();
15347
15343
  throw new Error(`Should not reach here: ${tag}`);
@@ -15420,7 +15416,7 @@ var require_packet = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/my
15420
15416
  leftPad(2, M),
15421
15417
  leftPad(2, S)
15422
15418
  ].join(":")}`;
15423
- } else if (columnType === Types$6.DATETIME) str += " 00:00:00";
15419
+ } else if (columnType === Types$8.DATETIME) str += " 00:00:00";
15424
15420
  if (length > 10) {
15425
15421
  ms = this.readInt32();
15426
15422
  str += ".";
@@ -15511,7 +15507,7 @@ var require_packet = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/my
15511
15507
  if (numDigits >= 15) {
15512
15508
  str = this.readString(end - this.offset, "binary");
15513
15509
  result = parseInt(str, 10);
15514
- if (result.toString() === str) return sign * result;
15510
+ if (Number.isSafeInteger(sign * result)) return sign * result;
15515
15511
  return sign === -1 ? `-${str}` : str;
15516
15512
  }
15517
15513
  if (numDigits > 16) {
@@ -15527,9 +15523,8 @@ var require_packet = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/my
15527
15523
  }
15528
15524
  const num = result * sign;
15529
15525
  if (!supportBigNumbers) return num;
15530
- str = this.buffer.toString("ascii", start, end);
15531
- if (num.toString() === str) return num;
15532
- return str;
15526
+ if (Number.isSafeInteger(num)) return num;
15527
+ return this.buffer.toString("ascii", start, end);
15533
15528
  }
15534
15529
  parseIntNoBigCheck(len) {
15535
15530
  if (len === null) return null;
@@ -15840,7 +15835,7 @@ var require_packet = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/my
15840
15835
  this.offset = offset;
15841
15836
  }
15842
15837
  clone() {
15843
- return new Packet$22(this.sequenceId, this.buffer, this.start, this.end);
15838
+ return new Packet$24(this.sequenceId, this.buffer, this.start, this.end);
15844
15839
  }
15845
15840
  type() {
15846
15841
  if (this.isEOF()) return "EOF";
@@ -15856,7 +15851,7 @@ var require_packet = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/my
15856
15851
  }
15857
15852
  static lengthCodedStringLength(str, encoding) {
15858
15853
  const slen = StringParser$3.encode(str, encoding).length;
15859
- return Packet$22.lengthCodedNumberLength(slen) + slen;
15854
+ return Packet$24.lengthCodedNumberLength(slen) + slen;
15860
15855
  }
15861
15856
  static MockBuffer() {
15862
15857
  const noop = function() {};
@@ -15865,13 +15860,13 @@ var require_packet = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/my
15865
15860
  return res;
15866
15861
  }
15867
15862
  };
15868
- module.exports = Packet$22;
15863
+ module.exports = Packet$24;
15869
15864
  }) });
15870
15865
 
15871
15866
  //#endregion
15872
15867
  //#region node_modules/mysql2/lib/packet_parser.js
15873
15868
  var require_packet_parser = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/packet_parser.js": ((exports, module) => {
15874
- const Packet$21 = require_packet();
15869
+ const Packet$23 = require_packet();
15875
15870
  const MAX_PACKET_LENGTH = 16777215;
15876
15871
  function readPacketLength(b, off) {
15877
15872
  const b0 = b[off];
@@ -15903,7 +15898,7 @@ var require_packet_parser = /* @__PURE__ */ require_chunk.__commonJS({ "node_mod
15903
15898
  0
15904
15899
  ]));
15905
15900
  const body = Buffer.concat(this.largePacketParts);
15906
- const packet = new Packet$21(this.firstPacketSequenceId, body, 0, body.length);
15901
+ const packet = new Packet$23(this.firstPacketSequenceId, body, 0, body.length);
15907
15902
  this.largePacketParts.length = 0;
15908
15903
  packet.numPackets = numPackets;
15909
15904
  this.onPacket(packet);
@@ -15921,7 +15916,7 @@ var require_packet_parser = /* @__PURE__ */ require_chunk.__commonJS({ "node_mod
15921
15916
  ]));
15922
15917
  const body = Buffer.concat(this.largePacketParts);
15923
15918
  this.largePacketParts.length = 0;
15924
- const packet = new Packet$21(this.firstPacketSequenceId, body, 0, body.length);
15919
+ const packet = new Packet$23(this.firstPacketSequenceId, body, 0, body.length);
15925
15920
  packet.numPackets = numPackets;
15926
15921
  this.onPacket(packet);
15927
15922
  }
@@ -15932,7 +15927,7 @@ var require_packet_parser = /* @__PURE__ */ require_chunk.__commonJS({ "node_mod
15932
15927
  this.length = readPacketLength(chunk, start);
15933
15928
  if (end - start >= this.length + this.packetHeaderLength) {
15934
15929
  const sequenceId = chunk[start + 3];
15935
- if (this.length < MAX_PACKET_LENGTH && this.largePacketParts.length === 0) this.onPacket(new Packet$21(sequenceId, chunk, start, start + this.packetHeaderLength + this.length));
15930
+ if (this.length < MAX_PACKET_LENGTH && this.largePacketParts.length === 0) this.onPacket(new Packet$23(sequenceId, chunk, start, start + this.packetHeaderLength + this.length));
15936
15931
  else {
15937
15932
  if (this.largePacketParts.length === 0) this.firstPacketSequenceId = sequenceId;
15938
15933
  this.largePacketParts.push(chunk.slice(start + this.packetHeaderLength, start + this.packetHeaderLength + this.length));
@@ -15968,7 +15963,7 @@ var require_packet_parser = /* @__PURE__ */ require_chunk.__commonJS({ "node_mod
15968
15963
  }
15969
15964
  chunk.copy(payload, offset, start, start + remainingPayload);
15970
15965
  const sequenceId = payload[3];
15971
- if (this.length < MAX_PACKET_LENGTH && this.largePacketParts.length === 0) this.onPacket(new Packet$21(sequenceId, payload, 0, this.length + this.packetHeaderLength));
15966
+ if (this.length < MAX_PACKET_LENGTH && this.largePacketParts.length === 0) this.onPacket(new Packet$23(sequenceId, payload, 0, this.length + this.packetHeaderLength));
15972
15967
  else {
15973
15968
  if (this.largePacketParts.length === 0) this.firstPacketSequenceId = sequenceId;
15974
15969
  this.largePacketParts.push(payload.slice(this.packetHeaderLength, this.packetHeaderLength + this.length));
@@ -16007,7 +16002,7 @@ var require_packet_parser = /* @__PURE__ */ require_chunk.__commonJS({ "node_mod
16007
16002
  //#endregion
16008
16003
  //#region node_modules/mysql2/lib/packets/auth_next_factor.js
16009
16004
  var require_auth_next_factor = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/packets/auth_next_factor.js": ((exports, module) => {
16010
- const Packet$20 = require_packet();
16005
+ const Packet$22 = require_packet();
16011
16006
  var AuthNextFactor = class AuthNextFactor {
16012
16007
  constructor(opts) {
16013
16008
  this.pluginName = opts.pluginName;
@@ -16015,7 +16010,7 @@ var require_auth_next_factor = /* @__PURE__ */ require_chunk.__commonJS({ "node_
16015
16010
  }
16016
16011
  toPacket(encoding) {
16017
16012
  const length = 6 + this.pluginName.length + this.pluginData.length;
16018
- const packet = new Packet$20(0, Buffer.allocUnsafe(length), 0, length);
16013
+ const packet = new Packet$22(0, Buffer.allocUnsafe(length), 0, length);
16019
16014
  packet.offset = 4;
16020
16015
  packet.writeInt8(2);
16021
16016
  packet.writeNullTerminatedString(this.pluginName, encoding);
@@ -16036,7 +16031,7 @@ var require_auth_next_factor = /* @__PURE__ */ require_chunk.__commonJS({ "node_
16036
16031
  //#endregion
16037
16032
  //#region node_modules/mysql2/lib/packets/auth_switch_request.js
16038
16033
  var require_auth_switch_request = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/packets/auth_switch_request.js": ((exports, module) => {
16039
- const Packet$19 = require_packet();
16034
+ const Packet$21 = require_packet();
16040
16035
  var AuthSwitchRequest = class AuthSwitchRequest {
16041
16036
  constructor(opts) {
16042
16037
  this.pluginName = opts.pluginName;
@@ -16044,7 +16039,7 @@ var require_auth_switch_request = /* @__PURE__ */ require_chunk.__commonJS({ "no
16044
16039
  }
16045
16040
  toPacket() {
16046
16041
  const length = 6 + this.pluginName.length + this.pluginData.length;
16047
- const packet = new Packet$19(0, Buffer.allocUnsafe(length), 0, length);
16042
+ const packet = new Packet$21(0, Buffer.allocUnsafe(length), 0, length);
16048
16043
  packet.offset = 4;
16049
16044
  packet.writeInt8(254);
16050
16045
  packet.writeNullTerminatedString(this.pluginName, "cesu8");
@@ -16065,14 +16060,14 @@ var require_auth_switch_request = /* @__PURE__ */ require_chunk.__commonJS({ "no
16065
16060
  //#endregion
16066
16061
  //#region node_modules/mysql2/lib/packets/auth_switch_request_more_data.js
16067
16062
  var require_auth_switch_request_more_data = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/packets/auth_switch_request_more_data.js": ((exports, module) => {
16068
- const Packet$18 = require_packet();
16063
+ const Packet$20 = require_packet();
16069
16064
  var AuthSwitchRequestMoreData = class AuthSwitchRequestMoreData {
16070
16065
  constructor(data) {
16071
16066
  this.data = data;
16072
16067
  }
16073
16068
  toPacket() {
16074
16069
  const length = 5 + this.data.length;
16075
- const packet = new Packet$18(0, Buffer.allocUnsafe(length), 0, length);
16070
+ const packet = new Packet$20(0, Buffer.allocUnsafe(length), 0, length);
16076
16071
  packet.offset = 4;
16077
16072
  packet.writeInt8(1);
16078
16073
  packet.writeBuffer(this.data);
@@ -16092,7 +16087,7 @@ var require_auth_switch_request_more_data = /* @__PURE__ */ require_chunk.__comm
16092
16087
  //#endregion
16093
16088
  //#region node_modules/mysql2/lib/packets/auth_switch_response.js
16094
16089
  var require_auth_switch_response = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/packets/auth_switch_response.js": ((exports, module) => {
16095
- const Packet$17 = require_packet();
16090
+ const Packet$19 = require_packet();
16096
16091
  var AuthSwitchResponse = class AuthSwitchResponse {
16097
16092
  constructor(data) {
16098
16093
  if (!Buffer.isBuffer(data)) data = Buffer.from(data);
@@ -16100,7 +16095,7 @@ var require_auth_switch_response = /* @__PURE__ */ require_chunk.__commonJS({ "n
16100
16095
  }
16101
16096
  toPacket() {
16102
16097
  const length = 4 + this.data.length;
16103
- const packet = new Packet$17(0, Buffer.allocUnsafe(length), 0, length);
16098
+ const packet = new Packet$19(0, Buffer.allocUnsafe(length), 0, length);
16104
16099
  packet.offset = 4;
16105
16100
  packet.writeBuffer(this.data);
16106
16101
  return packet;
@@ -16115,8 +16110,8 @@ var require_auth_switch_response = /* @__PURE__ */ require_chunk.__commonJS({ "n
16115
16110
  //#endregion
16116
16111
  //#region node_modules/mysql2/lib/packets/binary_row.js
16117
16112
  var require_binary_row = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/packets/binary_row.js": ((exports, module) => {
16118
- const Types$5 = require_types();
16119
- const Packet$16 = require_packet();
16113
+ const Types$7 = require_types();
16114
+ const Packet$18 = require_packet();
16120
16115
  const binaryReader = new Array(256);
16121
16116
  var BinaryRow = class BinaryRow {
16122
16117
  constructor(columns) {
@@ -16130,16 +16125,16 @@ var require_binary_row = /* @__PURE__ */ require_chunk.__commonJS({ "node_module
16130
16125
  ++length;
16131
16126
  return;
16132
16127
  }
16133
- length += Packet$16.lengthCodedStringLength(val.toString(10), encoding);
16128
+ length += Packet$18.lengthCodedStringLength(val.toString(10), encoding);
16134
16129
  });
16135
16130
  length = length + 2;
16136
- const packet = new Packet$16(sequenceId, Buffer.allocUnsafe(length + 4), 0, length + 4);
16131
+ const packet = new Packet$18(sequenceId, Buffer.allocUnsafe(length + 4), 0, length + 4);
16137
16132
  packet.offset = 4;
16138
16133
  packet.writeInt8(0);
16139
16134
  let bitmap = 0;
16140
16135
  let bitValue = 1;
16141
16136
  columns.forEach((parameter) => {
16142
- if (parameter.type === Types$5.NULL) bitmap += bitValue;
16137
+ if (parameter.type === Types$7.NULL) bitmap += bitValue;
16143
16138
  bitValue *= 2;
16144
16139
  if (bitValue === 256) {
16145
16140
  packet.writeInt8(bitmap);
@@ -16170,21 +16165,21 @@ var require_binary_row = /* @__PURE__ */ require_chunk.__commonJS({ "node_module
16170
16165
  return new BinaryRow(columns);
16171
16166
  }
16172
16167
  };
16173
- binaryReader[Types$5.DECIMAL] = Packet$16.prototype.readLengthCodedString;
16174
- binaryReader[1] = Packet$16.prototype.readInt8;
16175
- binaryReader[2] = Packet$16.prototype.readInt16;
16176
- binaryReader[3] = Packet$16.prototype.readInt32;
16177
- binaryReader[4] = Packet$16.prototype.readFloat;
16178
- binaryReader[5] = Packet$16.prototype.readDouble;
16179
- binaryReader[6] = Packet$16.prototype.assertInvalid;
16180
- binaryReader[7] = Packet$16.prototype.readTimestamp;
16181
- binaryReader[8] = Packet$16.prototype.readInt64;
16182
- binaryReader[9] = Packet$16.prototype.readInt32;
16183
- binaryReader[10] = Packet$16.prototype.readTimestamp;
16184
- binaryReader[11] = Packet$16.prototype.readTime;
16185
- binaryReader[12] = Packet$16.prototype.readDateTime;
16186
- binaryReader[13] = Packet$16.prototype.readInt16;
16187
- binaryReader[Types$5.VAR_STRING] = Packet$16.prototype.readLengthCodedString;
16168
+ binaryReader[Types$7.DECIMAL] = Packet$18.prototype.readLengthCodedString;
16169
+ binaryReader[1] = Packet$18.prototype.readInt8;
16170
+ binaryReader[2] = Packet$18.prototype.readInt16;
16171
+ binaryReader[3] = Packet$18.prototype.readInt32;
16172
+ binaryReader[4] = Packet$18.prototype.readFloat;
16173
+ binaryReader[5] = Packet$18.prototype.readDouble;
16174
+ binaryReader[6] = Packet$18.prototype.assertInvalid;
16175
+ binaryReader[7] = Packet$18.prototype.readTimestamp;
16176
+ binaryReader[8] = Packet$18.prototype.readInt64;
16177
+ binaryReader[9] = Packet$18.prototype.readInt32;
16178
+ binaryReader[10] = Packet$18.prototype.readTimestamp;
16179
+ binaryReader[11] = Packet$18.prototype.readTime;
16180
+ binaryReader[12] = Packet$18.prototype.readDateTime;
16181
+ binaryReader[13] = Packet$18.prototype.readInt16;
16182
+ binaryReader[Types$7.VAR_STRING] = Packet$18.prototype.readLengthCodedString;
16188
16183
  module.exports = BinaryRow;
16189
16184
  }) });
16190
16185
 
@@ -16223,6 +16218,7 @@ var require_commands$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_module
16223
16218
  STMT_FETCH: 28,
16224
16219
  DAEMON: 29,
16225
16220
  BINLOG_DUMP_GTID: 30,
16221
+ RESET_CONNECTION: 31,
16226
16222
  UNKNOWN: 255
16227
16223
  };
16228
16224
  }) });
@@ -16230,8 +16226,8 @@ var require_commands$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_module
16230
16226
  //#endregion
16231
16227
  //#region node_modules/mysql2/lib/packets/binlog_dump.js
16232
16228
  var require_binlog_dump$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/packets/binlog_dump.js": ((exports, module) => {
16233
- const Packet$15 = require_packet();
16234
- const CommandCodes$4 = require_commands$1();
16229
+ const Packet$17 = require_packet();
16230
+ const CommandCodes$5 = require_commands$1();
16235
16231
  var BinlogDump$2 = class {
16236
16232
  constructor(opts) {
16237
16233
  this.binlogPos = opts.binlogPos || 0;
@@ -16241,9 +16237,9 @@ var require_binlog_dump$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_mod
16241
16237
  }
16242
16238
  toPacket() {
16243
16239
  const length = 15 + Buffer.byteLength(this.filename, "utf8");
16244
- const packet = new Packet$15(0, Buffer.allocUnsafe(length), 0, length);
16240
+ const packet = new Packet$17(0, Buffer.allocUnsafe(length), 0, length);
16245
16241
  packet.offset = 4;
16246
- packet.writeInt8(CommandCodes$4.BINLOG_DUMP);
16242
+ packet.writeInt8(CommandCodes$5.BINLOG_DUMP);
16247
16243
  packet.writeInt32(this.binlogPos);
16248
16244
  packet.writeInt16(this.flags);
16249
16245
  packet.writeInt32(this.serverId);
@@ -16281,6 +16277,7 @@ var require_client = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/my
16281
16277
  exports.PLUGIN_AUTH_LENENC_CLIENT_DATA = 2097152;
16282
16278
  exports.CAN_HANDLE_EXPIRED_PASSWORDS = 4194304;
16283
16279
  exports.SESSION_TRACK = 8388608;
16280
+ exports.CLIENT_QUERY_ATTRIBUTES = 134217728;
16284
16281
  exports.SSL_VERIFY_SERVER_CERT = 1073741824;
16285
16282
  exports.REMEMBER_OPTIONS = 2147483648;
16286
16283
  exports.MULTI_FACTOR_AUTHENTICATION = 268435456;
@@ -16648,8 +16645,8 @@ var require_charset_encodings = /* @__PURE__ */ require_chunk.__commonJS({ "node
16648
16645
  //#region node_modules/mysql2/lib/packets/change_user.js
16649
16646
  var require_change_user$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/packets/change_user.js": ((exports, module) => {
16650
16647
  const CommandCode$4 = require_commands$1();
16651
- const ClientConstants$7 = require_client();
16652
- const Packet$14 = require_packet();
16648
+ const ClientConstants$9 = require_client();
16649
+ const Packet$16 = require_packet();
16653
16650
  const auth41$3 = require_auth_41();
16654
16651
  const CharsetToEncoding$8 = require_charset_encodings();
16655
16652
  var ChangeUser$2 = class {
@@ -16669,8 +16666,8 @@ var require_change_user$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_mod
16669
16666
  this.charsetNumber = opts.charsetNumber;
16670
16667
  }
16671
16668
  serializeToBuffer(buffer$1) {
16672
- const isSet = (flag) => this.flags & ClientConstants$7[flag];
16673
- const packet = new Packet$14(0, buffer$1, 0, buffer$1.length);
16669
+ const isSet = (flag) => this.flags & ClientConstants$9[flag];
16670
+ const packet = new Packet$16(0, buffer$1, 0, buffer$1.length);
16674
16671
  packet.offset = 4;
16675
16672
  const encoding = CharsetToEncoding$8[this.charsetNumber];
16676
16673
  packet.writeInt8(CommandCode$4.CHANGE_USER);
@@ -16690,8 +16687,8 @@ var require_change_user$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_mod
16690
16687
  const attrNames = Object.keys(connectAttributes);
16691
16688
  let keysLength = 0;
16692
16689
  for (let k = 0; k < attrNames.length; ++k) {
16693
- keysLength += Packet$14.lengthCodedStringLength(attrNames[k], encoding);
16694
- keysLength += Packet$14.lengthCodedStringLength(connectAttributes[attrNames[k]], encoding);
16690
+ keysLength += Packet$16.lengthCodedStringLength(attrNames[k], encoding);
16691
+ keysLength += Packet$16.lengthCodedStringLength(connectAttributes[attrNames[k]], encoding);
16695
16692
  }
16696
16693
  packet.writeLengthCodedNumber(keysLength);
16697
16694
  for (let k = 0; k < attrNames.length; ++k) {
@@ -16704,7 +16701,7 @@ var require_change_user$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_mod
16704
16701
  toPacket() {
16705
16702
  if (typeof this.user !== "string") throw new Error("\"user\" connection config property must be a string");
16706
16703
  if (typeof this.database !== "string") throw new Error("\"database\" connection config property must be a string");
16707
- const p = this.serializeToBuffer(Packet$14.MockBuffer());
16704
+ const p = this.serializeToBuffer(Packet$16.MockBuffer());
16708
16705
  return this.serializeToBuffer(Buffer.allocUnsafe(p.offset));
16709
16706
  }
16710
16707
  };
@@ -16714,16 +16711,16 @@ var require_change_user$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_mod
16714
16711
  //#endregion
16715
16712
  //#region node_modules/mysql2/lib/packets/close_statement.js
16716
16713
  var require_close_statement$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/packets/close_statement.js": ((exports, module) => {
16717
- const Packet$13 = require_packet();
16718
- const CommandCodes$3 = require_commands$1();
16714
+ const Packet$15 = require_packet();
16715
+ const CommandCodes$4 = require_commands$1();
16719
16716
  var CloseStatement$3 = class {
16720
16717
  constructor(id) {
16721
16718
  this.id = id;
16722
16719
  }
16723
16720
  toPacket() {
16724
- const packet = new Packet$13(0, Buffer.allocUnsafe(9), 0, 9);
16721
+ const packet = new Packet$15(0, Buffer.allocUnsafe(9), 0, 9);
16725
16722
  packet.offset = 4;
16726
- packet.writeInt8(CommandCodes$3.STMT_CLOSE);
16723
+ packet.writeInt8(CommandCodes$4.STMT_CLOSE);
16727
16724
  packet.writeInt32(this.id);
16728
16725
  return packet;
16729
16726
  }
@@ -16754,7 +16751,7 @@ var require_field_flags = /* @__PURE__ */ require_chunk.__commonJS({ "node_modul
16754
16751
  //#endregion
16755
16752
  //#region node_modules/mysql2/lib/packets/column_definition.js
16756
16753
  var require_column_definition = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/packets/column_definition.js": ((exports, module) => {
16757
- const Packet$12 = require_packet();
16754
+ const Packet$14 = require_packet();
16758
16755
  const StringParser$2 = require_string();
16759
16756
  const CharsetToEncoding$7 = require_charset_encodings();
16760
16757
  const fields = [
@@ -16814,9 +16811,9 @@ var require_column_definition = /* @__PURE__ */ require_chunk.__commonJS({ "node
16814
16811
  };
16815
16812
  }
16816
16813
  [Symbol.for("nodejs.util.inspect.custom")](depth, inspectOptions, inspect) {
16817
- const Types$7 = require_types();
16814
+ const Types$9 = require_types();
16818
16815
  const typeNames$4 = [];
16819
- for (const t in Types$7) typeNames$4[Types$7[t]] = t;
16816
+ for (const t in Types$9) typeNames$4[Types$9[t]] = t;
16820
16817
  const fiedFlags = require_field_flags();
16821
16818
  const flagNames$1 = [];
16822
16819
  const inspectFlags = this.flags;
@@ -16865,9 +16862,9 @@ var require_column_definition = /* @__PURE__ */ require_chunk.__commonJS({ "node
16865
16862
  static toPacket(column, sequenceId) {
16866
16863
  let length = 17;
16867
16864
  fields.forEach((field) => {
16868
- length += Packet$12.lengthCodedStringLength(column[field], CharsetToEncoding$7[column.characterSet]);
16865
+ length += Packet$14.lengthCodedStringLength(column[field], CharsetToEncoding$7[column.characterSet]);
16869
16866
  });
16870
- const packet = new Packet$12(sequenceId, Buffer.allocUnsafe(length), 0, length);
16867
+ const packet = new Packet$14(sequenceId, Buffer.allocUnsafe(length), 0, length);
16871
16868
  function writeField(name) {
16872
16869
  packet.writeLengthCodedString(column[name], CharsetToEncoding$7[column.characterSet]);
16873
16870
  }
@@ -16915,66 +16912,60 @@ var require_cursor = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/my
16915
16912
  NO_CURSOR: 0,
16916
16913
  READ_ONLY: 1,
16917
16914
  FOR_UPDATE: 2,
16918
- SCROLLABLE: 3
16915
+ SCROLLABLE: 3,
16916
+ PARAMETER_COUNT_AVAILABLE: 8
16919
16917
  };
16920
16918
  }) });
16921
16919
 
16922
16920
  //#endregion
16923
- //#region node_modules/mysql2/lib/packets/execute.js
16924
- var require_execute$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/packets/execute.js": ((exports, module) => {
16925
- const CursorType = require_cursor();
16926
- const CommandCodes$2 = require_commands$1();
16927
- const Types$4 = require_types();
16928
- const Packet$11 = require_packet();
16929
- const CharsetToEncoding$6 = require_charset_encodings();
16921
+ //#region node_modules/mysql2/lib/packets/encode_parameter.js
16922
+ var require_encode_parameter = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/packets/encode_parameter.js": ((exports, module) => {
16923
+ const Types$6 = require_types();
16924
+ const Packet$13 = require_packet();
16930
16925
  function isJSON(value) {
16931
16926
  return Array.isArray(value) || value.constructor === Object || typeof value.toJSON === "function" && !Buffer.isBuffer(value);
16932
16927
  }
16933
- /**
16934
- * Converts a value to an object describing type, String/Buffer representation and length
16935
- * @param {*} value
16936
- */
16937
- function toParameter(value, encoding, timezone) {
16938
- let type = Types$4.VAR_STRING;
16928
+ function toParameter$2(value, encoding, timezone) {
16929
+ let type = Types$6.VAR_STRING;
16939
16930
  let length;
16940
16931
  let writer = function(value$1) {
16941
- return Packet$11.prototype.writeLengthCodedString.call(this, value$1, encoding);
16932
+ return Packet$13.prototype.writeLengthCodedString.call(this, value$1, encoding);
16942
16933
  };
16943
16934
  if (value !== null) switch (typeof value) {
16944
16935
  case "undefined": throw new TypeError("Bind parameters must not contain undefined");
16945
16936
  case "number":
16946
- type = Types$4.DOUBLE;
16937
+ type = Types$6.DOUBLE;
16947
16938
  length = 8;
16948
- writer = Packet$11.prototype.writeDouble;
16939
+ writer = Packet$13.prototype.writeDouble;
16949
16940
  break;
16950
16941
  case "boolean":
16951
16942
  value = value | 0;
16952
- type = Types$4.TINY;
16943
+ type = Types$6.TINY;
16953
16944
  length = 1;
16954
- writer = Packet$11.prototype.writeInt8;
16945
+ writer = Packet$13.prototype.writeInt8;
16955
16946
  break;
16956
16947
  case "object":
16957
16948
  if (Object.prototype.toString.call(value) === "[object Date]") {
16958
- type = Types$4.DATETIME;
16949
+ type = Types$6.DATETIME;
16959
16950
  length = 12;
16960
16951
  writer = function(value$1) {
16961
- return Packet$11.prototype.writeDate.call(this, value$1, timezone);
16952
+ return Packet$13.prototype.writeDate.call(this, value$1, timezone);
16962
16953
  };
16963
16954
  } else if (isJSON(value)) {
16964
16955
  value = JSON.stringify(value);
16965
- type = Types$4.JSON;
16956
+ type = Types$6.JSON;
16966
16957
  } else if (Buffer.isBuffer(value)) {
16967
- length = Packet$11.lengthCodedNumberLength(value.length) + value.length;
16968
- writer = Packet$11.prototype.writeLengthCodedBuffer;
16958
+ length = Packet$13.lengthCodedNumberLength(value.length) + value.length;
16959
+ writer = Packet$13.prototype.writeLengthCodedBuffer;
16969
16960
  }
16970
16961
  break;
16971
16962
  default: value = value.toString();
16972
16963
  }
16973
16964
  else {
16974
16965
  value = "";
16975
- type = Types$4.NULL;
16966
+ type = Types$6.NULL;
16976
16967
  }
16977
- if (!length) length = Packet$11.lengthCodedStringLength(value, encoding);
16968
+ if (!length) length = Packet$13.lengthCodedStringLength(value, encoding);
16978
16969
  return {
16979
16970
  value,
16980
16971
  type,
@@ -16982,12 +16973,30 @@ var require_execute$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules
16982
16973
  writer
16983
16974
  };
16984
16975
  }
16976
+ module.exports = {
16977
+ toParameter: toParameter$2,
16978
+ isJSON
16979
+ };
16980
+ }) });
16981
+
16982
+ //#endregion
16983
+ //#region node_modules/mysql2/lib/packets/execute.js
16984
+ var require_execute$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/packets/execute.js": ((exports, module) => {
16985
+ const CursorType = require_cursor();
16986
+ const CommandCodes$3 = require_commands$1();
16987
+ const ClientConstants$8 = require_client();
16988
+ const Types$5 = require_types();
16989
+ const Packet$12 = require_packet();
16990
+ const CharsetToEncoding$6 = require_charset_encodings();
16991
+ const { toParameter: toParameter$1 } = require_encode_parameter();
16985
16992
  var Execute$3 = class {
16986
- constructor(id, parameters, charsetNumber, timezone) {
16993
+ constructor(id, parameters, charsetNumber, timezone, attributes, clientFlags) {
16987
16994
  this.id = id;
16988
16995
  this.parameters = parameters;
16989
16996
  this.encoding = CharsetToEncoding$6[charsetNumber];
16990
16997
  this.timezone = timezone;
16998
+ this.attributes = attributes;
16999
+ this.clientFlags = clientFlags || 0;
16991
17000
  }
16992
17001
  static fromPacket(packet, encoding) {
16993
17002
  const stmtId = packet.readInt32();
@@ -16995,24 +17004,24 @@ var require_execute$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules
16995
17004
  const iterationCount = packet.readInt32();
16996
17005
  let i$4 = packet.offset;
16997
17006
  while (i$4 < packet.end - 1) {
16998
- if ((packet.buffer[i$4 + 1] === Types$4.VAR_STRING || packet.buffer[i$4 + 1] === Types$4.NULL || packet.buffer[i$4 + 1] === Types$4.DOUBLE || packet.buffer[i$4 + 1] === Types$4.TINY || packet.buffer[i$4 + 1] === Types$4.DATETIME || packet.buffer[i$4 + 1] === Types$4.JSON) && packet.buffer[i$4] === 1 && packet.buffer[i$4 + 2] === 0) break;
17007
+ if ((packet.buffer[i$4 + 1] === Types$5.VAR_STRING || packet.buffer[i$4 + 1] === Types$5.NULL || packet.buffer[i$4 + 1] === Types$5.DOUBLE || packet.buffer[i$4 + 1] === Types$5.TINY || packet.buffer[i$4 + 1] === Types$5.DATETIME || packet.buffer[i$4 + 1] === Types$5.JSON) && packet.buffer[i$4] === 1 && packet.buffer[i$4 + 2] === 0) break;
16999
17008
  else packet.readInt8();
17000
17009
  i$4++;
17001
17010
  }
17002
17011
  const types = [];
17003
- for (let i$5 = packet.offset + 1; i$5 < packet.end - 1; i$5++) if ((packet.buffer[i$5] === Types$4.VAR_STRING || packet.buffer[i$5] === Types$4.NULL || packet.buffer[i$5] === Types$4.DOUBLE || packet.buffer[i$5] === Types$4.TINY || packet.buffer[i$5] === Types$4.DATETIME || packet.buffer[i$5] === Types$4.JSON) && packet.buffer[i$5 + 1] === 0) {
17012
+ for (let i$5 = packet.offset + 1; i$5 < packet.end - 1; i$5++) if ((packet.buffer[i$5] === Types$5.VAR_STRING || packet.buffer[i$5] === Types$5.NULL || packet.buffer[i$5] === Types$5.DOUBLE || packet.buffer[i$5] === Types$5.TINY || packet.buffer[i$5] === Types$5.DATETIME || packet.buffer[i$5] === Types$5.JSON) && packet.buffer[i$5 + 1] === 0) {
17004
17013
  types.push(packet.buffer[i$5]);
17005
17014
  packet.skip(2);
17006
17015
  }
17007
17016
  packet.skip(1);
17008
17017
  const values = [];
17009
17018
  for (let i$5 = 0; i$5 < types.length; i$5++) {
17010
- if (types[i$5] === Types$4.VAR_STRING) values.push(packet.readLengthCodedString(encoding));
17011
- else if (types[i$5] === Types$4.DOUBLE) values.push(packet.readDouble());
17012
- else if (types[i$5] === Types$4.TINY) values.push(packet.readInt8());
17013
- else if (types[i$5] === Types$4.DATETIME) values.push(packet.readDateTime());
17014
- else if (types[i$5] === Types$4.JSON) values.push(JSON.parse(packet.readLengthCodedString(encoding)));
17015
- if (types[i$5] === Types$4.NULL) values.push(null);
17019
+ if (types[i$5] === Types$5.VAR_STRING) values.push(packet.readLengthCodedString(encoding));
17020
+ else if (types[i$5] === Types$5.DOUBLE) values.push(packet.readDouble());
17021
+ else if (types[i$5] === Types$5.TINY) values.push(packet.readInt8());
17022
+ else if (types[i$5] === Types$5.DATETIME) values.push(packet.readDateTime());
17023
+ else if (types[i$5] === Types$5.JSON) values.push(JSON.parse(packet.readLengthCodedString(encoding)));
17024
+ if (types[i$5] === Types$5.NULL) values.push(null);
17016
17025
  }
17017
17026
  return {
17018
17027
  stmtId,
@@ -17021,27 +17030,28 @@ var require_execute$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules
17021
17030
  values
17022
17031
  };
17023
17032
  }
17024
- toPacket() {
17025
- let length = 14;
17026
- let parameters;
17027
- if (this.parameters && this.parameters.length > 0) {
17028
- length += Math.floor((this.parameters.length + 7) / 8);
17029
- length += 1;
17030
- length += 2 * this.parameters.length;
17031
- parameters = this.parameters.map((value) => toParameter(value, this.encoding, this.timezone));
17032
- length += parameters.reduce((accumulator, parameter) => accumulator + parameter.length, 0);
17033
- }
17034
- const packet = new Packet$11(0, Buffer.allocUnsafe(length), 0, length);
17033
+ _serializeToBuffer(buffer$1) {
17034
+ const useQueryAttributes = this.clientFlags & ClientConstants$8.CLIENT_QUERY_ATTRIBUTES;
17035
+ const attrNames = useQueryAttributes && this.attributes ? Object.keys(this.attributes) : [];
17036
+ const numParams = this.parameters ? this.parameters.length : 0;
17037
+ const totalParams = numParams + attrNames.length;
17038
+ const packet = new Packet$12(0, buffer$1, 0, buffer$1.length);
17035
17039
  packet.offset = 4;
17036
- packet.writeInt8(CommandCodes$2.STMT_EXECUTE);
17040
+ packet.writeInt8(CommandCodes$3.STMT_EXECUTE);
17037
17041
  packet.writeInt32(this.id);
17038
- packet.writeInt8(CursorType.NO_CURSOR);
17042
+ let cursorFlags = CursorType.NO_CURSOR;
17043
+ if (useQueryAttributes) cursorFlags |= CursorType.PARAMETER_COUNT_AVAILABLE;
17044
+ packet.writeInt8(cursorFlags);
17039
17045
  packet.writeInt32(1);
17040
- if (parameters) {
17046
+ if (useQueryAttributes) packet.writeLengthCodedNumber(totalParams);
17047
+ if (totalParams > 0) {
17048
+ const bindParams = numParams > 0 ? this.parameters.map((v) => toParameter$1(v, this.encoding, this.timezone)) : [];
17049
+ const attrParams = attrNames.map((name) => toParameter$1(this.attributes[name], this.encoding, this.timezone));
17050
+ const allParams = bindParams.concat(attrParams);
17041
17051
  let bitmap = 0;
17042
17052
  let bitValue = 1;
17043
- parameters.forEach((parameter) => {
17044
- if (parameter.type === Types$4.NULL) bitmap += bitValue;
17053
+ allParams.forEach((parameter) => {
17054
+ if (parameter.type === Types$5.NULL) bitmap += bitValue;
17045
17055
  bitValue *= 2;
17046
17056
  if (bitValue === 256) {
17047
17057
  packet.writeInt8(bitmap);
@@ -17051,16 +17061,24 @@ var require_execute$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules
17051
17061
  });
17052
17062
  if (bitValue !== 1) packet.writeInt8(bitmap);
17053
17063
  packet.writeInt8(1);
17054
- parameters.forEach((parameter) => {
17055
- packet.writeInt8(parameter.type);
17064
+ for (let i$4 = 0; i$4 < allParams.length; i$4++) {
17065
+ packet.writeInt8(allParams[i$4].type);
17056
17066
  packet.writeInt8(0);
17057
- });
17058
- parameters.forEach((parameter) => {
17059
- if (parameter.type !== Types$4.NULL) parameter.writer.call(packet, parameter.value);
17067
+ if (useQueryAttributes) {
17068
+ const name = i$4 < numParams ? "" : attrNames[i$4 - numParams];
17069
+ packet.writeLengthCodedString(name, this.encoding);
17070
+ }
17071
+ }
17072
+ allParams.forEach((parameter) => {
17073
+ if (parameter.type !== Types$5.NULL) parameter.writer.call(packet, parameter.value);
17060
17074
  });
17061
17075
  }
17062
17076
  return packet;
17063
17077
  }
17078
+ toPacket() {
17079
+ const p = this._serializeToBuffer(Packet$12.MockBuffer());
17080
+ return this._serializeToBuffer(Buffer.allocUnsafe(p.offset));
17081
+ }
17064
17082
  };
17065
17083
  module.exports = Execute$3;
17066
17084
  }) });
@@ -17068,8 +17086,8 @@ var require_execute$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules
17068
17086
  //#endregion
17069
17087
  //#region node_modules/mysql2/lib/packets/handshake.js
17070
17088
  var require_handshake = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/packets/handshake.js": ((exports, module) => {
17071
- const Packet$10 = require_packet();
17072
- const ClientConstants$6 = require_client();
17089
+ const Packet$11 = require_packet();
17090
+ const ClientConstants$7 = require_client();
17073
17091
  var Handshake = class Handshake {
17074
17092
  constructor(args) {
17075
17093
  this.protocolVersion = args.protocolVersion;
@@ -17095,7 +17113,7 @@ var require_handshake = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules
17095
17113
  }
17096
17114
  toPacket(sequenceId) {
17097
17115
  const length = 68 + Buffer.byteLength(this.serverVersion, "utf8");
17098
- const packet = new Packet$10(sequenceId, Buffer.alloc(length + 4, 0), 0, length + 4);
17116
+ const packet = new Packet$11(sequenceId, Buffer.alloc(length + 4, 0), 0, length + 4);
17099
17117
  packet.offset = 4;
17100
17118
  packet.writeInt8(this.protocolVersion);
17101
17119
  packet.writeString(this.serverVersion, "cesu8");
@@ -17133,14 +17151,14 @@ var require_handshake = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules
17133
17151
  capabilityFlagsBuffer[2] = packet.readInt8();
17134
17152
  capabilityFlagsBuffer[3] = packet.readInt8();
17135
17153
  args.capabilityFlags = capabilityFlagsBuffer.readUInt32LE(0);
17136
- if (args.capabilityFlags & ClientConstants$6.PLUGIN_AUTH) args.authPluginDataLength = packet.readInt8();
17154
+ if (args.capabilityFlags & ClientConstants$7.PLUGIN_AUTH) args.authPluginDataLength = packet.readInt8();
17137
17155
  else {
17138
17156
  args.authPluginDataLength = 0;
17139
17157
  packet.skip(1);
17140
17158
  }
17141
17159
  packet.skip(10);
17142
17160
  } else args.capabilityFlags = capabilityFlagsBuffer.readUInt16LE(0);
17143
- if (args.capabilityFlags & ClientConstants$6.SECURE_CONNECTION) {
17161
+ if (args.capabilityFlags & ClientConstants$7.SECURE_CONNECTION) {
17144
17162
  const authPluginDataLength = args.authPluginDataLength;
17145
17163
  if (authPluginDataLength === 0) {
17146
17164
  args.authPluginDataLength = 20;
@@ -17151,7 +17169,7 @@ var require_handshake = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules
17151
17169
  args.authPluginData2 = packet.readBuffer(len);
17152
17170
  }
17153
17171
  }
17154
- if (args.capabilityFlags & ClientConstants$6.PLUGIN_AUTH) args.authPluginName = packet.readNullTerminatedString("ascii");
17172
+ if (args.capabilityFlags & ClientConstants$7.PLUGIN_AUTH) args.authPluginName = packet.readNullTerminatedString("ascii");
17155
17173
  return new Handshake(args);
17156
17174
  }
17157
17175
  };
@@ -17161,9 +17179,9 @@ var require_handshake = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules
17161
17179
  //#endregion
17162
17180
  //#region node_modules/mysql2/lib/packets/handshake_response.js
17163
17181
  var require_handshake_response = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/packets/handshake_response.js": ((exports, module) => {
17164
- const ClientConstants$5 = require_client();
17182
+ const ClientConstants$6 = require_client();
17165
17183
  const CharsetToEncoding$5 = require_charset_encodings();
17166
- const Packet$9 = require_packet();
17184
+ const Packet$10 = require_packet();
17167
17185
  const auth41$2 = require_auth_41();
17168
17186
  var HandshakeResponse = class {
17169
17187
  constructor(handshake) {
@@ -17192,8 +17210,8 @@ var require_handshake_response = /* @__PURE__ */ require_chunk.__commonJS({ "nod
17192
17210
  this.connectAttributes = handshake.connectAttributes;
17193
17211
  }
17194
17212
  serializeResponse(buffer$1) {
17195
- const isSet = (flag) => this.clientFlags & ClientConstants$5[flag];
17196
- const packet = new Packet$9(0, buffer$1, 0, buffer$1.length);
17213
+ const isSet = (flag) => this.clientFlags & ClientConstants$6[flag];
17214
+ const packet = new Packet$10(0, buffer$1, 0, buffer$1.length);
17197
17215
  packet.offset = 4;
17198
17216
  packet.writeInt32(this.clientFlags);
17199
17217
  packet.writeInt32(0);
@@ -17219,8 +17237,8 @@ var require_handshake_response = /* @__PURE__ */ require_chunk.__commonJS({ "nod
17219
17237
  const attrNames = Object.keys(connectAttributes);
17220
17238
  let keysLength = 0;
17221
17239
  for (k = 0; k < attrNames.length; ++k) {
17222
- keysLength += Packet$9.lengthCodedStringLength(attrNames[k], encoding);
17223
- keysLength += Packet$9.lengthCodedStringLength(connectAttributes[attrNames[k]], encoding);
17240
+ keysLength += Packet$10.lengthCodedStringLength(attrNames[k], encoding);
17241
+ keysLength += Packet$10.lengthCodedStringLength(connectAttributes[attrNames[k]], encoding);
17224
17242
  }
17225
17243
  packet.writeLengthCodedNumber(keysLength);
17226
17244
  for (k = 0; k < attrNames.length; ++k) {
@@ -17233,14 +17251,14 @@ var require_handshake_response = /* @__PURE__ */ require_chunk.__commonJS({ "nod
17233
17251
  toPacket() {
17234
17252
  if (typeof this.user !== "string") throw new Error("\"user\" connection config property must be a string");
17235
17253
  if (typeof this.database !== "string") throw new Error("\"database\" connection config property must be a string");
17236
- const p = this.serializeResponse(Packet$9.MockBuffer());
17254
+ const p = this.serializeResponse(Packet$10.MockBuffer());
17237
17255
  return this.serializeResponse(Buffer.alloc(p.offset));
17238
17256
  }
17239
- static fromPacket(packet) {
17257
+ static fromPacket(packet, serverFlags = 4294967295) {
17240
17258
  const args = {};
17241
17259
  args.clientFlags = packet.readInt32();
17242
17260
  function isSet(flag) {
17243
- return args.clientFlags & ClientConstants$5[flag];
17261
+ return args.clientFlags & serverFlags & ClientConstants$6[flag];
17244
17262
  }
17245
17263
  args.maxPacketSize = packet.readInt32();
17246
17264
  args.charsetNumber = packet.readInt8();
@@ -17274,8 +17292,8 @@ var require_handshake_response = /* @__PURE__ */ require_chunk.__commonJS({ "nod
17274
17292
  //#endregion
17275
17293
  //#region node_modules/mysql2/lib/packets/prepare_statement.js
17276
17294
  var require_prepare_statement = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/packets/prepare_statement.js": ((exports, module) => {
17277
- const Packet$8 = require_packet();
17278
- const CommandCodes$1 = require_commands$1();
17295
+ const Packet$9 = require_packet();
17296
+ const CommandCodes$2 = require_commands$1();
17279
17297
  const StringParser$1 = require_string();
17280
17298
  const CharsetToEncoding$4 = require_charset_encodings();
17281
17299
  var PrepareStatement = class {
@@ -17287,9 +17305,9 @@ var require_prepare_statement = /* @__PURE__ */ require_chunk.__commonJS({ "node
17287
17305
  toPacket() {
17288
17306
  const buf = StringParser$1.encode(this.query, this.encoding);
17289
17307
  const length = 5 + buf.length;
17290
- const packet = new Packet$8(0, Buffer.allocUnsafe(length), 0, length);
17308
+ const packet = new Packet$9(0, Buffer.allocUnsafe(length), 0, length);
17291
17309
  packet.offset = 4;
17292
- packet.writeInt8(CommandCodes$1.STMT_PREPARE);
17310
+ packet.writeInt8(CommandCodes$2.STMT_PREPARE);
17293
17311
  packet.writeBuffer(buf);
17294
17312
  return packet;
17295
17313
  }
@@ -17316,25 +17334,74 @@ var require_prepared_statement_header = /* @__PURE__ */ require_chunk.__commonJS
17316
17334
  //#endregion
17317
17335
  //#region node_modules/mysql2/lib/packets/query.js
17318
17336
  var require_query$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/packets/query.js": ((exports, module) => {
17319
- const Packet$7 = require_packet();
17337
+ const Packet$8 = require_packet();
17320
17338
  const CommandCode$3 = require_commands$1();
17321
17339
  const StringParser = require_string();
17322
17340
  const CharsetToEncoding$3 = require_charset_encodings();
17341
+ const ClientConstants$5 = require_client();
17342
+ const Types$4 = require_types();
17343
+ const { toParameter } = require_encode_parameter();
17323
17344
  var Query$3 = class {
17324
- constructor(sql, charsetNumber) {
17345
+ constructor(sql, charsetNumber, attributes, clientFlags) {
17325
17346
  this.query = sql;
17326
17347
  this.charsetNumber = charsetNumber;
17327
17348
  this.encoding = CharsetToEncoding$3[charsetNumber];
17349
+ this.attributes = attributes;
17350
+ this.clientFlags = clientFlags || 0;
17328
17351
  }
17329
- toPacket() {
17330
- const buf = StringParser.encode(this.query, this.encoding);
17331
- const length = 5 + buf.length;
17332
- const packet = new Packet$7(0, Buffer.allocUnsafe(length), 0, length);
17352
+ serializeToBuffer(buffer$1) {
17353
+ const useQueryAttributes = this.clientFlags & ClientConstants$5.CLIENT_QUERY_ATTRIBUTES;
17354
+ const sqlBuf = StringParser.encode(this.query, this.encoding);
17355
+ const packet = new Packet$8(0, buffer$1, 0, buffer$1.length);
17333
17356
  packet.offset = 4;
17334
17357
  packet.writeInt8(CommandCode$3.QUERY);
17335
- packet.writeBuffer(buf);
17358
+ if (useQueryAttributes) {
17359
+ const attrs = this.attributes;
17360
+ const names = attrs ? Object.keys(attrs) : [];
17361
+ const paramCount = names.length;
17362
+ packet.writeLengthCodedNumber(paramCount);
17363
+ packet.writeLengthCodedNumber(1);
17364
+ if (paramCount > 0) {
17365
+ const parameters = names.map((name) => toParameter(attrs[name], this.encoding, "local"));
17366
+ let bitmap = 0;
17367
+ let bitValue = 1;
17368
+ parameters.forEach((parameter) => {
17369
+ if (parameter.type === Types$4.NULL) bitmap += bitValue;
17370
+ bitValue *= 2;
17371
+ if (bitValue === 256) {
17372
+ packet.writeInt8(bitmap);
17373
+ bitmap = 0;
17374
+ bitValue = 1;
17375
+ }
17376
+ });
17377
+ if (bitValue !== 1) packet.writeInt8(bitmap);
17378
+ packet.writeInt8(1);
17379
+ for (let i$4 = 0; i$4 < paramCount; i$4++) {
17380
+ packet.writeInt8(parameters[i$4].type);
17381
+ packet.writeInt8(0);
17382
+ packet.writeLengthCodedString(names[i$4], this.encoding);
17383
+ }
17384
+ parameters.forEach((parameter) => {
17385
+ if (parameter.type !== Types$4.NULL) parameter.writer.call(packet, parameter.value);
17386
+ });
17387
+ }
17388
+ }
17389
+ packet.writeBuffer(sqlBuf);
17336
17390
  return packet;
17337
17391
  }
17392
+ toPacket() {
17393
+ if (!(this.clientFlags & ClientConstants$5.CLIENT_QUERY_ATTRIBUTES)) {
17394
+ const buf = StringParser.encode(this.query, this.encoding);
17395
+ const length = 5 + buf.length;
17396
+ const packet = new Packet$8(0, Buffer.allocUnsafe(length), 0, length);
17397
+ packet.offset = 4;
17398
+ packet.writeInt8(CommandCode$3.QUERY);
17399
+ packet.writeBuffer(buf);
17400
+ return packet;
17401
+ }
17402
+ const p = this.serializeToBuffer(Packet$8.MockBuffer());
17403
+ return this.serializeToBuffer(Buffer.allocUnsafe(p.offset));
17404
+ }
17338
17405
  };
17339
17406
  module.exports = Query$3;
17340
17407
  }) });
@@ -17342,8 +17409,8 @@ var require_query$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/m
17342
17409
  //#endregion
17343
17410
  //#region node_modules/mysql2/lib/packets/register_slave.js
17344
17411
  var require_register_slave$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/packets/register_slave.js": ((exports, module) => {
17345
- const Packet$6 = require_packet();
17346
- const CommandCodes = require_commands$1();
17412
+ const Packet$7 = require_packet();
17413
+ const CommandCodes$1 = require_commands$1();
17347
17414
  var RegisterSlave$2 = class {
17348
17415
  constructor(opts) {
17349
17416
  this.serverId = opts.serverId || 0;
@@ -17356,9 +17423,9 @@ var require_register_slave$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_
17356
17423
  }
17357
17424
  toPacket() {
17358
17425
  const length = 15 + Buffer.byteLength(this.slaveHostname, "utf8") + Buffer.byteLength(this.slaveUser, "utf8") + Buffer.byteLength(this.slavePassword, "utf8") + 3 + 4;
17359
- const packet = new Packet$6(0, Buffer.allocUnsafe(length), 0, length);
17426
+ const packet = new Packet$7(0, Buffer.allocUnsafe(length), 0, length);
17360
17427
  packet.offset = 4;
17361
- packet.writeInt8(CommandCodes.REGISTER_SLAVE);
17428
+ packet.writeInt8(CommandCodes$1.REGISTER_SLAVE);
17362
17429
  packet.writeInt32(this.serverId);
17363
17430
  packet.writeInt8(Buffer.byteLength(this.slaveHostname, "utf8"));
17364
17431
  packet.writeString(this.slaveHostname);
@@ -17375,6 +17442,23 @@ var require_register_slave$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_
17375
17442
  module.exports = RegisterSlave$2;
17376
17443
  }) });
17377
17444
 
17445
+ //#endregion
17446
+ //#region node_modules/mysql2/lib/packets/reset_connection.js
17447
+ var require_reset_connection$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/packets/reset_connection.js": ((exports, module) => {
17448
+ const Packet$6 = require_packet();
17449
+ const CommandCodes = require_commands$1();
17450
+ var ResetConnection$2 = class {
17451
+ constructor() {}
17452
+ toPacket() {
17453
+ const packet = new Packet$6(0, Buffer.alloc(5), 0, 5);
17454
+ packet.offset = 4;
17455
+ packet.writeInt8(CommandCodes.RESET_CONNECTION);
17456
+ return packet;
17457
+ }
17458
+ };
17459
+ module.exports = ResetConnection$2;
17460
+ }) });
17461
+
17378
17462
  //#endregion
17379
17463
  //#region node_modules/mysql2/lib/constants/server_status.js
17380
17464
  var require_server_status = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/constants/server_status.js": ((exports) => {
@@ -17513,7 +17597,7 @@ var require_resultset_header = /* @__PURE__ */ require_chunk.__commonJS({ "node_
17513
17597
  let stateChanges = null;
17514
17598
  if (isSet("SESSION_TRACK") && packet.offset < packet.end) {
17515
17599
  this.info = packet.readLengthCodedString(encoding);
17516
- if (this.serverStatus && ServerSatusFlags.SERVER_SESSION_STATE_CHANGED) {
17600
+ if (this.serverStatus & ServerSatusFlags.SERVER_SESSION_STATE_CHANGED) {
17517
17601
  let len = packet.offset < packet.end ? packet.readLengthCodedNumber() : 0;
17518
17602
  const end = packet.offset + len;
17519
17603
  let type, key$1, stateEnd;
@@ -17653,6 +17737,7 @@ var require_packets = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/m
17653
17737
  PreparedStatementHeader: require_prepared_statement_header(),
17654
17738
  Query: require_query$1(),
17655
17739
  RegisterSlave: require_register_slave$1(),
17740
+ ResetConnection: require_reset_connection$1(),
17656
17741
  ResultSetHeader: require_resultset_header(),
17657
17742
  SSLRequest: require_ssl_request(),
17658
17743
  TextRow: require_text_row()
@@ -17741,7 +17826,7 @@ var require_packets = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/m
17741
17826
  var require_command = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/commands/command.js": ((exports, module) => {
17742
17827
  const EventEmitter$6 = require("events").EventEmitter;
17743
17828
  const Timers$2 = require("timers");
17744
- var Command$11 = class extends EventEmitter$6 {
17829
+ var Command$12 = class extends EventEmitter$6 {
17745
17830
  constructor() {
17746
17831
  super();
17747
17832
  this.next = null;
@@ -17778,7 +17863,7 @@ var require_command = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/m
17778
17863
  return true;
17779
17864
  }
17780
17865
  };
17781
- module.exports = Command$11;
17866
+ module.exports = Command$12;
17782
17867
  }) });
17783
17868
 
17784
17869
  //#endregion
@@ -17936,7 +18021,7 @@ var require_mysql_clear_password = /* @__PURE__ */ require_chunk.__commonJS({ "n
17936
18021
  //#endregion
17937
18022
  //#region node_modules/mysql2/lib/commands/auth_switch.js
17938
18023
  var require_auth_switch = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/commands/auth_switch.js": ((exports, module) => {
17939
- const Packets$10 = require_packets();
18024
+ const Packets$11 = require_packets();
17940
18025
  const sha256_password = require_sha256_password();
17941
18026
  const caching_sha2_password = require_caching_sha2_password();
17942
18027
  const mysql_native_password = require_mysql_native_password();
@@ -17961,7 +18046,7 @@ var require_auth_switch = /* @__PURE__ */ require_chunk.__commonJS({ "node_modul
17961
18046
  command.emit("error", error);
17962
18047
  }
17963
18048
  function authSwitchRequest(packet, connection, command) {
17964
- const { pluginName, pluginData } = Packets$10.AuthSwitchRequest.fromPacket(packet);
18049
+ const { pluginName, pluginData } = Packets$11.AuthSwitchRequest.fromPacket(packet);
17965
18050
  if (connection.config.authSwitchHandler && pluginName !== "mysql_native_password") {
17966
18051
  const legacySwitchHandler = connection.config.authSwitchHandler;
17967
18052
  warnLegacyAuthSwitch();
@@ -17970,10 +18055,18 @@ var require_auth_switch = /* @__PURE__ */ require_chunk.__commonJS({ "node_modul
17970
18055
  pluginData
17971
18056
  }, (err, data) => {
17972
18057
  if (err) return authSwitchPluginError(err, command);
17973
- connection.writePacket(new Packets$10.AuthSwitchResponse(data).toPacket());
18058
+ connection.writePacket(new Packets$11.AuthSwitchResponse(data).toPacket());
17974
18059
  });
17975
18060
  return;
17976
18061
  }
18062
+ if (pluginName === "mysql_clear_password") {
18063
+ if (!(connection.config.authPlugins && Object.prototype.hasOwnProperty.call(connection.config.authPlugins, "mysql_clear_password")) && !connection.config.enableCleartextPlugin) {
18064
+ const err = /* @__PURE__ */ new Error("Server requested authentication using mysql_clear_password, which sends the password in plaintext over the network and is disabled by default. To enable it, set the `enableCleartextPlugin` option to `true` in your connection configuration, or provide a custom `mysql_clear_password` auth plugin via the `authPlugins` option. Only use this over a secure connection (TLS/SSL).");
18065
+ err.code = "MYSQL_CLEAR_PASSWORD_NOT_ENABLED";
18066
+ err.fatal = true;
18067
+ throw err;
18068
+ }
18069
+ }
17977
18070
  const authPlugin = getAuthPlugin$1(pluginName, connection);
17978
18071
  if (!authPlugin) throw new Error(`Server requests authentication using unknown plugin ${pluginName}. See TODO: add plugins doco here on how to configure or author authentication plugins.`);
17979
18072
  connection._authPlugin = authPlugin({
@@ -17981,25 +18074,25 @@ var require_auth_switch = /* @__PURE__ */ require_chunk.__commonJS({ "node_modul
17981
18074
  command
17982
18075
  });
17983
18076
  Promise.resolve(connection._authPlugin(pluginData)).then((data) => {
17984
- if (data) connection.writePacket(new Packets$10.AuthSwitchResponse(data).toPacket());
18077
+ if (data) connection.writePacket(new Packets$11.AuthSwitchResponse(data).toPacket());
17985
18078
  }).catch((err) => {
17986
18079
  authSwitchPluginError(err, command);
17987
18080
  });
17988
18081
  }
17989
18082
  function authSwitchRequestMoreData(packet, connection, command) {
17990
- const { data } = Packets$10.AuthSwitchRequestMoreData.fromPacket(packet);
18083
+ const { data } = Packets$11.AuthSwitchRequestMoreData.fromPacket(packet);
17991
18084
  if (connection.config.authSwitchHandler) {
17992
18085
  const legacySwitchHandler = connection.config.authSwitchHandler;
17993
18086
  warnLegacyAuthSwitch();
17994
18087
  legacySwitchHandler({ pluginData: data }, (err, data$1) => {
17995
18088
  if (err) return authSwitchPluginError(err, command);
17996
- connection.writePacket(new Packets$10.AuthSwitchResponse(data$1).toPacket());
18089
+ connection.writePacket(new Packets$11.AuthSwitchResponse(data$1).toPacket());
17997
18090
  });
17998
18091
  return;
17999
18092
  }
18000
18093
  if (!connection._authPlugin) throw new Error("AuthPluginMoreData received but no auth plugin instance found");
18001
18094
  Promise.resolve(connection._authPlugin(data)).then((data$1) => {
18002
- if (data$1) connection.writePacket(new Packets$10.AuthSwitchResponse(data$1).toPacket());
18095
+ if (data$1) connection.writePacket(new Packets$11.AuthSwitchResponse(data$1).toPacket());
18003
18096
  }).catch((err) => {
18004
18097
  authSwitchPluginError(err, command);
18005
18098
  });
@@ -18127,8 +18220,8 @@ var require_compressed_protocol = /* @__PURE__ */ require_chunk.__commonJS({ "no
18127
18220
  //#endregion
18128
18221
  //#region node_modules/mysql2/lib/commands/client_handshake.js
18129
18222
  var require_client_handshake = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/commands/client_handshake.js": ((exports, module) => {
18130
- const Command$10 = require_command();
18131
- const Packets$9 = require_packets();
18223
+ const Command$11 = require_command();
18224
+ const Packets$10 = require_packets();
18132
18225
  const ClientConstants$2 = require_client();
18133
18226
  const CharsetToEncoding$2 = require_charset_encodings();
18134
18227
  const auth41 = require_auth_41();
@@ -18139,7 +18232,7 @@ var require_client_handshake = /* @__PURE__ */ require_chunk.__commonJS({ "node_
18139
18232
  for (const c in ClientConstants$2) if (flags & ClientConstants$2[c]) res.push(c.replace(/_/g, " ").toLowerCase());
18140
18233
  return res;
18141
18234
  }
18142
- var ClientHandshake$2 = class ClientHandshake$2 extends Command$10 {
18235
+ var ClientHandshake$2 = class ClientHandshake$2 extends Command$11 {
18143
18236
  constructor(clientFlags) {
18144
18237
  super();
18145
18238
  this.handshake = null;
@@ -18150,7 +18243,7 @@ var require_client_handshake = /* @__PURE__ */ require_chunk.__commonJS({ "node_
18150
18243
  return ClientHandshake$2.prototype.handshakeInit;
18151
18244
  }
18152
18245
  sendSSLRequest(connection) {
18153
- const sslRequest = new Packets$9.SSLRequest(this.clientFlags, connection.config.charsetNumber);
18246
+ const sslRequest = new Packets$10.SSLRequest(this.clientFlags, connection.config.charsetNumber);
18154
18247
  connection.writePacket(sslRequest.toPacket());
18155
18248
  }
18156
18249
  sendCredentials(connection) {
@@ -18168,10 +18261,10 @@ var require_client_handshake = /* @__PURE__ */ require_chunk.__commonJS({ "node_
18168
18261
  const authPluginData = this.handshake.authPluginData1 && this.handshake.authPluginData2 ? Buffer.concat([this.handshake.authPluginData1, this.handshake.authPluginData2]).slice(0, 20) : Buffer.alloc(20);
18169
18262
  const hasCustomAuthPlugin = connection.config.authPlugins && Object.prototype.hasOwnProperty.call(connection.config.authPlugins, serverAuthMethod);
18170
18263
  const hasLegacyAuthSwitchHandler = typeof connection.config.authSwitchHandler === "function";
18171
- const clientAuthMethod = !hasCustomAuthPlugin && !hasLegacyAuthSwitchHandler && this.canUseAuthMethodDirectly(serverAuthMethod, isSecureConnection) ? serverAuthMethod : "mysql_native_password";
18264
+ const clientAuthMethod = !hasCustomAuthPlugin && !hasLegacyAuthSwitchHandler && this.canUseAuthMethodDirectly(serverAuthMethod, isSecureConnection) && (serverAuthMethod !== "mysql_clear_password" || connection.config.enableCleartextPlugin) ? serverAuthMethod : "mysql_native_password";
18172
18265
  const authToken = this.calculateAuthToken(clientAuthMethod, this.password, authPluginData);
18173
18266
  if (connection.config.debug) console.log("Server auth method: %s, Using auth method: %s", serverAuthMethod, clientAuthMethod);
18174
- const handshakeResponse = new Packets$9.HandshakeResponse({
18267
+ const handshakeResponse = new Packets$10.HandshakeResponse({
18175
18268
  flags: this.clientFlags,
18176
18269
  user: this.user,
18177
18270
  database: this.database,
@@ -18238,7 +18331,7 @@ var require_client_handshake = /* @__PURE__ */ require_chunk.__commonJS({ "node_
18238
18331
  connection._fatalError = e;
18239
18332
  connection._protocolError = e;
18240
18333
  });
18241
- this.handshake = Packets$9.Handshake.fromPacket(helloPacket);
18334
+ this.handshake = Packets$10.Handshake.fromPacket(helloPacket);
18242
18335
  if (connection.config.debug) console.log("Server hello packet: capability flags:%d=(%s)", this.handshake.capabilityFlags, flagNames(this.handshake.capabilityFlags).join(", "));
18243
18336
  connection.serverCapabilityFlags = this.handshake.capabilityFlags;
18244
18337
  connection.serverEncoding = CharsetToEncoding$2[this.handshake.characterSet];
@@ -18286,7 +18379,7 @@ var require_client_handshake = /* @__PURE__ */ require_chunk.__commonJS({ "node_
18286
18379
  }
18287
18380
  return ClientHandshake$2.prototype.handshakeResult;
18288
18381
  } catch (err) {
18289
- err.code = "AUTH_SWITCH_PLUGIN_ERROR";
18382
+ if (!err.code) err.code = "AUTH_SWITCH_PLUGIN_ERROR";
18290
18383
  err.fatal = true;
18291
18384
  if (this.onResult) this.onResult(err);
18292
18385
  else this.emit("error", err);
@@ -18320,15 +18413,15 @@ var require_client_handshake = /* @__PURE__ */ require_chunk.__commonJS({ "node_
18320
18413
  var require_server_handshake = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/commands/server_handshake.js": ((exports, module) => {
18321
18414
  const CommandCode$2 = require_commands$1();
18322
18415
  const Errors$1 = require_errors();
18323
- const Command$9 = require_command();
18324
- const Packets$8 = require_packets();
18325
- var ServerHandshake$1 = class ServerHandshake$1 extends Command$9 {
18416
+ const Command$10 = require_command();
18417
+ const Packets$9 = require_packets();
18418
+ var ServerHandshake$1 = class ServerHandshake$1 extends Command$10 {
18326
18419
  constructor(args) {
18327
18420
  super();
18328
18421
  this.args = args;
18329
18422
  }
18330
18423
  start(packet, connection) {
18331
- const serverHelloPacket = new Packets$8.Handshake(this.args);
18424
+ const serverHelloPacket = new Packets$9.Handshake(this.args);
18332
18425
  this.serverHello = serverHelloPacket;
18333
18426
  serverHelloPacket.setScrambleData((err) => {
18334
18427
  if (err) {
@@ -18340,7 +18433,7 @@ var require_server_handshake = /* @__PURE__ */ require_chunk.__commonJS({ "node_
18340
18433
  return ServerHandshake$1.prototype.readClientReply;
18341
18434
  }
18342
18435
  readClientReply(packet, connection) {
18343
- const clientHelloReply = Packets$8.HandshakeResponse.fromPacket(packet);
18436
+ const clientHelloReply = Packets$9.HandshakeResponse.fromPacket(packet, this.args.capabilityFlags);
18344
18437
  connection.clientHelloReply = clientHelloReply;
18345
18438
  if (this.args.authCallback) this.args.authCallback({
18346
18439
  user: clientHelloReply.user,
@@ -18381,7 +18474,7 @@ var require_server_handshake = /* @__PURE__ */ require_chunk.__commonJS({ "node_
18381
18474
  break;
18382
18475
  case CommandCode$2.STMT_EXECUTE:
18383
18476
  if (connection.listeners("stmt_execute").length) {
18384
- const { stmtId, flags, iterationCount, values } = Packets$8.Execute.fromPacket(packet, encoding);
18477
+ const { stmtId, flags, iterationCount, values } = Packets$9.Execute.fromPacket(packet, encoding);
18385
18478
  connection.emit("stmt_execute", stmtId, flags, iterationCount, values);
18386
18479
  } else connection.writeError({
18387
18480
  code: Errors$1.HA_ERR_INTERNAL_ERROR,
@@ -18782,8 +18875,8 @@ var require_helpers = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/m
18782
18875
  /**
18783
18876
  * checks whether the `type` is in the `list`
18784
18877
  */
18785
- function typeMatch(type, list, Types$7) {
18786
- if (Array.isArray(list)) return list.some((t) => type === Types$7[t]);
18878
+ function typeMatch(type, list, Types$9) {
18879
+ if (Array.isArray(list)) return list.some((t) => type === Types$9[t]);
18787
18880
  return !!list;
18788
18881
  }
18789
18882
  exports.typeMatch = typeMatch;
@@ -19186,13 +19279,13 @@ var require_query = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mys
19186
19279
  const process$4 = require("process");
19187
19280
  const Timers$1 = require("timers");
19188
19281
  const Readable$1 = require("stream").Readable;
19189
- const Command$8 = require_command();
19190
- const Packets$7 = require_packets();
19282
+ const Command$9 = require_command();
19283
+ const Packets$8 = require_packets();
19191
19284
  const getTextParser = require_text_parser();
19192
19285
  const staticParser = require_static_text_parser();
19193
19286
  const ServerStatus = require_server_status();
19194
- const EmptyPacket = new Packets$7.Packet(0, Buffer.allocUnsafe(4), 0, 4);
19195
- var Query$2 = class Query$2 extends Command$8 {
19287
+ const EmptyPacket = new Packets$8.Packet(0, Buffer.allocUnsafe(4), 0, 4);
19288
+ var Query$2 = class Query$2 extends Command$9 {
19196
19289
  constructor(options, callback) {
19197
19290
  super();
19198
19291
  this.sql = options.sql;
@@ -19223,7 +19316,8 @@ var require_query = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mys
19223
19316
  this._connection = connection;
19224
19317
  this.options = Object.assign({}, connection.config, this._queryOptions);
19225
19318
  this._setTimeout();
19226
- const cmdPacket = new Packets$7.Query(this.sql, connection.config.charsetNumber);
19319
+ const clientFlags = connection.config.clientFlags & (connection.serverCapabilityFlags || 0);
19320
+ const cmdPacket = new Packets$8.Query(this.sql, connection.config.charsetNumber, this._queryOptions.attributes, clientFlags);
19227
19321
  connection.writePacket(cmdPacket.toPacket(1));
19228
19322
  return Query$2.prototype.resultsetHeader;
19229
19323
  }
@@ -19269,7 +19363,7 @@ var require_query = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mys
19269
19363
  return this.done();
19270
19364
  }
19271
19365
  resultsetHeader(packet, connection) {
19272
- const rs = new Packets$7.ResultSetHeader(packet, connection);
19366
+ const rs = new Packets$8.ResultSetHeader(packet, connection);
19273
19367
  this._fieldCount = rs.fieldCount;
19274
19368
  if (connection.config.debug) console.log(` Resultset header received, expecting ${rs.fieldCount} column definition packets`);
19275
19369
  if (this._fieldCount === 0) return this.doneInsert(rs);
@@ -19298,7 +19392,7 @@ var require_query = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mys
19298
19392
  const onData = function(data) {
19299
19393
  const dataWithHeader = Buffer.allocUnsafe(data.length + 4);
19300
19394
  data.copy(dataWithHeader, 4);
19301
- connection.writePacket(new Packets$7.Packet(0, dataWithHeader, 0, dataWithHeader.length));
19395
+ connection.writePacket(new Packets$8.Packet(0, dataWithHeader, 0, dataWithHeader.length));
19302
19396
  };
19303
19397
  const onEnd = () => {
19304
19398
  connection.removeListener("error", onConnectionError);
@@ -19327,7 +19421,7 @@ var require_query = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mys
19327
19421
  readField(packet, connection) {
19328
19422
  this._receivedFieldsCount++;
19329
19423
  if (this._fields[this._resultIndex].length !== this._fieldCount) {
19330
- const field = new Packets$7.ColumnDefinition(packet, connection.clientEncoding);
19424
+ const field = new Packets$8.ColumnDefinition(packet, connection.clientEncoding);
19331
19425
  this._fields[this._resultIndex].push(field);
19332
19426
  if (connection.config.debug) {
19333
19427
  console.log(" Column definition:");
@@ -19369,7 +19463,7 @@ var require_query = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mys
19369
19463
  return Query$2.prototype.row;
19370
19464
  }
19371
19465
  infileOk(packet, connection) {
19372
- const rs = new Packets$7.ResultSetHeader(packet, connection);
19466
+ const rs = new Packets$8.ResultSetHeader(packet, connection);
19373
19467
  return this.doneInsert(rs);
19374
19468
  }
19375
19469
  stream(options) {
@@ -19442,15 +19536,15 @@ var require_query = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mys
19442
19536
  //#endregion
19443
19537
  //#region node_modules/mysql2/lib/commands/close_statement.js
19444
19538
  var require_close_statement = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/commands/close_statement.js": ((exports, module) => {
19445
- const Command$7 = require_command();
19446
- const Packets$6 = require_packets();
19447
- var CloseStatement$2 = class extends Command$7 {
19539
+ const Command$8 = require_command();
19540
+ const Packets$7 = require_packets();
19541
+ var CloseStatement$2 = class extends Command$8 {
19448
19542
  constructor(id) {
19449
19543
  super();
19450
19544
  this.id = id;
19451
19545
  }
19452
19546
  start(packet, connection) {
19453
- connection.writePacket(new Packets$6.CloseStatement(this.id).toPacket(1));
19547
+ connection.writePacket(new Packets$7.CloseStatement(this.id).toPacket(1));
19454
19548
  return null;
19455
19549
  }
19456
19550
  };
@@ -19710,12 +19804,12 @@ var require_static_binary_parser = /* @__PURE__ */ require_chunk.__commonJS({ "n
19710
19804
  //#endregion
19711
19805
  //#region node_modules/mysql2/lib/commands/execute.js
19712
19806
  var require_execute = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/commands/execute.js": ((exports, module) => {
19713
- const Command$6 = require_command();
19807
+ const Command$7 = require_command();
19714
19808
  const Query$1 = require_query();
19715
- const Packets$5 = require_packets();
19809
+ const Packets$6 = require_packets();
19716
19810
  const getBinaryParser = require_binary_parser();
19717
19811
  const getStaticBinaryParser = require_static_binary_parser();
19718
- var Execute$2 = class Execute$2 extends Command$6 {
19812
+ var Execute$2 = class Execute$2 extends Command$7 {
19719
19813
  constructor(options, callback) {
19720
19814
  super();
19721
19815
  this.statement = options.statement;
@@ -19746,7 +19840,8 @@ var require_execute = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/m
19746
19840
  this._connection = connection;
19747
19841
  this.options = Object.assign({}, connection.config, this._executeOptions);
19748
19842
  this._setTimeout();
19749
- const executePacket = new Packets$5.Execute(this.statement.id, this.parameters, connection.config.charsetNumber, connection.config.timezone);
19843
+ const clientFlags = connection.config.clientFlags & (connection.serverCapabilityFlags || 0);
19844
+ const executePacket = new Packets$6.Execute(this.statement.id, this.parameters, connection.config.charsetNumber, connection.config.timezone, this._executeOptions.attributes, clientFlags);
19750
19845
  try {
19751
19846
  connection.writePacket(executePacket.toPacket(1));
19752
19847
  } catch (error) {
@@ -19756,7 +19851,7 @@ var require_execute = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/m
19756
19851
  }
19757
19852
  readField(packet, connection) {
19758
19853
  let fields$1;
19759
- const field = new Packets$5.ColumnDefinition(packet, connection.clientEncoding);
19854
+ const field = new Packets$6.ColumnDefinition(packet, connection.clientEncoding);
19760
19855
  this._receivedFieldsCount++;
19761
19856
  this._fields[this._resultIndex].push(field);
19762
19857
  if (this._receivedFieldsCount === this._fieldCount) {
@@ -19787,8 +19882,8 @@ var require_execute = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/m
19787
19882
  //#endregion
19788
19883
  //#region node_modules/mysql2/lib/commands/prepare.js
19789
19884
  var require_prepare = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/commands/prepare.js": ((exports, module) => {
19790
- const Packets$4 = require_packets();
19791
- const Command$5 = require_command();
19885
+ const Packets$5 = require_packets();
19886
+ const Command$6 = require_command();
19792
19887
  const CloseStatement$1 = require_close_statement();
19793
19888
  const Execute$1 = require_execute();
19794
19889
  var PreparedStatementInfo = class {
@@ -19814,7 +19909,7 @@ var require_prepare = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/m
19814
19909
  }, callback));
19815
19910
  }
19816
19911
  };
19817
- var Prepare$1 = class Prepare$1 extends Command$5 {
19912
+ var Prepare$1 = class Prepare$1 extends Command$6 {
19818
19913
  constructor(options, callback) {
19819
19914
  super();
19820
19915
  this.query = options.sql;
@@ -19833,12 +19928,12 @@ var require_prepare = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/m
19833
19928
  if (this.onResult) this.onResult(null, statement);
19834
19929
  return null;
19835
19930
  }
19836
- const cmdPacket = new Packets$4.PrepareStatement(this.query, connection.config.charsetNumber, this.options.values);
19931
+ const cmdPacket = new Packets$5.PrepareStatement(this.query, connection.config.charsetNumber, this.options.values);
19837
19932
  connection.writePacket(cmdPacket.toPacket(1));
19838
19933
  return Prepare$1.prototype.prepareHeader;
19839
19934
  }
19840
19935
  prepareHeader(packet, connection) {
19841
- const header = new Packets$4.PreparedStatementHeader(packet);
19936
+ const header = new Packets$5.PreparedStatementHeader(packet);
19842
19937
  this.id = header.id;
19843
19938
  this.fieldCount = header.fieldCount;
19844
19939
  this.parameterCount = header.parameterCount;
@@ -19851,14 +19946,14 @@ var require_prepare = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/m
19851
19946
  if (this.fieldCount > 0) return Prepare$1.prototype.readField;
19852
19947
  return this.prepareDone(connection);
19853
19948
  }
19854
- const def = new Packets$4.ColumnDefinition(packet, connection.clientEncoding);
19949
+ const def = new Packets$5.ColumnDefinition(packet, connection.clientEncoding);
19855
19950
  this.parameterDefinitions.push(def);
19856
19951
  if (this.parameterDefinitions.length === this.parameterCount) return Prepare$1.prototype.parametersEOF;
19857
19952
  return this.readParameter;
19858
19953
  }
19859
19954
  readField(packet, connection) {
19860
19955
  if (packet.isEOF()) return this.prepareDone(connection);
19861
- const def = new Packets$4.ColumnDefinition(packet, connection.clientEncoding);
19956
+ const def = new Packets$5.ColumnDefinition(packet, connection.clientEncoding);
19862
19957
  this.fields.push(def);
19863
19958
  if (this.fields.length === this.fieldCount) return Prepare$1.prototype.fieldsEOF;
19864
19959
  return Prepare$1.prototype.readField;
@@ -19885,10 +19980,10 @@ var require_prepare = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/m
19885
19980
  //#endregion
19886
19981
  //#region node_modules/mysql2/lib/commands/ping.js
19887
19982
  var require_ping = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/commands/ping.js": ((exports, module) => {
19888
- const Command$4 = require_command();
19983
+ const Command$5 = require_command();
19889
19984
  const CommandCode$1 = require_commands$1();
19890
19985
  const Packet$1 = require_packet();
19891
- var Ping$1 = class Ping$1 extends Command$4 {
19986
+ var Ping$1 = class Ping$1 extends Command$5 {
19892
19987
  constructor(callback) {
19893
19988
  super();
19894
19989
  this.onResult = callback;
@@ -19915,16 +20010,16 @@ var require_ping = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysq
19915
20010
  //#endregion
19916
20011
  //#region node_modules/mysql2/lib/commands/register_slave.js
19917
20012
  var require_register_slave = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/commands/register_slave.js": ((exports, module) => {
19918
- const Command$3 = require_command();
19919
- const Packets$3 = require_packets();
19920
- var RegisterSlave$1 = class RegisterSlave$1 extends Command$3 {
20013
+ const Command$4 = require_command();
20014
+ const Packets$4 = require_packets();
20015
+ var RegisterSlave$1 = class RegisterSlave$1 extends Command$4 {
19921
20016
  constructor(opts, callback) {
19922
20017
  super();
19923
20018
  this.onResult = callback;
19924
20019
  this.opts = opts;
19925
20020
  }
19926
20021
  start(packet, connection) {
19927
- const newPacket = new Packets$3.RegisterSlave(this.opts);
20022
+ const newPacket = new Packets$4.RegisterSlave(this.opts);
19928
20023
  connection.writePacket(newPacket.toPacket(1));
19929
20024
  return RegisterSlave$1.prototype.registerResponse;
19930
20025
  }
@@ -20037,8 +20132,8 @@ var require_binlog_query_statusvars = /* @__PURE__ */ require_chunk.__commonJS({
20037
20132
  //#endregion
20038
20133
  //#region node_modules/mysql2/lib/commands/binlog_dump.js
20039
20134
  var require_binlog_dump = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/commands/binlog_dump.js": ((exports, module) => {
20040
- const Command$2 = require_command();
20041
- const Packets$2 = require_packets();
20135
+ const Command$3 = require_command();
20136
+ const Packets$3 = require_packets();
20042
20137
  const eventParsers = [];
20043
20138
  var BinlogEventHeader = class {
20044
20139
  constructor(packet) {
@@ -20050,13 +20145,13 @@ var require_binlog_dump = /* @__PURE__ */ require_chunk.__commonJS({ "node_modul
20050
20145
  this.flags = packet.readInt16();
20051
20146
  }
20052
20147
  };
20053
- var BinlogDump$1 = class BinlogDump$1 extends Command$2 {
20148
+ var BinlogDump$1 = class BinlogDump$1 extends Command$3 {
20054
20149
  constructor(opts) {
20055
20150
  super();
20056
20151
  this.opts = opts;
20057
20152
  }
20058
20153
  start(packet, connection) {
20059
- const newPacket = new Packets$2.BinlogDump(this.opts);
20154
+ const newPacket = new Packets$3.BinlogDump(this.opts);
20060
20155
  connection.writePacket(newPacket.toPacket(1));
20061
20156
  return BinlogDump$1.prototype.binlogData;
20062
20157
  }
@@ -20127,12 +20222,12 @@ var require_binlog_dump = /* @__PURE__ */ require_chunk.__commonJS({ "node_modul
20127
20222
  //#endregion
20128
20223
  //#region node_modules/mysql2/lib/commands/change_user.js
20129
20224
  var require_change_user = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/commands/change_user.js": ((exports, module) => {
20130
- const Command$1 = require_command();
20131
- const Packets$1 = require_packets();
20225
+ const Command$2 = require_command();
20226
+ const Packets$2 = require_packets();
20132
20227
  const ClientConstants$1 = require_client();
20133
20228
  const ClientHandshake$1 = require_client_handshake();
20134
20229
  const CharsetToEncoding$1 = require_charset_encodings();
20135
- var ChangeUser$1 = class ChangeUser$1 extends Command$1 {
20230
+ var ChangeUser$1 = class ChangeUser$1 extends Command$2 {
20136
20231
  constructor(options, callback) {
20137
20232
  super();
20138
20233
  this.onResult = callback;
@@ -20148,7 +20243,7 @@ var require_change_user = /* @__PURE__ */ require_chunk.__commonJS({ "node_modul
20148
20243
  this.authenticationFactor = 0;
20149
20244
  }
20150
20245
  start(packet, connection) {
20151
- const newPacket = new Packets$1.ChangeUser({
20246
+ const newPacket = new Packets$2.ChangeUser({
20152
20247
  flags: connection.config.clientFlags,
20153
20248
  user: this.user,
20154
20249
  database: this.database,
@@ -20174,6 +20269,30 @@ var require_change_user = /* @__PURE__ */ require_chunk.__commonJS({ "node_modul
20174
20269
  module.exports = ChangeUser$1;
20175
20270
  }) });
20176
20271
 
20272
+ //#endregion
20273
+ //#region node_modules/mysql2/lib/commands/reset_connection.js
20274
+ var require_reset_connection = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/commands/reset_connection.js": ((exports, module) => {
20275
+ const Command$1 = require_command();
20276
+ const Packets$1 = require_packets();
20277
+ var ResetConnection$1 = class ResetConnection$1 extends Command$1 {
20278
+ constructor(callback) {
20279
+ super();
20280
+ this.onResult = callback;
20281
+ }
20282
+ start(packet, connection) {
20283
+ const req = new Packets$1.ResetConnection();
20284
+ connection.writePacket(req.toPacket());
20285
+ return ResetConnection$1.prototype.resetConnectionResponse;
20286
+ }
20287
+ resetConnectionResponse(packet, connection) {
20288
+ if (connection._statements) connection._statements.clear();
20289
+ if (this.onResult) process.nextTick(this.onResult.bind(this, null));
20290
+ return null;
20291
+ }
20292
+ };
20293
+ module.exports = ResetConnection$1;
20294
+ }) });
20295
+
20177
20296
  //#endregion
20178
20297
  //#region node_modules/mysql2/lib/commands/quit.js
20179
20298
  var require_quit = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/commands/quit.js": ((exports, module) => {
@@ -20215,6 +20334,7 @@ var require_commands = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/
20215
20334
  const RegisterSlave = require_register_slave();
20216
20335
  const BinlogDump = require_binlog_dump();
20217
20336
  const ChangeUser = require_change_user();
20337
+ const ResetConnection = require_reset_connection();
20218
20338
  const Quit = require_quit();
20219
20339
  module.exports = {
20220
20340
  ClientHandshake,
@@ -20227,6 +20347,7 @@ var require_commands = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/
20227
20347
  RegisterSlave,
20228
20348
  BinlogDump,
20229
20349
  ChangeUser,
20350
+ ResetConnection,
20230
20351
  Quit
20231
20352
  };
20232
20353
  }) });
@@ -20236,7 +20357,7 @@ var require_commands = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/
20236
20357
  var require_package = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/package.json": ((exports, module) => {
20237
20358
  module.exports = {
20238
20359
  "name": "mysql2",
20239
- "version": "3.20.0",
20360
+ "version": "3.22.0",
20240
20361
  "description": "fast mysql driver. Implements core protocol, prepared statements, ssl and compression in native JS",
20241
20362
  "main": "index.js",
20242
20363
  "typings": "typings/mysql/index",
@@ -20300,7 +20421,7 @@ var require_package = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/m
20300
20421
  "devDependencies": {
20301
20422
  "@eslint/eslintrc": "^3.3.3",
20302
20423
  "@eslint/js": "^9.39.2",
20303
- "@eslint/markdown": "^7.5.1",
20424
+ "@eslint/markdown": "^8.0.1",
20304
20425
  "@ianvs/prettier-plugin-sort-imports": "^4.7.1",
20305
20426
  "@pokujs/multi-suite": "^1.0.0",
20306
20427
  "@rollup/plugin-commonjs": "^29.0.2",
@@ -20555,6 +20676,7 @@ var require_connection_config = /* @__PURE__ */ require_chunk.__commonJS({ "node
20555
20676
  uri: 1,
20556
20677
  user: 1,
20557
20678
  disableEval: 1,
20679
+ enableCleartextPlugin: 1,
20558
20680
  connectionLimit: 1,
20559
20681
  maxIdle: 1,
20560
20682
  idleTimeout: 1,
@@ -20616,6 +20738,7 @@ var require_connection_config = /* @__PURE__ */ require_chunk.__commonJS({ "node
20616
20738
  this.nestTables = options.nestTables === void 0 ? void 0 : options.nestTables;
20617
20739
  this.typeCast = options.typeCast === void 0 ? true : options.typeCast;
20618
20740
  this.disableEval = Boolean(options.disableEval);
20741
+ this.enableCleartextPlugin = Boolean(options.enableCleartextPlugin);
20619
20742
  if (this.timezone[0] === " ") this.timezone = `+${this.timezone.slice(1)}`;
20620
20743
  if (this.ssl) {
20621
20744
  if (typeof this.ssl !== "object") throw new TypeError(`SSL profile must be an object, instead it's a ${typeof this.ssl}`);
@@ -20667,7 +20790,8 @@ var require_connection_config = /* @__PURE__ */ require_chunk.__commonJS({ "node
20667
20790
  "MULTI_RESULTS",
20668
20791
  "TRANSACTIONS",
20669
20792
  "SESSION_TRACK",
20670
- "CONNECT_ATTRS"
20793
+ "CONNECT_ATTRS",
20794
+ "CLIENT_QUERY_ATTRIBUTES"
20671
20795
  ];
20672
20796
  if (options && options.multipleStatements) defaultFlags.push("MULTI_STATEMENTS");
20673
20797
  defaultFlags.push("PLUGIN_AUTH");
@@ -21457,6 +21581,9 @@ var require_connection$2 = /* @__PURE__ */ require_chunk.__commonJS({ "node_modu
21457
21581
  ping(cb) {
21458
21582
  return this.addCommand(new Commands.Ping(cb));
21459
21583
  }
21584
+ reset(cb) {
21585
+ return this.addCommand(new Commands.ResetConnection(cb));
21586
+ }
21460
21587
  _registerSlave(opts, cb) {
21461
21588
  return this.addCommand(new Commands.RegisterSlave(opts, cb));
21462
21589
  }
@@ -21601,9 +21728,10 @@ var require_connection$2 = /* @__PURE__ */ require_chunk.__commonJS({ "node_modu
21601
21728
  //#endregion
21602
21729
  //#region node_modules/mysql2/lib/promise/make_done_cb.js
21603
21730
  var require_make_done_cb = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/mysql2/lib/promise/make_done_cb.js": ((exports, module) => {
21604
- function makeDoneCb$5(resolve, reject, localErr) {
21731
+ function makeDoneCb$5(resolve, reject) {
21605
21732
  return function(err, rows, fields$1) {
21606
21733
  if (err) {
21734
+ const localErr = /* @__PURE__ */ new Error();
21607
21735
  localErr.message = err.message;
21608
21736
  localErr.code = err.code;
21609
21737
  localErr.errno = err.errno;
@@ -21628,9 +21756,8 @@ var require_prepared_statement_info = /* @__PURE__ */ require_chunk.__commonJS({
21628
21756
  }
21629
21757
  execute(parameters) {
21630
21758
  const s = this.statement;
21631
- const localErr = /* @__PURE__ */ new Error();
21632
21759
  return new this.Promise((resolve, reject) => {
21633
- const done = makeDoneCb$4(resolve, reject, localErr);
21760
+ const done = makeDoneCb$4(resolve, reject);
21634
21761
  if (parameters) s.execute(parameters, done);
21635
21762
  else s.execute(done);
21636
21763
  });
@@ -21692,20 +21819,18 @@ var require_connection$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_modu
21692
21819
  }
21693
21820
  query(query, params) {
21694
21821
  const c = this.connection;
21695
- const localErr = /* @__PURE__ */ new Error();
21696
21822
  if (typeof params === "function") throw new Error("Callback function is not available with promise clients.");
21697
21823
  return new this.Promise((resolve, reject) => {
21698
- const done = makeDoneCb$3(resolve, reject, localErr);
21824
+ const done = makeDoneCb$3(resolve, reject);
21699
21825
  if (params !== void 0) c.query(query, params, done);
21700
21826
  else c.query(query, done);
21701
21827
  });
21702
21828
  }
21703
21829
  execute(query, params) {
21704
21830
  const c = this.connection;
21705
- const localErr = /* @__PURE__ */ new Error();
21706
21831
  if (typeof params === "function") throw new Error("Callback function is not available with promise clients.");
21707
21832
  return new this.Promise((resolve, reject) => {
21708
- const done = makeDoneCb$3(resolve, reject, localErr);
21833
+ const done = makeDoneCb$3(resolve, reject);
21709
21834
  if (params !== void 0) c.execute(query, params, done);
21710
21835
  else c.execute(query, done);
21711
21836
  });
@@ -21720,34 +21845,31 @@ var require_connection$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_modu
21720
21845
  }
21721
21846
  beginTransaction() {
21722
21847
  const c = this.connection;
21723
- const localErr = /* @__PURE__ */ new Error();
21724
21848
  return new this.Promise((resolve, reject) => {
21725
- const done = makeDoneCb$3(resolve, reject, localErr);
21849
+ const done = makeDoneCb$3(resolve, reject);
21726
21850
  c.beginTransaction(done);
21727
21851
  });
21728
21852
  }
21729
21853
  commit() {
21730
21854
  const c = this.connection;
21731
- const localErr = /* @__PURE__ */ new Error();
21732
21855
  return new this.Promise((resolve, reject) => {
21733
- const done = makeDoneCb$3(resolve, reject, localErr);
21856
+ const done = makeDoneCb$3(resolve, reject);
21734
21857
  c.commit(done);
21735
21858
  });
21736
21859
  }
21737
21860
  rollback() {
21738
21861
  const c = this.connection;
21739
- const localErr = /* @__PURE__ */ new Error();
21740
21862
  return new this.Promise((resolve, reject) => {
21741
- const done = makeDoneCb$3(resolve, reject, localErr);
21863
+ const done = makeDoneCb$3(resolve, reject);
21742
21864
  c.rollback(done);
21743
21865
  });
21744
21866
  }
21745
21867
  ping() {
21746
21868
  const c = this.connection;
21747
- const localErr = /* @__PURE__ */ new Error();
21748
21869
  return new this.Promise((resolve, reject) => {
21749
21870
  c.ping((err) => {
21750
21871
  if (err) {
21872
+ const localErr = /* @__PURE__ */ new Error();
21751
21873
  localErr.message = err.message;
21752
21874
  localErr.code = err.code;
21753
21875
  localErr.errno = err.errno;
@@ -21758,12 +21880,28 @@ var require_connection$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_modu
21758
21880
  });
21759
21881
  });
21760
21882
  }
21883
+ reset() {
21884
+ const c = this.connection;
21885
+ return new this.Promise((resolve, reject) => {
21886
+ c.reset((err) => {
21887
+ if (err) {
21888
+ const localErr = /* @__PURE__ */ new Error();
21889
+ localErr.message = err.message;
21890
+ localErr.code = err.code;
21891
+ localErr.errno = err.errno;
21892
+ localErr.sqlState = err.sqlState;
21893
+ localErr.sqlMessage = err.sqlMessage;
21894
+ reject(localErr);
21895
+ } else resolve();
21896
+ });
21897
+ });
21898
+ }
21761
21899
  connect() {
21762
21900
  const c = this.connection;
21763
- const localErr = /* @__PURE__ */ new Error();
21764
21901
  return new this.Promise((resolve, reject) => {
21765
21902
  c.connect((err, param) => {
21766
21903
  if (err) {
21904
+ const localErr = /* @__PURE__ */ new Error();
21767
21905
  localErr.message = err.message;
21768
21906
  localErr.code = err.code;
21769
21907
  localErr.errno = err.errno;
@@ -21777,10 +21915,10 @@ var require_connection$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_modu
21777
21915
  prepare(options) {
21778
21916
  const c = this.connection;
21779
21917
  const promiseImpl = this.Promise;
21780
- const localErr = /* @__PURE__ */ new Error();
21781
21918
  return new this.Promise((resolve, reject) => {
21782
21919
  c.prepare(options, (err, statement) => {
21783
21920
  if (err) {
21921
+ const localErr = /* @__PURE__ */ new Error();
21784
21922
  localErr.message = err.message;
21785
21923
  localErr.code = err.code;
21786
21924
  localErr.errno = err.errno;
@@ -21793,10 +21931,10 @@ var require_connection$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_modu
21793
21931
  }
21794
21932
  changeUser(options) {
21795
21933
  const c = this.connection;
21796
- const localErr = /* @__PURE__ */ new Error();
21797
21934
  return new this.Promise((resolve, reject) => {
21798
21935
  c.changeUser(options, (err) => {
21799
21936
  if (err) {
21937
+ const localErr = /* @__PURE__ */ new Error();
21800
21938
  localErr.message = err.message;
21801
21939
  localErr.code = err.code;
21802
21940
  localErr.errno = err.errno;
@@ -22004,7 +22142,26 @@ var require_pool$2 = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/my
22004
22142
  cb = this._connectionQueue.shift();
22005
22143
  process$2.nextTick(this.getConnection.bind(this, cb));
22006
22144
  }
22007
- } else if (this._connectionQueue.length) {
22145
+ return;
22146
+ }
22147
+ if (this.config.resetOnRelease && connection.reset) connection.reset((err) => {
22148
+ if (err) {
22149
+ connection._pool = null;
22150
+ spliceConnection(this._allConnections, connection);
22151
+ connection.destroy();
22152
+ if (this._connectionQueue.length) {
22153
+ cb = this._connectionQueue.shift();
22154
+ process$2.nextTick(this.getConnection.bind(this, cb));
22155
+ }
22156
+ return;
22157
+ }
22158
+ this._handleSuccessfulRelease(connection);
22159
+ });
22160
+ else this._handleSuccessfulRelease(connection);
22161
+ }
22162
+ _handleSuccessfulRelease(connection) {
22163
+ let cb;
22164
+ if (this._connectionQueue.length) {
22008
22165
  cb = this._connectionQueue.shift();
22009
22166
  process$2.nextTick(() => {
22010
22167
  connection._released = false;
@@ -22157,30 +22314,28 @@ var require_pool$1 = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/my
22157
22314
  }
22158
22315
  query(sql, args) {
22159
22316
  const corePool = this.pool;
22160
- const localErr = /* @__PURE__ */ new Error();
22161
22317
  if (typeof args === "function") throw new Error("Callback function is not available with promise clients.");
22162
22318
  return new this.Promise((resolve, reject) => {
22163
- const done = makeDoneCb$2(resolve, reject, localErr);
22319
+ const done = makeDoneCb$2(resolve, reject);
22164
22320
  if (args !== void 0) corePool.query(sql, args, done);
22165
22321
  else corePool.query(sql, done);
22166
22322
  });
22167
22323
  }
22168
22324
  execute(sql, args) {
22169
22325
  const corePool = this.pool;
22170
- const localErr = /* @__PURE__ */ new Error();
22171
22326
  if (typeof args === "function") throw new Error("Callback function is not available with promise clients.");
22172
22327
  return new this.Promise((resolve, reject) => {
22173
- const done = makeDoneCb$2(resolve, reject, localErr);
22328
+ const done = makeDoneCb$2(resolve, reject);
22174
22329
  if (args) corePool.execute(sql, args, done);
22175
22330
  else corePool.execute(sql, done);
22176
22331
  });
22177
22332
  }
22178
22333
  end() {
22179
22334
  const corePool = this.pool;
22180
- const localErr = /* @__PURE__ */ new Error();
22181
22335
  return new this.Promise((resolve, reject) => {
22182
22336
  corePool.end((err) => {
22183
22337
  if (err) {
22338
+ const localErr = /* @__PURE__ */ new Error();
22184
22339
  localErr.message = err.message;
22185
22340
  localErr.code = err.code;
22186
22341
  localErr.errno = err.errno;
@@ -22237,6 +22392,7 @@ var require_pool_config = /* @__PURE__ */ require_chunk.__commonJS({ "node_modul
22237
22392
  this.maxIdle = isNaN(options.maxIdle) ? this.connectionLimit : Number(options.maxIdle);
22238
22393
  this.idleTimeout = isNaN(options.idleTimeout) ? 6e4 : Number(options.idleTimeout);
22239
22394
  this.queueLimit = isNaN(options.queueLimit) ? 0 : Number(options.queueLimit);
22395
+ this.resetOnRelease = options.resetOnRelease === void 0 ? false : Boolean(options.resetOnRelease);
22240
22396
  }
22241
22397
  };
22242
22398
  module.exports = PoolConfig$2;
@@ -22569,19 +22725,17 @@ var require_pool_cluster = /* @__PURE__ */ require_chunk.__commonJS({ "node_modu
22569
22725
  }
22570
22726
  query(sql, values) {
22571
22727
  const corePoolNamespace = this.poolNamespace;
22572
- const localErr = /* @__PURE__ */ new Error();
22573
22728
  if (typeof values === "function") throw new Error("Callback function is not available with promise clients.");
22574
22729
  return new this.Promise((resolve, reject) => {
22575
- const done = makeDoneCb$1(resolve, reject, localErr);
22730
+ const done = makeDoneCb$1(resolve, reject);
22576
22731
  corePoolNamespace.query(sql, values, done);
22577
22732
  });
22578
22733
  }
22579
22734
  execute(sql, values) {
22580
22735
  const corePoolNamespace = this.poolNamespace;
22581
- const localErr = /* @__PURE__ */ new Error();
22582
22736
  if (typeof values === "function") throw new Error("Callback function is not available with promise clients.");
22583
22737
  return new this.Promise((resolve, reject) => {
22584
- const done = makeDoneCb$1(resolve, reject, localErr);
22738
+ const done = makeDoneCb$1(resolve, reject);
22585
22739
  corePoolNamespace.execute(sql, values, done);
22586
22740
  });
22587
22741
  }
@@ -22607,7 +22761,6 @@ var require_promise = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/m
22607
22761
  const PromisePoolNamespace = require_pool_cluster();
22608
22762
  function createConnectionPromise(opts) {
22609
22763
  const coreConnection = createConnection(opts);
22610
- const createConnectionErr = /* @__PURE__ */ new Error();
22611
22764
  const thePromise = opts.Promise || Promise;
22612
22765
  if (!thePromise) throw new Error("no Promise implementation available.Use promise-enabled node version or pass userland Promise implementation as parameter, for example: { Promise: require('bluebird') }");
22613
22766
  return new thePromise((resolve, reject) => {
@@ -22615,6 +22768,7 @@ var require_promise = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/m
22615
22768
  resolve(new PromiseConnection(coreConnection, thePromise));
22616
22769
  });
22617
22770
  coreConnection.once("error", (err) => {
22771
+ const createConnectionErr = /* @__PURE__ */ new Error();
22618
22772
  createConnectionErr.message = err.message;
22619
22773
  createConnectionErr.code = err.code;
22620
22774
  createConnectionErr.errno = err.errno;
@@ -22652,19 +22806,17 @@ var require_promise = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/m
22652
22806
  }
22653
22807
  query(sql, args) {
22654
22808
  const corePoolCluster = this.poolCluster;
22655
- const localErr = /* @__PURE__ */ new Error();
22656
22809
  if (typeof args === "function") throw new Error("Callback function is not available with promise clients.");
22657
22810
  return new this.Promise((resolve, reject) => {
22658
- const done = makeDoneCb(resolve, reject, localErr);
22811
+ const done = makeDoneCb(resolve, reject);
22659
22812
  corePoolCluster.query(sql, args, done);
22660
22813
  });
22661
22814
  }
22662
22815
  execute(sql, args) {
22663
22816
  const corePoolCluster = this.poolCluster;
22664
- const localErr = /* @__PURE__ */ new Error();
22665
22817
  if (typeof args === "function") throw new Error("Callback function is not available with promise clients.");
22666
22818
  return new this.Promise((resolve, reject) => {
22667
- const done = makeDoneCb(resolve, reject, localErr);
22819
+ const done = makeDoneCb(resolve, reject);
22668
22820
  corePoolCluster.execute(sql, args, done);
22669
22821
  });
22670
22822
  }
@@ -22673,10 +22825,10 @@ var require_promise = /* @__PURE__ */ require_chunk.__commonJS({ "node_modules/m
22673
22825
  }
22674
22826
  end() {
22675
22827
  const corePoolCluster = this.poolCluster;
22676
- const localErr = /* @__PURE__ */ new Error();
22677
22828
  return new this.Promise((resolve, reject) => {
22678
22829
  corePoolCluster.end((err) => {
22679
22830
  if (err) {
22831
+ const localErr = /* @__PURE__ */ new Error();
22680
22832
  localErr.message = err.message;
22681
22833
  localErr.code = err.code;
22682
22834
  localErr.errno = err.errno;
@@ -22740,4 +22892,4 @@ Object.defineProperty(exports, 'default', {
22740
22892
  return require_promise();
22741
22893
  }
22742
22894
  });
22743
- //# sourceMappingURL=promise-BI-3eI4n.js.map
22895
+ //# sourceMappingURL=promise-FtXoEiT6.js.map