@dbml/connector 11.0.0-alpha.6 → 11.0.0

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.
package/dist/index.mjs CHANGED
@@ -5,7 +5,14 @@ import r, { getConnection as i } from "oracledb";
5
5
  import { Client as a } from "pg";
6
6
  import o from "snowflake-sdk";
7
7
  //#region \0rolldown/runtime.js
8
- var s = Object.defineProperty, c = Object.getOwnPropertyDescriptor, l = Object.getOwnPropertyNames, u = Object.prototype.hasOwnProperty, d = (e, t) => () => (e && (t = e(e = 0)), t), f = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), p = (e, t) => {
8
+ var s = Object.defineProperty, c = Object.getOwnPropertyDescriptor, l = Object.getOwnPropertyNames, u = Object.prototype.hasOwnProperty, d = (e, t, n) => () => {
9
+ if (n) throw n[0];
10
+ try {
11
+ return e && (t = e(e = 0)), t;
12
+ } catch (e) {
13
+ throw n = [e], e;
14
+ }
15
+ }, f = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), p = (e, t) => {
9
16
  let n = {};
10
17
  for (var r in e) s(n, r, {
11
18
  get: e[r],
@@ -447,7 +454,7 @@ var se = "schemas=", D = (e) => e.toLowerCase().includes(se), ce = (e) => e ? e.
447
454
  ORDER BY
448
455
  s.name,
449
456
  t.name;
450
- `, i = await e.query(r), a = (e, t) => e.length === t.length ? e.every((e, n) => e.tableName === t[n].tableName && e.schemaName === t[n].schemaName && e.fieldNames.length === t[n].fieldNames.length && e.fieldNames.every((e, r) => e === t[n].fieldNames[r])) : !1;
457
+ `, i = await e.query(r), a = (e, t) => e.length === t.length && e.every((e, n) => e.tableName === t[n].tableName && e.schemaName === t[n].schemaName && e.fieldNames.length === t[n].fieldNames.length && e.fieldNames.every((e, r) => e === t[n].fieldNames[r]));
451
458
  return i.recordset.forEach((e) => {
452
459
  let { table_schema: t, fk_constraint_name: r, table_name: i, column_names: o, foreign_table_schema: s, foreign_table_name: c, foreign_column_names: l, on_delete: u, on_update: d } = e, f = {
453
460
  name: r,
@@ -585,19 +592,13 @@ var se = "schemas=", D = (e) => e.toLowerCase().includes(se), ce = (e) => e ? e.
585
592
  `, c = await e.query(s), l = {};
586
593
  return c.recordset.forEach((e) => {
587
594
  let { table_schema: t, table_name: n, column_name: r, check_name: i, check_expression: a } = e, s = `${t}.${n}`;
588
- if (a) {
589
- if (r) {
590
- o[s] || (o[s] = {}), o[s][r] || (o[s][r] = { checks: [] }), o[s][r].checks.push({
591
- name: i,
592
- expression: a.slice(1, -1)
593
- });
594
- return;
595
- }
596
- l[s] || (l[s] = []), l[s].push({
597
- name: i,
598
- expression: a.slice(1, -1)
599
- });
600
- }
595
+ a && (r ? (o[s] || (o[s] = {}), o[s][r] || (o[s][r] = { checks: [] }), o[s][r].checks.push({
596
+ name: i,
597
+ expression: a.slice(1, -1)
598
+ })) : (l[s] || (l[s] = []), l[s].push({
599
+ name: i,
600
+ expression: a.slice(1, -1)
601
+ })));
601
602
  }), {
602
603
  indexes: a,
603
604
  tableConstraints: o,
@@ -712,8 +713,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
712
713
  return (t + n) * 3 / 4 - n;
713
714
  }
714
715
  function u(e) {
715
- var t, i = s(e), a = i[0], o = i[1], c = new r(l(e, a, o)), u = 0, d = o > 0 ? a - 4 : a, f;
716
- for (f = 0; f < d; f += 4) t = n[e.charCodeAt(f)] << 18 | n[e.charCodeAt(f + 1)] << 12 | n[e.charCodeAt(f + 2)] << 6 | n[e.charCodeAt(f + 3)], c[u++] = t >> 16 & 255, c[u++] = t >> 8 & 255, c[u++] = t & 255;
716
+ for (var t, i = s(e), a = i[0], o = i[1], c = new r(l(e, a, o)), u = 0, d = o > 0 ? a - 4 : a, f = 0; f < d; f += 4) t = n[e.charCodeAt(f)] << 18 | n[e.charCodeAt(f + 1)] << 12 | n[e.charCodeAt(f + 2)] << 6 | n[e.charCodeAt(f + 3)], c[u++] = t >> 16 & 255, c[u++] = t >> 8 & 255, c[u++] = t & 255;
717
717
  return o === 2 && (t = n[e.charCodeAt(f)] << 2 | n[e.charCodeAt(f + 1)] >> 4, c[u++] = t & 255), o === 1 && (t = n[e.charCodeAt(f)] << 10 | n[e.charCodeAt(f + 1)] << 4 | n[e.charCodeAt(f + 2)] >> 2, c[u++] = t >> 8 & 255, c[u++] = t & 255), c;
718
718
  }
719
719
  function d(e) {
@@ -749,7 +749,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
749
749
  e.kMaxLength = i, s.TYPED_ARRAY_SUPPORT = a(), !s.TYPED_ARRAY_SUPPORT && typeof console < "u" && typeof console.error == "function" && console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");
750
750
  function a() {
751
751
  try {
752
- let e = new Uint8Array(1), t = { foo: function() {
752
+ let e = /* @__PURE__ */ new Uint8Array(1), t = { foo: function() {
753
753
  return 42;
754
754
  } };
755
755
  return Object.setPrototypeOf(t, Uint8Array.prototype), Object.setPrototypeOf(e, t), e.foo() === 42;
@@ -964,7 +964,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
964
964
  return e === 0 ? "" : arguments.length === 0 ? re(this, 0, e) : b.apply(this, arguments);
965
965
  }, s.prototype.toLocaleString = s.prototype.toString, s.prototype.equals = function(e) {
966
966
  if (!s.isBuffer(e)) throw TypeError("Argument must be a Buffer");
967
- return this === e ? !0 : s.compare(this, e) === 0;
967
+ return this === e || s.compare(this, e) === 0;
968
968
  }, s.prototype.inspect = function() {
969
969
  let t = "", n = e.INSPECT_MAX_BYTES;
970
970
  return t = this.toString("hex", 0, n).replace(/(.{2})/g, "$1 ").trim(), this.length > n && (t += " ... "), "<Buffer " + t + ">";
@@ -987,8 +987,10 @@ var Ve = /* @__PURE__ */ f(((e) => {
987
987
  if (typeof n == "string" ? (r = n, n = 0) : n > 2147483647 ? n = 2147483647 : n < -2147483648 && (n = -2147483648), n = +n, L(n) && (n = i ? 0 : e.length - 1), n < 0 && (n = e.length + n), n >= e.length) {
988
988
  if (i) return -1;
989
989
  n = e.length - 1;
990
- } else if (n < 0) if (i) n = 0;
991
- else return -1;
990
+ } else if (n < 0) {
991
+ if (i) n = 0;
992
+ else return -1;
993
+ }
992
994
  if (typeof t == "string" && (t = s.from(t, r)), s.isBuffer(t)) return t.length === 0 ? -1 : C(e, t, n, r, i);
993
995
  if (typeof t == "number") return t &= 255, typeof Uint8Array.prototype.indexOf == "function" ? i ? Uint8Array.prototype.indexOf.call(e, t, n) : Uint8Array.prototype.lastIndexOf.call(e, t, n) : C(e, [t], n, r, i);
994
996
  throw TypeError("val must be string, number or Buffer");
@@ -1031,8 +1033,8 @@ var Ve = /* @__PURE__ */ f(((e) => {
1031
1033
  r ? (r = Number(r), r > i && (r = i)) : r = i;
1032
1034
  let a = t.length;
1033
1035
  r > a / 2 && (r = a / 2);
1034
- let o;
1035
- for (o = 0; o < r; ++o) {
1036
+ let o = 0;
1037
+ for (; o < r; ++o) {
1036
1038
  let r = parseInt(t.substr(o * 2, 2), 16);
1037
1039
  if (L(r)) return o;
1038
1040
  e[n + o] = r;
@@ -1175,13 +1177,13 @@ var Ve = /* @__PURE__ */ f(((e) => {
1175
1177
  e >>>= 0, M(e, "offset");
1176
1178
  let t = this[e], n = this[e + 7];
1177
1179
  (t === void 0 || n === void 0) && N(e, this.length - 8);
1178
- let r = t + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + this[++e] * 2 ** 24, i = this[++e] + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + n * 2 ** 24;
1180
+ let r = t + this[++e] * 256 + this[++e] * 2 ** 16 + this[++e] * 2 ** 24, i = this[++e] + this[++e] * 256 + this[++e] * 2 ** 16 + n * 2 ** 24;
1179
1181
  return BigInt(r) + (BigInt(i) << BigInt(32));
1180
1182
  }), s.prototype.readBigUInt64BE = R(function(e) {
1181
1183
  e >>>= 0, M(e, "offset");
1182
1184
  let t = this[e], n = this[e + 7];
1183
1185
  (t === void 0 || n === void 0) && N(e, this.length - 8);
1184
- let r = t * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e], i = this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + n;
1186
+ let r = t * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 256 + this[++e], i = this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 256 + n;
1185
1187
  return (BigInt(r) << BigInt(32)) + BigInt(i);
1186
1188
  }), s.prototype.readIntLE = function(e, t, n) {
1187
1189
  e >>>= 0, t >>>= 0, n || O(e, t, this.length);
@@ -1211,14 +1213,14 @@ var Ve = /* @__PURE__ */ f(((e) => {
1211
1213
  e >>>= 0, M(e, "offset");
1212
1214
  let t = this[e], n = this[e + 7];
1213
1215
  (t === void 0 || n === void 0) && N(e, this.length - 8);
1214
- let r = this[e + 4] + this[e + 5] * 2 ** 8 + this[e + 6] * 2 ** 16 + (n << 24);
1215
- return (BigInt(r) << BigInt(32)) + BigInt(t + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + this[++e] * 2 ** 24);
1216
+ let r = this[e + 4] + this[e + 5] * 256 + this[e + 6] * 2 ** 16 + (n << 24);
1217
+ return (BigInt(r) << BigInt(32)) + BigInt(t + this[++e] * 256 + this[++e] * 2 ** 16 + this[++e] * 2 ** 24);
1216
1218
  }), s.prototype.readBigInt64BE = R(function(e) {
1217
1219
  e >>>= 0, M(e, "offset");
1218
1220
  let t = this[e], n = this[e + 7];
1219
1221
  (t === void 0 || n === void 0) && N(e, this.length - 8);
1220
- let r = (t << 24) + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e];
1221
- return (BigInt(r) << BigInt(32)) + BigInt(this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + n);
1222
+ let r = (t << 24) + this[++e] * 2 ** 16 + this[++e] * 256 + this[++e];
1223
+ return (BigInt(r) << BigInt(32)) + BigInt(this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 256 + n);
1222
1224
  }), s.prototype.readFloatLE = function(e, t) {
1223
1225
  return e >>>= 0, t || O(e, 4, this.length), n.read(this, e, !0, 23, 4);
1224
1226
  }, s.prototype.readFloatBE = function(e, t) {
@@ -1284,7 +1286,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
1284
1286
  k(this, e, t, n, r - 1, -r);
1285
1287
  }
1286
1288
  let i = 0, a = 1, o = 0;
1287
- for (this[t] = e & 255; ++i < n && (a *= 256);) e < 0 && o === 0 && this[t + i - 1] !== 0 && (o = 1), this[t + i] = (e / a >> 0) - o & 255;
1289
+ for (this[t] = e & 255; ++i < n && (a *= 256);) e < 0 && o === 0 && this[t + i - 1] !== 0 && (o = 1), this[t + i] = (e / a | 0) - o & 255;
1288
1290
  return t + n;
1289
1291
  }, s.prototype.writeIntBE = function(e, t, n, r) {
1290
1292
  if (e = +e, t >>>= 0, !r) {
@@ -1292,7 +1294,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
1292
1294
  k(this, e, t, n, r - 1, -r);
1293
1295
  }
1294
1296
  let i = n - 1, a = 1, o = 0;
1295
- for (this[t + i] = e & 255; --i >= 0 && (a *= 256);) e < 0 && o === 0 && this[t + i + 1] !== 0 && (o = 1), this[t + i] = (e / a >> 0) - o & 255;
1297
+ for (this[t + i] = e & 255; --i >= 0 && (a *= 256);) e < 0 && o === 0 && this[t + i + 1] !== 0 && (o = 1), this[t + i] = (e / a | 0) - o & 255;
1296
1298
  return t + n;
1297
1299
  }, s.prototype.writeInt8 = function(e, t, n) {
1298
1300
  return e = +e, t >>>= 0, n || k(this, e, t, 1, 127, -128), e < 0 && (e = 255 + e + 1), this[t] = e & 255, t + 1;
@@ -1424,10 +1426,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
1424
1426
  for (let o = 0; o < r; ++o) {
1425
1427
  if (n = e.charCodeAt(o), n > 55295 && n < 57344) {
1426
1428
  if (!i) {
1427
- if (n > 56319) {
1428
- (t -= 3) > -1 && a.push(239, 191, 189);
1429
- continue;
1430
- } else if (o + 1 === r) {
1429
+ if (n > 56319 || o + 1 === r) {
1431
1430
  (t -= 3) > -1 && a.push(239, 191, 189);
1432
1431
  continue;
1433
1432
  }
@@ -1470,8 +1469,8 @@ var Ve = /* @__PURE__ */ f(((e) => {
1470
1469
  return t.toByteArray(ve(e));
1471
1470
  }
1472
1471
  function F(e, t, n, r) {
1473
- let i;
1474
- for (i = 0; i < r && !(i + n >= t.length || i >= e.length); ++i) t[i + n] = e[i];
1472
+ let i = 0;
1473
+ for (; i < r && !(i + n >= t.length || i >= e.length); ++i) t[i + n] = e[i];
1475
1474
  return i;
1476
1475
  }
1477
1476
  function I(e, t) {
@@ -1496,7 +1495,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
1496
1495
  }
1497
1496
  })), We = /* @__PURE__ */ f(((e) => {
1498
1497
  Object.defineProperty(e, "__esModule", { value: !0 }), e.raw = e.format = e.escape = e.arrayToList = e.bufferToString = e.objectToValues = e.escapeId = e.temporalToString = e.dateToString = void 0;
1499
- var t = Ue(), n = new Uint8Array(128), r = {}, i = [
1498
+ var t = Ue(), n = /* @__PURE__ */ new Uint8Array(128), r = {}, i = [
1500
1499
  "where",
1501
1500
  "order",
1502
1501
  "group",
@@ -1554,11 +1553,8 @@ var Ve = /* @__PURE__ */ f(((e) => {
1554
1553
  if (n === o.backtick) {
1555
1554
  let n = e.length;
1556
1555
  for (let r = t + 1; r < n; r++) if (e.charCodeAt(r) === o.backtick) {
1557
- if (e.charCodeAt(r + 1) === o.backtick) {
1558
- r++;
1559
- continue;
1560
- }
1561
- return r + 1;
1556
+ if (e.charCodeAt(r + 1) === o.backtick) r++;
1557
+ else return r + 1;
1562
1558
  }
1563
1559
  return n;
1564
1560
  }
@@ -1599,20 +1595,12 @@ var Ve = /* @__PURE__ */ f(((e) => {
1599
1595
  continue;
1600
1596
  }
1601
1597
  }
1602
- if (u(t)) {
1603
- m++;
1604
- continue;
1605
- }
1606
- if (t === o.openParen) {
1607
- s++, c = !0, d = !1, m++;
1608
- continue;
1609
- }
1610
- if (t === o.closeParen) {
1598
+ if (u(t)) m++;
1599
+ else if (t === o.openParen) s++, c = !0, d = !1, m++;
1600
+ else if (t === o.closeParen) {
1611
1601
  if (--s < 0) return !1;
1612
1602
  c = !0, d = !1, m++;
1613
- continue;
1614
- }
1615
- if (l(t)) {
1603
+ } else if (l(t)) {
1616
1604
  if (s === 0 && !(t >= 48 && t <= 57)) {
1617
1605
  let n = r[t | 32];
1618
1606
  if (n) {
@@ -1623,16 +1611,16 @@ var Ve = /* @__PURE__ */ f(((e) => {
1623
1611
  m++;
1624
1612
  while (m < i && l(e.charCodeAt(m)));
1625
1613
  c = !0, d = !1;
1626
- continue;
1627
- }
1628
- if (s === 0) {
1629
- if (t === o.semicolon) return !1;
1630
- if (t === o.comma) {
1631
- d = !0, c = !0, m++;
1632
- continue;
1614
+ } else {
1615
+ if (s === 0) {
1616
+ if (t === o.semicolon) return !1;
1617
+ if (t === o.comma) {
1618
+ d = !0, c = !0, m++;
1619
+ continue;
1620
+ }
1633
1621
  }
1622
+ c = !0, d = !1, m++;
1634
1623
  }
1635
- c = !0, d = !1, m++;
1636
1624
  }
1637
1625
  return s === 0 && (!c || d);
1638
1626
  }, g = (e, t = 0) => {
@@ -1757,24 +1745,24 @@ var Ve = /* @__PURE__ */ f(((e) => {
1757
1745
  let n = x + 1, s;
1758
1746
  for (; t.charCodeAt(n) === 63;) n++;
1759
1747
  let S = n - x, C = a[b];
1760
- if (S > 2) {
1761
- x = m(t, n);
1762
- continue;
1748
+ if (S > 2) x = m(t, n);
1749
+ else {
1750
+ if (S === 2) s = (0, e.escapeId)(C);
1751
+ else if (typeof C == "number" || typeof C == "bigint") s = `${C}`;
1752
+ else if (typeof C == "object" && C && !r) {
1753
+ if (!(Array.isArray(C) || C instanceof Uint8Array || C instanceof Date || y(C) || _(C)) && (c(C) || C instanceof Map)) {
1754
+ let n = x - 1;
1755
+ for (; n >= v && u(t.charCodeAt(n));) n--;
1756
+ let r = n >= v ? d(t.charCodeAt(n)) : 0;
1757
+ if ((r < 97 || r > 122) && r !== o.comma) s = (0, e.escape)(C, !0, i);
1758
+ else {
1759
+ for (l === -2 && (l = g(t), f = l === -1 ? -1 : g(t, l)); f !== -1 && f <= x;) l = f, f = g(t, f);
1760
+ s = l !== -1 && l <= x && h(t, l, x) ? (0, e.objectToValues)(C, i) : (0, e.escape)(C, !0, i);
1761
+ }
1762
+ } else s = (0, e.escape)(C, !0, i);
1763
+ } else s = (0, e.escape)(C, r, i);
1764
+ p += t.slice(v, x), p += s, v = n, b++, x = m(t, n);
1763
1765
  }
1764
- if (S === 2) s = (0, e.escapeId)(C);
1765
- else if (typeof C == "number" || typeof C == "bigint") s = `${C}`;
1766
- else if (typeof C == "object" && C && !r) if (!(Array.isArray(C) || C instanceof Uint8Array || C instanceof Date || y(C) || _(C)) && (c(C) || C instanceof Map)) {
1767
- let n = x - 1;
1768
- for (; n >= v && u(t.charCodeAt(n));) n--;
1769
- let r = n >= v ? d(t.charCodeAt(n)) : 0;
1770
- if ((r < 97 || r > 122) && r !== o.comma) s = (0, e.escape)(C, !0, i);
1771
- else {
1772
- for (l === -2 && (l = g(t), f = l === -1 ? -1 : g(t, l)); f !== -1 && f <= x;) l = f, f = g(t, f);
1773
- s = l !== -1 && l <= x && h(t, l, x) ? (0, e.objectToValues)(C, i) : (0, e.escape)(C, !0, i);
1774
- }
1775
- } else s = (0, e.escape)(C, !0, i);
1776
- else s = (0, e.escape)(C, r, i);
1777
- p += t.slice(v, x), p += s, v = n, b++, x = m(t, n);
1778
1766
  }
1779
1767
  return v === 0 ? t : v < t.length ? p + t.slice(v) : p;
1780
1768
  }, e.raw = (e) => {
@@ -2154,7 +2142,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
2154
2142
  }
2155
2143
  var l = [], u = !1, d, f = -1;
2156
2144
  function p() {
2157
- !u || !d || (u = !1, d.length ? l = d.concat(l) : f = -1, l.length && m());
2145
+ u && d && (u = !1, d.length ? l = d.concat(l) : f = -1, l.length && m());
2158
2146
  }
2159
2147
  function m() {
2160
2148
  if (!u) {
@@ -2290,21 +2278,24 @@ var Ve = /* @__PURE__ */ f(((e) => {
2290
2278
  var n = e;
2291
2279
  if (n === (n | 0)) {
2292
2280
  var r = this.size();
2293
- if (n < 0 && (n += r), !(n > r)) if (arguments.length > 2) {
2294
- var i, a, o, s = arguments.length, c = this._list.length, l = 2;
2295
- if (!r || n < r / 2) {
2296
- for (a = Array(n), i = 0; i < n; i++) a[i] = this._list[this._head + i & this._capacityMask];
2297
- for (t === 0 ? (o = [], n > 0 && (this._head = this._head + n + c & this._capacityMask)) : (o = this.remove(n, t), this._head = this._head + n + c & this._capacityMask); s > l;) this.unshift(arguments[--s]);
2298
- for (i = n; i > 0; i--) this.unshift(a[i - 1]);
2299
- } else {
2300
- a = Array(r - (n + t));
2301
- var u = a.length;
2302
- for (i = 0; i < u; i++) a[i] = this._list[this._head + n + t + i & this._capacityMask];
2303
- for (t === 0 ? (o = [], n != r && (this._tail = this._head + n + c & this._capacityMask)) : (o = this.remove(n, t), this._tail = this._tail - u + c & this._capacityMask); l < s;) this.push(arguments[l++]);
2304
- for (i = 0; i < u; i++) this.push(a[i]);
2281
+ if (n < 0 && (n += r), !(n > r)) {
2282
+ if (arguments.length > 2) {
2283
+ var i, a, o, s = arguments.length, c = this._list.length, l = 2;
2284
+ if (!r || n < r / 2) {
2285
+ for (a = Array(n), i = 0; i < n; i++) a[i] = this._list[this._head + i & this._capacityMask];
2286
+ for (t === 0 ? (o = [], n > 0 && (this._head = this._head + n + c & this._capacityMask)) : (o = this.remove(n, t), this._head = this._head + n + c & this._capacityMask); s > l;) this.unshift(arguments[--s]);
2287
+ for (i = n; i > 0; i--) this.unshift(a[i - 1]);
2288
+ } else {
2289
+ a = Array(r - (n + t));
2290
+ var u = a.length;
2291
+ for (i = 0; i < u; i++) a[i] = this._list[this._head + n + t + i & this._capacityMask];
2292
+ for (t === 0 ? (o = [], n != r && (this._tail = this._head + n + c & this._capacityMask)) : (o = this.remove(n, t), this._tail = this._tail - u + c & this._capacityMask); l < s;) this.push(arguments[l++]);
2293
+ for (i = 0; i < u; i++) this.push(a[i]);
2294
+ }
2295
+ return o;
2305
2296
  }
2306
- return o;
2307
- } else return this.remove(n, t);
2297
+ return this.remove(n, t);
2298
+ }
2308
2299
  }
2309
2300
  }, n.prototype.clear = function() {
2310
2301
  this._list = Array(this._list.length), this._head = 0, this._tail = 0;
@@ -2724,10 +2715,13 @@ var Ve = /* @__PURE__ */ f(((e) => {
2724
2715
  }, E.toString = function(e) {
2725
2716
  if (e ||= 10, e < 2 || 36 < e) throw RangeError("radix");
2726
2717
  if (this.isZero()) return "0";
2727
- if (this.isNegative()) if (this.eq(T)) {
2728
- var t = c(e), n = this.div(t), r = n.mul(t).sub(this);
2729
- return n.toString(e) + r.toInt().toString(e);
2730
- } else return "-" + this.neg().toString(e);
2718
+ if (this.isNegative()) {
2719
+ if (this.eq(T)) {
2720
+ var t = c(e), n = this.div(t), r = n.mul(t).sub(this);
2721
+ return n.toString(e) + r.toInt().toString(e);
2722
+ }
2723
+ return "-" + this.neg().toString(e);
2724
+ }
2731
2725
  for (var i = c(u(e, 6), this.unsigned), a = this, o = "";;) {
2732
2726
  var s = a.div(i), l = (a.sub(s.mul(i)).toInt() >>> 0).toString(e);
2733
2727
  if (a = s, a.isZero()) return l + o;
@@ -2748,7 +2742,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
2748
2742
  return this.high == 0 ? t + 1 : t + 33;
2749
2743
  }, E.isSafeInteger = function() {
2750
2744
  var e = this.high >> 21;
2751
- return e ? this.unsigned ? !1 : e === -1 && !(this.low === 0 && this.high === -2097152) : !0;
2745
+ return !e || !this.unsigned && e === -1 && (this.low !== 0 || this.high !== -2097152);
2752
2746
  }, E.isZero = function() {
2753
2747
  return this.high === 0 && this.low === 0;
2754
2748
  }, E.eqz = E.isZero, E.isNegative = function() {
@@ -2758,7 +2752,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
2758
2752
  }, E.isOdd = function() {
2759
2753
  return (this.low & 1) == 1;
2760
2754
  }, E.isEven = function() {
2761
- return (this.low & 1) == 0;
2755
+ return !(this.low & 1);
2762
2756
  }, E.equals = function(e) {
2763
2757
  return r(e) || (e = f(e)), this.unsigned !== e.unsigned && this.high >>> 31 == 1 && e.high >>> 31 == 1 ? !1 : this.high === e.high && this.low === e.low;
2764
2758
  }, E.eq = E.equals, E.notEquals = function(e) {
@@ -2889,9 +2883,9 @@ var Ve = /* @__PURE__ */ f(((e) => {
2889
2883
  });
2890
2884
  })), V = /* @__PURE__ */ f(((e, t) => {
2891
2885
  var n = Ue(), r = n.Buffer, i = {}, a;
2892
- for (a in n) n.hasOwnProperty(a) && (a === "SlowBuffer" || a === "Buffer" || (i[a] = n[a]));
2886
+ for (a in n) n.hasOwnProperty(a) && a !== "SlowBuffer" && a !== "Buffer" && (i[a] = n[a]);
2893
2887
  var o = i.Buffer = {};
2894
- for (a in r) r.hasOwnProperty(a) && (a === "allocUnsafe" || a === "allocUnsafeSlow" || (o[a] = r[a]));
2888
+ for (a in r) r.hasOwnProperty(a) && a !== "allocUnsafe" && a !== "allocUnsafeSlow" && (o[a] = r[a]);
2895
2889
  if (i.Buffer.prototype = r.prototype, (!o.from || o.from === Uint8Array.from) && (o.from = function(e, t, n) {
2896
2890
  if (typeof e == "number") throw TypeError("The \"value\" argument must not be of type number. Received type " + typeof e);
2897
2891
  if (e && e.length === void 0) throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof e);
@@ -2906,23 +2900,22 @@ var Ve = /* @__PURE__ */ f(((e) => {
2906
2900
  } catch {}
2907
2901
  i.constants || (i.constants = { MAX_LENGTH: i.kMaxLength }, i.kStringMaxLength && (i.constants.MAX_STRING_LENGTH = i.kStringMaxLength)), t.exports = i;
2908
2902
  })), Xe = /* @__PURE__ */ f(((e) => {
2909
- var t = "";
2910
- e.PrependBOM = n;
2911
- function n(e, t) {
2903
+ e.PrependBOM = t;
2904
+ function t(e, t) {
2912
2905
  this.encoder = e, this.addBOM = !0;
2913
2906
  }
2914
- n.prototype.write = function(e) {
2915
- return this.addBOM &&= (e = t + e, !1), this.encoder.write(e);
2916
- }, n.prototype.end = function() {
2907
+ t.prototype.write = function(e) {
2908
+ return this.addBOM &&= (e = "" + e, !1), this.encoder.write(e);
2909
+ }, t.prototype.end = function() {
2917
2910
  return this.encoder.end();
2918
- }, e.StripBOM = r;
2919
- function r(e, t) {
2911
+ }, e.StripBOM = n;
2912
+ function n(e, t) {
2920
2913
  this.decoder = e, this.pass = !1, this.options = t || {};
2921
2914
  }
2922
- r.prototype.write = function(e) {
2923
- var n = this.decoder.write(e);
2924
- return this.pass || !n ? n : (n[0] === t && (n = n.slice(1), typeof this.options.stripBOM == "function" && this.options.stripBOM()), this.pass = !0, n);
2925
- }, r.prototype.end = function() {
2915
+ n.prototype.write = function(e) {
2916
+ var t = this.decoder.write(e);
2917
+ return this.pass || !t || (t[0] === "" && (t = t.slice(1), typeof this.options.stripBOM == "function" && this.options.stripBOM()), this.pass = !0), t;
2918
+ }, n.prototype.end = function() {
2926
2919
  return this.decoder.end();
2927
2920
  };
2928
2921
  })), Ze = /* @__PURE__ */ f(((e, t) => {
@@ -3158,7 +3151,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
3158
3151
  l.prototype.write = function(e) {
3159
3152
  for (var t = this.acc, n = this.contBytes, r = this.accBytes, i = "", a = 0; a < e.length; a++) {
3160
3153
  var o = e[a];
3161
- (o & 192) == 128 ? n > 0 ? (t = t << 6 | o & 63, n--, r++, n === 0 && (r === 2 && t < 128 && t > 0 || r === 3 && t < 2048 ? i += this.defaultCharUnicode : i += String.fromCharCode(t))) : i += this.defaultCharUnicode : (n > 0 && (i += this.defaultCharUnicode, n = 0), o < 128 ? i += String.fromCharCode(o) : o < 224 ? (t = o & 31, n = 1, r = 1) : o < 240 ? (t = o & 15, n = 2, r = 1) : i += this.defaultCharUnicode);
3154
+ (o & 192) == 128 ? n > 0 ? (t = t << 6 | o & 63, n--, r++, n === 0 && (i += r === 2 && t < 128 && t > 0 || r === 3 && t < 2048 ? this.defaultCharUnicode : String.fromCharCode(t))) : i += this.defaultCharUnicode : (n > 0 && (i += this.defaultCharUnicode, n = 0), o < 128 ? i += String.fromCharCode(o) : o < 224 ? (t = o & 31, n = 1, r = 1) : o < 240 ? (t = o & 15, n = 2, r = 1) : i += this.defaultCharUnicode);
3162
3155
  }
3163
3156
  return this.acc = t, this.contBytes = n, this.accBytes = r, i;
3164
3157
  }, l.prototype.end = function() {
@@ -3199,11 +3192,13 @@ var Ve = /* @__PURE__ */ f(((e) => {
3199
3192
  r.prototype.write = function(e) {
3200
3193
  for (var n = t.from(e, "ucs2"), r = t.alloc(n.length * 2 + 4), i = this.isLE ? r.writeUInt32LE : r.writeUInt32BE, a = 0, o = 0; o < n.length; o += 2) {
3201
3194
  var s = n.readUInt16LE(o), c = s >= 55296 && s < 56320, l = s >= 56320 && s < 57344;
3202
- if (this.highSurrogate) if (c || !l) i.call(r, this.highSurrogate, a), a += 4;
3203
- else {
3204
- var u = (this.highSurrogate - 55296 << 10 | s - 56320) + 65536;
3205
- i.call(r, u, a), a += 4, this.highSurrogate = 0;
3206
- continue;
3195
+ if (this.highSurrogate) {
3196
+ if (c || !l) i.call(r, this.highSurrogate, a), a += 4;
3197
+ else {
3198
+ var u = (this.highSurrogate - 55296 << 10 | s - 56320) + 65536;
3199
+ i.call(r, u, a), a += 4, this.highSurrogate = 0;
3200
+ continue;
3201
+ }
3207
3202
  }
3208
3203
  c ? this.highSurrogate = s : (i.call(r, s, a), a += 4, this.highSurrogate = 0);
3209
3204
  }
@@ -4145,14 +4140,16 @@ var Ve = /* @__PURE__ */ f(((e) => {
4145
4140
  }, l.prototype._fillEncodeTable = function(e, t, n) {
4146
4141
  for (var r = this.decodeTables[e], o = !1, s = {}, c = 0; c < 256; c++) {
4147
4142
  var l = r[c], u = t + c;
4148
- if (!n[u]) if (l >= 0) this._setEncodeChar(l, u), o = !0;
4149
- else if (l <= a) {
4150
- var d = a - l;
4151
- if (!s[d]) {
4152
- var f = u << 8 >>> 0;
4153
- this._fillEncodeTable(d, f, n) ? o = !0 : s[d] = !0;
4154
- }
4155
- } else l <= i && (this._setEncodeSequence(this.decodeTableSeq[i - l], u), o = !0);
4143
+ if (!n[u]) {
4144
+ if (l >= 0) this._setEncodeChar(l, u), o = !0;
4145
+ else if (l <= a) {
4146
+ var d = a - l;
4147
+ if (!s[d]) {
4148
+ var f = u << 8 >>> 0;
4149
+ this._fillEncodeTable(d, f, n) ? o = !0 : s[d] = !0;
4150
+ }
4151
+ } else l <= i && (this._setEncodeSequence(this.decodeTableSeq[i - l], u), o = !0);
4152
+ }
4156
4153
  }
4157
4154
  return o;
4158
4155
  };
@@ -4168,20 +4165,23 @@ var Ve = /* @__PURE__ */ f(((e) => {
4168
4165
  var d = c;
4169
4166
  c = -1;
4170
4167
  }
4171
- if (d >= 55296 && d < 57344) if (d < 56320) if (a === -1) {
4172
- a = d;
4173
- continue;
4174
- } else a = d, d = n;
4175
- else a === -1 ? d = n : (d = 65536 + (a - 55296) * 1024 + (d - 56320), a = -1);
4176
- else a !== -1 && (c = d, d = n, a = -1);
4168
+ if (d >= 55296 && d < 57344) {
4169
+ if (d < 56320) {
4170
+ if (a === -1) {
4171
+ a = d;
4172
+ continue;
4173
+ }
4174
+ a = d, d = n;
4175
+ } else a === -1 ? d = n : (d = 65536 + (a - 55296) * 1024 + (d - 56320), a = -1);
4176
+ } else a !== -1 && (c = d, d = n, a = -1);
4177
4177
  var p = n;
4178
4178
  if (o !== void 0 && d != n) {
4179
4179
  var m = o[d];
4180
4180
  if (typeof m == "object") {
4181
4181
  o = m;
4182
4182
  continue;
4183
- } else typeof m == "number" ? p = m : m ?? (m = o[s], m !== void 0 && (p = m, c = d));
4184
- o = void 0;
4183
+ }
4184
+ typeof m == "number" ? p = m : m ?? (m = o[s], m !== void 0 && (p = m, c = d)), o = void 0;
4185
4185
  } else if (d >= 0) {
4186
4186
  var h = this.encodeTable[d >> 8];
4187
4187
  if (h !== void 0 && (p = h[d & 255]), p <= i) {
@@ -4201,7 +4201,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
4201
4201
  }
4202
4202
  return this.seqObj = o, this.leadSurrogate = a, r.slice(0, u);
4203
4203
  }, u.prototype.end = function() {
4204
- if (!(this.leadSurrogate === -1 && this.seqObj === void 0)) {
4204
+ if (this.leadSurrogate !== -1 || this.seqObj !== void 0) {
4205
4205
  var e = t.alloc(10), n = 0;
4206
4206
  if (this.seqObj) {
4207
4207
  var r = this.seqObj[s];
@@ -4216,19 +4216,21 @@ var Ve = /* @__PURE__ */ f(((e) => {
4216
4216
  d.prototype.write = function(e) {
4217
4217
  for (var o = t.alloc(e.length * 2), s = this.nodeIdx, c = this.prevBytes, l = this.prevBytes.length, u = -this.prevBytes.length, d, p = 0, m = 0; p < e.length; p++) {
4218
4218
  var h = p >= 0 ? e[p] : c[p + l], d = this.decodeTables[s][h];
4219
- if (!(d >= 0)) if (d === n) d = this.defaultCharUnicode.charCodeAt(0), p = u;
4220
- else if (d === r) {
4221
- if (p >= 3) var g = (e[p - 3] - 129) * 12600 + (e[p - 2] - 48) * 1260 + (e[p - 1] - 129) * 10 + (h - 48);
4222
- else var g = (c[p - 3 + l] - 129) * 12600 + ((p - 2 >= 0 ? e[p - 2] : c[p - 2 + l]) - 48) * 1260 + ((p - 1 >= 0 ? e[p - 1] : c[p - 1 + l]) - 129) * 10 + (h - 48);
4223
- var _ = f(this.gb18030.gbChars, g);
4224
- d = this.gb18030.uChars[_] + g - this.gb18030.gbChars[_];
4225
- } else if (d <= a) {
4226
- s = a - d;
4227
- continue;
4228
- } else if (d <= i) {
4229
- for (var v = this.decodeTableSeq[i - d], y = 0; y < v.length - 1; y++) d = v[y], o[m++] = d & 255, o[m++] = d >> 8;
4230
- d = v[v.length - 1];
4231
- } else throw Error("iconv-lite internal error: invalid decoding table value " + d + " at " + s + "/" + h);
4219
+ if (!(d >= 0)) {
4220
+ if (d === n) d = this.defaultCharUnicode.charCodeAt(0), p = u;
4221
+ else if (d === r) {
4222
+ if (p >= 3) var g = (e[p - 3] - 129) * 12600 + (e[p - 2] - 48) * 1260 + (e[p - 1] - 129) * 10 + (h - 48);
4223
+ else var g = (c[p - 3 + l] - 129) * 12600 + ((p - 2 >= 0 ? e[p - 2] : c[p - 2 + l]) - 48) * 1260 + ((p - 1 >= 0 ? e[p - 1] : c[p - 1 + l]) - 129) * 10 + (h - 48);
4224
+ var _ = f(this.gb18030.gbChars, g);
4225
+ d = this.gb18030.uChars[_] + g - this.gb18030.gbChars[_];
4226
+ } else if (d <= a) {
4227
+ s = a - d;
4228
+ continue;
4229
+ } else if (d <= i) {
4230
+ for (var v = this.decodeTableSeq[i - d], y = 0; y < v.length - 1; y++) d = v[y], o[m++] = d & 255, o[m++] = d >> 8;
4231
+ d = v[v.length - 1];
4232
+ } else throw Error("iconv-lite internal error: invalid decoding table value " + d + " at " + s + "/" + h);
4233
+ }
4232
4234
  if (d >= 65536) {
4233
4235
  d -= 65536;
4234
4236
  var b = 55296 | d >> 10;
@@ -5512,7 +5514,6 @@ var Ve = /* @__PURE__ */ f(((e) => {
5512
5514
  case 7:
5513
5515
  if (t + 4 > n || (u = p ? e.readUInt32LE(t) : e.readUInt32BE(t), t += 4, u > (n - t) / 9)) return null;
5514
5516
  for (f = [], o = u; o > 0; o--) f.push(r());
5515
- break;
5516
5517
  }
5517
5518
  return f;
5518
5519
  }
@@ -5740,9 +5741,11 @@ var Ve = /* @__PURE__ */ f(((e) => {
5740
5741
  return r.offset = 4, r.writeInt8(2), r.writeNullTerminatedString(this.pluginName, e), r.writeBuffer(this.pluginData), r;
5741
5742
  }
5742
5743
  static fromPacket(t, n) {
5743
- return t.readInt8(), new e({
5744
- pluginName: t.readNullTerminatedString(n),
5745
- pluginData: t.readBuffer()
5744
+ t.readInt8();
5745
+ let r = t.readNullTerminatedString(n), i = t.readBuffer();
5746
+ return new e({
5747
+ pluginName: r,
5748
+ pluginData: i
5746
5749
  });
5747
5750
  }
5748
5751
  };
@@ -5757,9 +5760,11 @@ var Ve = /* @__PURE__ */ f(((e) => {
5757
5760
  return t.offset = 4, t.writeInt8(254), t.writeNullTerminatedString(this.pluginName, "cesu8"), t.writeBuffer(this.pluginData), t;
5758
5761
  }
5759
5762
  static fromPacket(t) {
5760
- return t.readInt8(), new e({
5761
- pluginName: t.readNullTerminatedString("cesu8"),
5762
- pluginData: t.readBuffer()
5763
+ t.readInt8();
5764
+ let n = t.readNullTerminatedString("cesu8"), r = t.readBuffer();
5765
+ return new e({
5766
+ pluginName: n,
5767
+ pluginData: r
5763
5768
  });
5764
5769
  }
5765
5770
  };
@@ -5774,7 +5779,9 @@ var Ve = /* @__PURE__ */ f(((e) => {
5774
5779
  return t.offset = 4, t.writeInt8(1), t.writeBuffer(this.data), t;
5775
5780
  }
5776
5781
  static fromPacket(t) {
5777
- return t.readInt8(), new e(t.readBuffer());
5782
+ t.readInt8();
5783
+ let n = t.readBuffer();
5784
+ return new e(n);
5778
5785
  }
5779
5786
  static verifyMarker(e) {
5780
5787
  return e.peekByte() === 1;
@@ -5791,7 +5798,8 @@ var Ve = /* @__PURE__ */ f(((e) => {
5791
5798
  return t.offset = 4, t.writeBuffer(this.data), t;
5792
5799
  }
5793
5800
  static fromPacket(t) {
5794
- return new e(t.readBuffer());
5801
+ let n = t.readBuffer();
5802
+ return new e(n);
5795
5803
  }
5796
5804
  };
5797
5805
  })), Wt = /* @__PURE__ */ f(((e, t) => {
@@ -5802,11 +5810,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
5802
5810
  static toPacket(e, t) {
5803
5811
  let i = 0;
5804
5812
  e.forEach((e) => {
5805
- if (e == null) {
5806
- ++i;
5807
- return;
5808
- }
5809
- i += r.lengthCodedStringLength(e.toString(10), t);
5813
+ e == null ? ++i : i += r.lengthCodedStringLength(e.toString(10), t);
5810
5814
  }), i += 2;
5811
5815
  let a = new r(0, Buffer.allocUnsafe(i + 4), 0, i + 4);
5812
5816
  a.offset = 4, a.writeInt8(0);
@@ -5814,15 +5818,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
5814
5818
  return e.forEach((e) => {
5815
5819
  e.type === n.NULL && (o += s), s *= 2, s === 256 && (a.writeInt8(o), o = 0, s = 1);
5816
5820
  }), s !== 1 && a.writeInt8(o), e.forEach((e) => {
5817
- if (e === null) {
5818
- a.writeNull();
5819
- return;
5820
- }
5821
- if (e === void 0) {
5822
- a.writeInt8(0);
5823
- return;
5824
- }
5825
- a.writeLengthCodedString(e.toString(10), t);
5821
+ e === null ? a.writeNull() : e === void 0 ? a.writeInt8(0) : a.writeLengthCodedString(e.toString(10), t);
5826
5822
  }), a;
5827
5823
  }
5828
5824
  static fromPacket(t, n) {
@@ -6094,7 +6090,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
6094
6090
  }
6095
6091
  static fromPacket(e, t) {
6096
6092
  let n = e.readInt32(), r = e.readInt8(), i = e.readInt32(), o = e.offset;
6097
- for (; o < e.end - 1 && !((e.buffer[o + 1] === a.VAR_STRING || e.buffer[o + 1] === a.BLOB || e.buffer[o + 1] === a.NULL || e.buffer[o + 1] === a.DOUBLE || e.buffer[o + 1] === a.TINY || e.buffer[o + 1] === a.DATETIME || e.buffer[o + 1] === a.JSON) && e.buffer[o] === 1 && e.buffer[o + 2] === 0);) e.readInt8(), o++;
6093
+ for (; o < e.end - 1 && (e.buffer[o + 1] !== a.VAR_STRING && e.buffer[o + 1] !== a.BLOB && e.buffer[o + 1] !== a.NULL && e.buffer[o + 1] !== a.DOUBLE && e.buffer[o + 1] !== a.TINY && e.buffer[o + 1] !== a.DATETIME && e.buffer[o + 1] !== a.JSON || e.buffer[o] !== 1 || e.buffer[o + 2] !== 0);) e.readInt8(), o++;
6098
6094
  let s = [];
6099
6095
  for (let t = e.offset + 1; t < e.end - 1; t++) (e.buffer[t] === a.VAR_STRING || e.buffer[t] === a.BLOB || e.buffer[t] === a.NULL || e.buffer[t] === a.DOUBLE || e.buffer[t] === a.TINY || e.buffer[t] === a.DATETIME || e.buffer[t] === a.JSON) && e.buffer[t + 1] === 0 && (s.push(e.buffer[t]), e.skip(2));
6100
6096
  e.skip(1);
@@ -6139,11 +6135,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
6139
6135
  }
6140
6136
  setScrambleData(e) {
6141
6137
  g("crypto").randomBytes(20, (t, n) => {
6142
- if (t) {
6143
- e(t);
6144
- return;
6145
- }
6146
- this.authPluginData1 = n.slice(0, 8), this.authPluginData2 = n.slice(8, 20), e();
6138
+ t ? e(t) : (this.authPluginData1 = n.slice(0, 8), this.authPluginData2 = n.slice(8, 20), e());
6147
6139
  });
6148
6140
  }
6149
6141
  toPacket(e) {
@@ -6379,7 +6371,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
6379
6371
  } else this.info = e.readString(void 0, s);
6380
6372
  u && (this.stateChanges = u);
6381
6373
  let d = this.info.match(/\schanged:\s*(\d+)/i);
6382
- d === null ? this.changedRows = 0 : this.changedRows = parseInt(d[1], 10);
6374
+ this.changedRows = d === null ? 0 : parseInt(d[1], 10);
6383
6375
  }
6384
6376
  static toPacket(e, t) {
6385
6377
  let r = 4 + n.lengthCodedNumberLength(e);
@@ -6413,23 +6405,11 @@ var Ve = /* @__PURE__ */ f(((e) => {
6413
6405
  static toPacket(e, t) {
6414
6406
  let r = 0;
6415
6407
  e.forEach((e) => {
6416
- if (e == null) {
6417
- ++r;
6418
- return;
6419
- }
6420
- r += n.lengthCodedStringLength(e.toString(10), t);
6408
+ e == null ? ++r : r += n.lengthCodedStringLength(e.toString(10), t);
6421
6409
  });
6422
6410
  let i = new n(0, Buffer.allocUnsafe(r + 4), 0, r + 4);
6423
6411
  return i.offset = 4, e.forEach((e) => {
6424
- if (e === null) {
6425
- i.writeNull();
6426
- return;
6427
- }
6428
- if (e === void 0) {
6429
- i.writeInt8(0);
6430
- return;
6431
- }
6432
- i.writeLengthCodedString(e.toString(10), t);
6412
+ e === null ? i.writeNull() : e === void 0 ? i.writeInt8(0) : i.writeLengthCodedString(e.toString(10), t);
6433
6413
  }), i;
6434
6414
  }
6435
6415
  };
@@ -6509,7 +6489,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
6509
6489
  let n = e.asError(t.clientEncoding);
6510
6490
  return n.sql = this.sql || this.query, this.queryTimeout &&= (r.clearTimeout(this.queryTimeout), null), this.onResult ? (this.onResult(n), this.emit("end")) : (this.emit("error", n), this.emit("end")), !0;
6511
6491
  }
6512
- return this.next = this.next(e, t), this.next ? !1 : (this.emit("end"), !0);
6492
+ return this.next = this.next(e, t), !this.next && (this.emit("end"), !0);
6513
6493
  }
6514
6494
  };
6515
6495
  })), pn = /* @__PURE__ */ f(((e) => {
@@ -6646,14 +6626,14 @@ var Ve = /* @__PURE__ */ f(((e) => {
6646
6626
  if (e) return u(e, r);
6647
6627
  t.writePacket(new n.AuthSwitchResponse(i).toPacket());
6648
6628
  });
6649
- return;
6629
+ } else {
6630
+ if (!t._authPlugin) throw Error("AuthPluginMoreData received but no auth plugin instance found");
6631
+ Promise.resolve(t._authPlugin(i)).then((e) => {
6632
+ e && t.writePacket(new n.AuthSwitchResponse(e).toPacket());
6633
+ }).catch((e) => {
6634
+ u(e, r);
6635
+ });
6650
6636
  }
6651
- if (!t._authPlugin) throw Error("AuthPluginMoreData received but no auth plugin instance found");
6652
- Promise.resolve(t._authPlugin(i)).then((e) => {
6653
- e && t.writePacket(new n.AuthSwitchResponse(e).toPacket());
6654
- }).catch((e) => {
6655
- u(e, r);
6656
- });
6657
6637
  }
6658
6638
  t.exports = {
6659
6639
  authSwitchRequest: d,
@@ -6671,11 +6651,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
6671
6651
  }
6672
6652
  _next() {
6673
6653
  let e = this._queue.shift();
6674
- if (!e) {
6675
- this._running = !1;
6676
- return;
6677
- }
6678
- e({ done: () => process.nextTick(() => this._next()) });
6654
+ e ? e({ done: () => process.nextTick(() => this._next()) }) : this._running = !1;
6679
6655
  }
6680
6656
  };
6681
6657
  function a(e) {
@@ -6684,11 +6660,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
6684
6660
  t._bumpCompressedSequenceId(e.numPackets), t._inflatedPacketsParser.execute(i), n.done();
6685
6661
  }) : t.inflateQueue.push((a) => {
6686
6662
  n.inflate(i, { maxOutputLength: r }, (n, r) => {
6687
- if (n) {
6688
- t._handleNetworkError(n);
6689
- return;
6690
- }
6691
- t._bumpCompressedSequenceId(e.numPackets), t._inflatedPacketsParser.execute(r), a.done();
6663
+ n ? t._handleNetworkError(n) : (t._bumpCompressedSequenceId(e.numPackets), t._inflatedPacketsParser.execute(r), a.done());
6692
6664
  });
6693
6665
  });
6694
6666
  }
@@ -6814,11 +6786,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
6814
6786
  return e.code = "HANDSHAKE_NO_SSL_SUPPORT", e.fatal = !0, this.emit("error", e), !1;
6815
6787
  }
6816
6788
  this.clientFlags |= i.SSL, this.sendSSLRequest(n), n.startTLS((e) => {
6817
- if (e) {
6818
- e.code = "HANDSHAKE_SSL_ERROR", e.fatal = !0, this.emit("error", e);
6819
- return;
6820
- }
6821
- this.sendCredentials(n);
6789
+ e ? (e.code = "HANDSHAKE_SSL_ERROR", e.fatal = !0, this.emit("error", e)) : this.sendCredentials(n);
6822
6790
  });
6823
6791
  } else this.sendCredentials(n);
6824
6792
  return c && (this.authenticationFactor = 1), e.prototype.handshakeResult;
@@ -6853,11 +6821,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
6853
6821
  start(t, n) {
6854
6822
  let r = new a.Handshake(this.args);
6855
6823
  return this.serverHello = r, r.setScrambleData((e) => {
6856
- if (e) {
6857
- n.emit("error", /* @__PURE__ */ Error("Error generating random bytes"));
6858
- return;
6859
- }
6860
- n.writePacket(r.toPacket(0));
6824
+ e ? n.emit("error", /* @__PURE__ */ Error("Error generating random bytes")) : n.writePacket(r.toPacket(0));
6861
6825
  }), e.prototype.readClientReply;
6862
6826
  }
6863
6827
  readClientReply(t, n) {
@@ -6956,7 +6920,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
6956
6920
  return Array.isArray(t) ? t.some((t) => e === n[t]) : !!t;
6957
6921
  }
6958
6922
  e.typeMatch = a;
6959
- var o = new Set([
6923
+ var o = /* @__PURE__ */ new Set([
6960
6924
  "__defineGetter__",
6961
6925
  "__defineSetter__",
6962
6926
  "__lookupGetter__",
@@ -6991,19 +6955,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
6991
6955
  for (var r = ""; r.length < t * 2;) r += " ";
6992
6956
  e.push(r + n);
6993
6957
  }, c = function(e) {
6994
- if (a.test(e.trim()[0]) && i.test(e[e.length - 1])) {
6995
- t--, s(e), t++;
6996
- return;
6997
- }
6998
- if (i.test(e[e.length - 1])) {
6999
- s(e), t++;
7000
- return;
7001
- }
7002
- if (a.test(e.trim()[0])) {
7003
- t--, s(e);
7004
- return;
7005
- }
7006
- s(e);
6958
+ a.test(e.trim()[0]) && i.test(e[e.length - 1]) ? (t--, s(e), t++) : i.test(e[e.length - 1]) ? (s(e), t++) : (a.test(e.trim()[0]) && t--, s(e));
7007
6959
  }, d = function(e) {
7008
6960
  if (!e) return d;
7009
6961
  if (arguments.length === 1 && e.indexOf("\n") > -1) for (var t = e.trim().split("\n"), r = 0; r < t.length; r++) c(t[r].trim());
@@ -7234,7 +7186,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
7234
7186
  }
7235
7187
  if (this._receivedFieldsCount === this._fieldCount) {
7236
7188
  let t = this._fields[this._resultIndex];
7237
- return this.emit("fields", t), this.options.disableEval ? this._rowParser = c(t, this.options, n.config) : this._rowParser = new (s(t, this.options, n.config))(t), e.prototype.fieldsEOF;
7189
+ return this.emit("fields", t), this._rowParser = this.options.disableEval ? c(t, this.options, n.config) : new (s(t, this.options, n.config))(t), e.prototype.fieldsEOF;
7238
7190
  }
7239
7191
  return e.prototype.readField;
7240
7192
  }
@@ -8000,7 +7952,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
8000
7952
  for (let e in n) Object.prototype.hasOwnProperty.call(n, e) && (t[e] || (t[e] = n[e]));
8001
7953
  }
8002
7954
  for (let e in t) Object.prototype.hasOwnProperty.call(t, e) && s[e] !== 1 && console.error(`Ignoring invalid configuration option passed to Connection: ${e}. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection`);
8003
- if (this.isServer = t.isServer, this.stream = t.stream, this.host = t.host || "localhost", this.port = (typeof t.port == "string" ? parseInt(t.port, 10) : t.port) || 3306, this.localAddress = t.localAddress, this.socketPath = t.socketPath, this.user = t.user || void 0, this.password = t.password || t.password1 || void 0, this.password2 = t.password2 || void 0, this.password3 = t.password3 || void 0, this.passwordSha1 = t.passwordSha1 || void 0, this.database = t.database, this.connectTimeout = isNaN(t.connectTimeout) ? 10 * 1e3 : t.connectTimeout, this.insecureAuth = t.insecureAuth || !1, this.infileStreamFactory = t.infileStreamFactory || void 0, this.supportBigNumbers = t.supportBigNumbers || !1, this.bigNumberStrings = t.bigNumberStrings || !1, this.decimalNumbers = t.decimalNumbers || !1, this.dateStrings = t.dateStrings || !1, this.debug = t.debug, this.trace = t.trace !== !1, this.stringifyObjects = t.stringifyObjects || !1, this.enableKeepAlive = t.enableKeepAlive !== !1, this.keepAliveInitialDelay = t.keepAliveInitialDelay, t.timezone && !/^(?:local|Z|[ +-]\d\d:\d\d)$/.test(t.timezone) ? (console.error(`Ignoring invalid timezone passed to Connection: ${t.timezone}. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection`), this.timezone = "Z") : this.timezone = t.timezone || "local", this.queryFormat = t.queryFormat, this.pool = t.pool || void 0, this.ssl = typeof t.ssl == "string" ? e.getSSLProfile(t.ssl) : t.ssl || !1, this.multipleStatements = t.multipleStatements || !1, this.rowsAsArray = t.rowsAsArray || !1, this.namedPlaceholders = t.namedPlaceholders || !1, this.nestTables = t.nestTables === void 0 ? void 0 : t.nestTables, this.typeCast = t.typeCast === void 0 ? !0 : t.typeCast, this.disableEval = !!t.disableEval, this.enableCleartextPlugin = !!t.enableCleartextPlugin, this.timezone[0] === " " && (this.timezone = `+${this.timezone.slice(1)}`), this.ssl) {
7955
+ if (this.isServer = t.isServer, this.stream = t.stream, this.host = t.host || "localhost", this.port = (typeof t.port == "string" ? parseInt(t.port, 10) : t.port) || 3306, this.localAddress = t.localAddress, this.socketPath = t.socketPath, this.user = t.user || void 0, this.password = t.password || t.password1 || void 0, this.password2 = t.password2 || void 0, this.password3 = t.password3 || void 0, this.passwordSha1 = t.passwordSha1 || void 0, this.database = t.database, this.connectTimeout = isNaN(t.connectTimeout) ? 1e4 : t.connectTimeout, this.insecureAuth = t.insecureAuth || !1, this.infileStreamFactory = t.infileStreamFactory || void 0, this.supportBigNumbers = t.supportBigNumbers || !1, this.bigNumberStrings = t.bigNumberStrings || !1, this.decimalNumbers = t.decimalNumbers || !1, this.dateStrings = t.dateStrings || !1, this.debug = t.debug, this.trace = t.trace !== !1, this.stringifyObjects = t.stringifyObjects || !1, this.enableKeepAlive = t.enableKeepAlive !== !1, this.keepAliveInitialDelay = t.keepAliveInitialDelay, t.timezone && !/^(?:local|Z|[ +-]\d\d:\d\d)$/.test(t.timezone) ? (console.error(`Ignoring invalid timezone passed to Connection: ${t.timezone}. This is currently a warning, but in future versions of MySQL2, an error will be thrown if you pass an invalid configuration option to a Connection`), this.timezone = "Z") : this.timezone = t.timezone || "local", this.queryFormat = t.queryFormat, this.pool = t.pool || void 0, this.ssl = typeof t.ssl == "string" ? e.getSSLProfile(t.ssl) : t.ssl || !1, this.multipleStatements = t.multipleStatements || !1, this.rowsAsArray = t.rowsAsArray || !1, this.namedPlaceholders = t.namedPlaceholders || !1, this.nestTables = t.nestTables === void 0 ? void 0 : t.nestTables, this.typeCast = t.typeCast === void 0 || t.typeCast, this.disableEval = !!t.disableEval, this.enableCleartextPlugin = !!t.enableCleartextPlugin, this.timezone[0] === " " && (this.timezone = `+${this.timezone.slice(1)}`), this.ssl) {
8004
7956
  if (typeof this.ssl != "object") throw TypeError(`SSL profile must be an object, instead it's a ${typeof this.ssl}`);
8005
7957
  this.ssl.rejectUnauthorized = this.ssl.rejectUnauthorized !== !1;
8006
7958
  }
@@ -8110,39 +8062,39 @@ var Ve = /* @__PURE__ */ f(((e) => {
8110
8062
  tracePromise: f
8111
8063
  };
8112
8064
  })), mr = /* @__PURE__ */ f(((e, t) => {
8113
- var n = /(?:\?)|(?::(\d+|(?:[a-zA-Z][a-zA-Z0-9_]*)))/g, r = 34, i = 39, a = 92;
8114
- function o(e) {
8115
- let t = n.exec(e), o = 0, s = 0, c, l = [], u = !1, d = !1, f, p = [], m = 0, h = 0, g;
8065
+ var n = /(?:\?)|(?::(\d+|(?:[a-zA-Z][a-zA-Z0-9_]*)))/g;
8066
+ function r(e) {
8067
+ let t = n.exec(e), r = 0, i = 0, a, o = [], s = !1, c = !1, l, u = [], d = 0, f = 0, p;
8116
8068
  if (t) {
8117
8069
  do {
8118
- for (g = o, c = t.index; g < c; ++g) {
8119
- let t = e.charCodeAt(g);
8120
- if (t === a) d = !d;
8070
+ for (p = r, a = t.index; p < a; ++p) {
8071
+ let t = e.charCodeAt(p);
8072
+ if (t === 92) c = !c;
8121
8073
  else {
8122
- if (d) {
8123
- d = !1;
8074
+ if (c) {
8075
+ c = !1;
8124
8076
  continue;
8125
8077
  }
8126
- if (u && t === f) {
8127
- if (e.charCodeAt(g + 1) === f) {
8128
- ++g;
8078
+ if (s && t === l) {
8079
+ if (e.charCodeAt(p + 1) === l) {
8080
+ ++p;
8129
8081
  continue;
8130
8082
  }
8131
- u = !1;
8132
- } else !u && (t === r || t === i) && (u = !0, f = t);
8083
+ s = !1;
8084
+ } else !s && (t === 34 || t === 39) && (s = !0, l = t);
8133
8085
  }
8134
8086
  }
8135
- u || (l.push(e.substring(s, c)), p.push(t[0].length === 1 ? m++ : t[1]), s = c + t[0].length, h = s), o = c + t[0].length;
8087
+ s || (o.push(e.substring(i, a)), u.push(t[0].length === 1 ? d++ : t[1]), i = a + t[0].length, f = i), r = a + t[0].length;
8136
8088
  } while (t = n.exec(e));
8137
- if (p.length) return o < e.length && l.push(e.substring(h)), [l, p];
8089
+ if (u.length) return r < e.length && o.push(e.substring(f)), [o, u];
8138
8090
  }
8139
8091
  return [e];
8140
8092
  }
8141
- function s(e) {
8142
- e ||= {}, e.placeholder ||= "?";
8093
+ function i(e) {
8094
+ e ||= {}, e.placeholder || (e.placeholder = "?");
8143
8095
  let t = 100, n;
8144
8096
  typeof e.cache == "number" && (t = e.cache), typeof e.cache == "object" && (n = e.cache), e.cache !== !1 && !n && (n = Ge().createLRU({ max: t }));
8145
- function r(e, t) {
8097
+ function i(e, t) {
8146
8098
  let n = [];
8147
8099
  if (e.length === 1) return [e[0], []];
8148
8100
  if (t === void 0) throw Error("Named query contains placeholders, but parameters object is undefined");
@@ -8150,35 +8102,35 @@ var Ve = /* @__PURE__ */ f(((e) => {
8150
8102
  for (let e = 0; e < r.length; ++e) n.push(t[r[e]]);
8151
8103
  return [e[0], n];
8152
8104
  }
8153
- function i(e) {
8105
+ function a(e) {
8154
8106
  return e.slice(-1) === ":" ? e.slice(0, -1) : e;
8155
8107
  }
8156
- function a(t) {
8108
+ function o(t) {
8157
8109
  if (t.length === 1) return t;
8158
- let n = i(t[0][0]);
8159
- for (let r = 1; r < t[0].length; ++r) t[0][r - 1].slice(-1) === ":" && (n += e.placeholder), n += e.placeholder, n += i(t[0][r]);
8110
+ let n = a(t[0][0]);
8111
+ for (let r = 1; r < t[0].length; ++r) t[0][r - 1].slice(-1) === ":" && (n += e.placeholder), n += e.placeholder, n += a(t[0][r]);
8160
8112
  let r = t[0][t[0].length - 1];
8161
8113
  return t[0].length === t[1].length && (r.slice(-1) === ":" && (n += e.placeholder), n += e.placeholder), [n, t[1]];
8162
8114
  }
8163
8115
  function s(e, t) {
8164
- let i;
8165
- return n && (i = n.get(e)) ? r(i, t) : (i = a(o(e)), n && n.set(e, i), r(i, t));
8116
+ let a;
8117
+ return n && (a = n.get(e)) || (a = o(r(e)), n && n.set(e, a)), i(a, t);
8166
8118
  }
8167
- return s.parse = o, s;
8119
+ return s.parse = r, s;
8168
8120
  }
8169
- function c(e, t) {
8170
- let n = o(e), r = [];
8171
- if (n.length === 1) return [n[0], r];
8172
- let i = {}, a = 0, s = "", c, l = [];
8173
- for (let e = 0; e < n[0].length; ++e) c = i[n[1][e]], c || (c = ++a, i[n[1][e]] = c), n[1][e] ? (l[c - 1] = n[1][e], s += `${n[0][e]}$${c}`) : s += n[0][e];
8121
+ function a(e, t) {
8122
+ let n = r(e), i = [];
8123
+ if (n.length === 1) return [n[0], i];
8124
+ let a = {}, o = 0, s = "", c, l = [];
8125
+ for (let e = 0; e < n[0].length; ++e) c = a[n[1][e]], c || (c = ++o, a[n[1][e]] = c), n[1][e] ? (l[c - 1] = n[1][e], s += `${n[0][e]}$${c}`) : s += n[0][e];
8174
8126
  return [s, l.map((e) => t[e])];
8175
8127
  }
8176
- t.exports = s, t.exports.toNumbered = c;
8128
+ t.exports = i, t.exports.toNumbered = a;
8177
8129
  })), hr = /* @__PURE__ */ f(((e, t) => {
8178
8130
  var n = g("net"), r = g("tls"), i = g("timers"), a = z().EventEmitter, o = g("stream").Readable, s = qe(), c = We(), { createLRU: l } = Ge(), u = zt(), d = J(), f = Bn(), p = dr(), m = q(), { traceCallback: h, tracePromise: _, getServerContext: v, shouldTrace: y, queryChannel: b, executeChannel: x, connectChannel: S } = pr(), C = 0, w = null;
8179
8131
  t.exports = class e extends a {
8180
8132
  constructor(e) {
8181
- super(), this.config = e.config, e.config.stream ? typeof e.config.stream == "function" ? this.stream = e.config.stream(e) : this.stream = e.config.stream : e.config.socketPath ? this.stream = n.connect(e.config.socketPath) : (this.stream = n.connect(e.config.port, e.config.host), this.config.enableKeepAlive && this.stream.on("connect", () => {
8133
+ super(), this.config = e.config, e.config.stream ? this.stream = typeof e.config.stream == "function" ? e.config.stream(e) : e.config.stream : e.config.socketPath ? this.stream = n.connect(e.config.socketPath) : (this.stream = n.connect(e.config.port, e.config.host), this.config.enableKeepAlive && this.stream.on("connect", () => {
8182
8134
  this.stream.setKeepAlive(!0, this.config.keepAliveInitialDelay);
8183
8135
  }), this.stream.setNoDelay(!0)), this._internalId = C++, this._commands = new s(), this._command = null, this._paused = !1, this._paused_packets = new s(), this._statements = l({
8184
8136
  max: this.config.maxPreparedStatements,
@@ -8331,39 +8283,38 @@ var Ve = /* @__PURE__ */ f(((e) => {
8331
8283
  return this._fatalError;
8332
8284
  }
8333
8285
  handlePacket(e) {
8334
- if (this._paused) {
8335
- this._paused_packets.push(e);
8336
- return;
8337
- }
8338
- if (this.config.debug && e) {
8339
- console.log(` raw: ${e.buffer.slice(e.offset, e.offset + e.length()).toString("hex")}`), console.trace();
8340
- let t = this._command ? this._command._commandName : "(no command)", n = this._command ? this._command.stateName() : "(no command)";
8341
- console.log(`${this._internalId} ${this.connectionId} ==> ${t}#${n}(${[
8342
- e.sequenceId,
8343
- e.type(),
8344
- e.length()
8345
- ].join(",")})`);
8346
- }
8347
- if (!this._command) {
8348
- if (e.peekByte() === 255) {
8349
- let t = d.Error.fromPacket(e);
8350
- this.protocolError(t.message, t.code);
8351
- } else this.protocolError("Unexpected packet while no commands in the queue", "PROTOCOL_UNEXPECTED_PACKET");
8352
- this.close();
8353
- return;
8354
- }
8355
- if (e) {
8356
- if (this.sequenceId !== e.sequenceId) {
8357
- let t = /* @__PURE__ */ Error(`Warning: got packets out of order. Expected ${this.sequenceId} but received ${e.sequenceId}`);
8358
- t.expected = this.sequenceId, t.received = e.sequenceId, this.emit("warn", t), console.error(t.message);
8286
+ if (this._paused) this._paused_packets.push(e);
8287
+ else {
8288
+ if (this.config.debug && e) {
8289
+ console.log(` raw: ${e.buffer.slice(e.offset, e.offset + e.length()).toString("hex")}`), console.trace();
8290
+ let t = this._command ? this._command._commandName : "(no command)", n = this._command ? this._command.stateName() : "(no command)";
8291
+ console.log(`${this._internalId} ${this.connectionId} ==> ${t}#${n}(${[
8292
+ e.sequenceId,
8293
+ e.type(),
8294
+ e.length()
8295
+ ].join(",")})`);
8296
+ }
8297
+ if (this._command) {
8298
+ if (e) {
8299
+ if (this.sequenceId !== e.sequenceId) {
8300
+ let t = /* @__PURE__ */ Error(`Warning: got packets out of order. Expected ${this.sequenceId} but received ${e.sequenceId}`);
8301
+ t.expected = this.sequenceId, t.received = e.sequenceId, this.emit("warn", t), console.error(t.message);
8302
+ }
8303
+ this._bumpSequenceId(e.numPackets);
8304
+ }
8305
+ try {
8306
+ if (this._fatalError) return;
8307
+ this._command.execute(e, this) && (this._command = this._commands.shift(), this._command && (this.sequenceId = 0, this.compressedSequenceId = 0, this.handlePacket()));
8308
+ } catch (e) {
8309
+ this._handleFatalError(e), this.stream.destroy();
8310
+ }
8311
+ } else {
8312
+ if (e.peekByte() === 255) {
8313
+ let t = d.Error.fromPacket(e);
8314
+ this.protocolError(t.message, t.code);
8315
+ } else this.protocolError("Unexpected packet while no commands in the queue", "PROTOCOL_UNEXPECTED_PACKET");
8316
+ this.close();
8359
8317
  }
8360
- this._bumpSequenceId(e.numPackets);
8361
- }
8362
- try {
8363
- if (this._fatalError) return;
8364
- this._command.execute(e, this) && (this._command = this._commands.shift(), this._command && (this.sequenceId = 0, this.compressedSequenceId = 0, this.handlePacket()));
8365
- } catch (e) {
8366
- this._handleFatalError(e), this.stream.destroy();
8367
8318
  }
8368
8319
  }
8369
8320
  addCommand(e) {
@@ -8459,13 +8410,9 @@ var Ve = /* @__PURE__ */ f(((e) => {
8459
8410
  }
8460
8411
  let i = new f.Execute(r, n), a = (e) => {
8461
8412
  let t = new f.Prepare(r, (t, n) => {
8462
- if (t) {
8463
- i.start = function() {
8464
- return null;
8465
- }, e(t), i.emit("end");
8466
- return;
8467
- }
8468
- i.statement = n;
8413
+ t ? (i.start = function() {
8414
+ return null;
8415
+ }, e(t), i.emit("end")) : i.statement = n;
8469
8416
  });
8470
8417
  this.addCommand(t), this.addCommand(i);
8471
8418
  };
@@ -8843,7 +8790,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
8843
8790
  });
8844
8791
  }
8845
8792
  release() {
8846
- this._released || !this._pool || this._pool._closed || (this._released = !0, this.lastActiveTime = Date.now(), this._pool.releaseConnection(this));
8793
+ this._released || this._pool && !this._pool._closed && (this._released = !0, this.lastActiveTime = Date.now(), this._pool.releaseConnection(this));
8847
8794
  }
8848
8795
  [Symbol.dispose]() {
8849
8796
  this.release();
@@ -8904,17 +8851,9 @@ var Ve = /* @__PURE__ */ f(((e) => {
8904
8851
  }
8905
8852
  releaseConnection(e) {
8906
8853
  let t;
8907
- if (!e._pool) {
8908
- this._connectionQueue.length && (t = this._connectionQueue.shift(), n.nextTick(this.getConnection.bind(this, t)));
8909
- return;
8910
- }
8911
- this.config.resetOnRelease && e.reset ? e.reset((r) => {
8912
- if (r) {
8913
- e._pool = null, p(this._allConnections, e), e.destroy(), this._connectionQueue.length && (t = this._connectionQueue.shift(), n.nextTick(this.getConnection.bind(this, t)));
8914
- return;
8915
- }
8916
- this._handleSuccessfulRelease(e);
8917
- }) : this._handleSuccessfulRelease(e);
8854
+ e._pool ? this.config.resetOnRelease && e.reset ? e.reset((r) => {
8855
+ r ? (e._pool = null, p(this._allConnections, e), e.destroy(), this._connectionQueue.length && (t = this._connectionQueue.shift(), n.nextTick(this.getConnection.bind(this, t)))) : this._handleSuccessfulRelease(e);
8856
+ }) : this._handleSuccessfulRelease(e) : this._connectionQueue.length && (t = this._connectionQueue.shift(), n.nextTick(this.getConnection.bind(this, t)));
8918
8857
  }
8919
8858
  _handleSuccessfulRelease(e) {
8920
8859
  let t;
@@ -8933,25 +8872,16 @@ var Ve = /* @__PURE__ */ f(((e) => {
8933
8872
  n.nextTick(() => e(/* @__PURE__ */ Error("Pool is closed.")));
8934
8873
  }
8935
8874
  let t = !1, r = 0, i, a = function(n) {
8936
- if (!t && (n || ++r >= this._allConnections.length)) {
8937
- t = !0, e(n);
8938
- return;
8939
- }
8875
+ t || (n || ++r >= this._allConnections.length) && (t = !0, e(n));
8940
8876
  }.bind(this);
8941
- if (this._allConnections.length === 0) {
8942
- a();
8943
- return;
8944
- }
8945
- for (let e = 0; e < this._allConnections.length; e++) i = this._allConnections.get(e), i._realEnd(a);
8877
+ if (this._allConnections.length === 0) a();
8878
+ else for (let e = 0; e < this._allConnections.length; e++) i = this._allConnections.get(e), i._realEnd(a);
8946
8879
  }
8947
8880
  query(e, t, n) {
8948
8881
  let r = s.createQuery(e, t, n, this.config.connectionConfig);
8949
8882
  return r.namedPlaceholders === void 0 && (r.namedPlaceholders = this.config.connectionConfig.namedPlaceholders), this.getConnection((e, t) => {
8950
- if (e) {
8951
- typeof r.onResult == "function" ? r.onResult(e) : r.emit("error", e);
8952
- return;
8953
- }
8954
- try {
8883
+ if (e) typeof r.onResult == "function" ? r.onResult(e) : r.emit("error", e);
8884
+ else try {
8955
8885
  let e = null, n = r.onResult;
8956
8886
  n ? r.onResult = function(t, r, i) {
8957
8887
  e = t || null, n(t, r, i);
@@ -9075,7 +9005,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
9075
9005
  var n = dr();
9076
9006
  t.exports = class {
9077
9007
  constructor(e) {
9078
- typeof e == "string" && (e = n.parseUrl(e)), this.connectionConfig = new n(e), this.waitForConnections = e.waitForConnections === void 0 ? !0 : !!e.waitForConnections, this.connectionLimit = isNaN(e.connectionLimit) ? 10 : Number(e.connectionLimit), this.maxIdle = isNaN(e.maxIdle) ? this.connectionLimit : Number(e.maxIdle), this.idleTimeout = isNaN(e.idleTimeout) ? 6e4 : Number(e.idleTimeout), this.queueLimit = isNaN(e.queueLimit) ? 0 : Number(e.queueLimit), this.resetOnRelease = e.resetOnRelease === void 0 ? !1 : !!e.resetOnRelease;
9008
+ typeof e == "string" && (e = n.parseUrl(e)), this.connectionConfig = new n(e), this.waitForConnections = e.waitForConnections === void 0 || !!e.waitForConnections, this.connectionLimit = isNaN(e.connectionLimit) ? 10 : Number(e.connectionLimit), this.maxIdle = isNaN(e.maxIdle) ? this.connectionLimit : Number(e.maxIdle), this.idleTimeout = isNaN(e.idleTimeout) ? 6e4 : Number(e.idleTimeout), this.queueLimit = isNaN(e.queueLimit) ? 0 : Number(e.queueLimit), this.resetOnRelease = e.resetOnRelease !== void 0 && !!e.resetOnRelease;
9079
9009
  }
9080
9010
  };
9081
9011
  })), Er = /* @__PURE__ */ f(((e, t) => {
@@ -9112,11 +9042,8 @@ var Ve = /* @__PURE__ */ f(((e) => {
9112
9042
  query(e, t, n) {
9113
9043
  let r = a.createQuery(e, t, n, {});
9114
9044
  return this.getConnection((e, t) => {
9115
- if (e) {
9116
- typeof r.onResult == "function" ? r.onResult(e) : r.emit("error", e);
9117
- return;
9118
- }
9119
- try {
9045
+ if (e) typeof r.onResult == "function" ? r.onResult(e) : r.emit("error", e);
9046
+ else try {
9120
9047
  t.query(r).once("end", () => {
9121
9048
  t.release();
9122
9049
  });
@@ -9146,7 +9073,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
9146
9073
  };
9147
9074
  t.exports = class extends o {
9148
9075
  constructor(e) {
9149
- super(), e ||= {}, this._canRetry = e.canRetry === void 0 ? !0 : e.canRetry, this._removeNodeErrorCount = e.removeNodeErrorCount || 5, this._restoreNodeTimeout = e.restoreNodeTimeout || 0, this._defaultSelector = e.defaultSelector || "RR", this._closed = !1, this._lastId = 0, this._nodes = {}, this._serviceableNodeIds = [], this._namespaces = {}, this._findCaches = {};
9076
+ super(), e ||= {}, this._canRetry = e.canRetry === void 0 || e.canRetry, this._removeNodeErrorCount = e.removeNodeErrorCount || 5, this._restoreNodeTimeout = e.restoreNodeTimeout || 0, this._defaultSelector = e.defaultSelector || "RR", this._closed = !1, this._lastId = 0, this._nodes = {}, this._serviceableNodeIds = [], this._namespaces = {}, this._findCaches = {};
9150
9077
  }
9151
9078
  of(e, t) {
9152
9079
  e ||= "*", t ||= this._defaultSelector, t = t.toUpperCase(), !s[t] === "undefined" && (t = this._defaultSelector);
@@ -9198,7 +9125,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
9198
9125
  }
9199
9126
  return this._findCaches[e] = r, t ? r : r.filter((e) => {
9200
9127
  let t = this._getNode(e);
9201
- return t._offlineUntil ? (n ||= c(), t._offlineUntil <= n) : !0;
9128
+ return !t._offlineUntil || (n ||= c(), t._offlineUntil <= n);
9202
9129
  });
9203
9130
  }
9204
9131
  _getNode(e) {
@@ -9206,13 +9133,7 @@ var Ve = /* @__PURE__ */ f(((e) => {
9206
9133
  }
9207
9134
  _increaseErrorCount(e) {
9208
9135
  let t = ++e.errorCount;
9209
- if (!(this._removeNodeErrorCount > t)) {
9210
- if (this._restoreNodeTimeout > 0) {
9211
- e._offlineUntil = c() + this._restoreNodeTimeout, this.emit("offline", e.id);
9212
- return;
9213
- }
9214
- this._removeNode(e), this.emit("remove", e.id);
9215
- }
9136
+ this._removeNodeErrorCount > t || (this._restoreNodeTimeout > 0 ? (e._offlineUntil = c() + this._restoreNodeTimeout, this.emit("offline", e.id)) : (this._removeNode(e), this.emit("remove", e.id)));
9216
9137
  }
9217
9138
  _decreaseErrorCount(e) {
9218
9139
  let t = e.errorCount;
@@ -9491,9 +9412,7 @@ async function Gr(e, t) {
9491
9412
  name: t,
9492
9413
  expression: a.slice(1, -1)
9493
9414
  });
9494
- return;
9495
- }
9496
- r[o] || (r[o] = []), r[o].push({
9415
+ } else r[o] || (r[o] = []), r[o].push({
9497
9416
  name: t,
9498
9417
  expression: a.slice(1, -1)
9499
9418
  });
@@ -9525,11 +9444,7 @@ function qr(e, t) {
9525
9444
  let n = Object.assign(e, {});
9526
9445
  return Object.keys(t).forEach((e) => {
9527
9446
  let r = t[e];
9528
- if (!n[e]) {
9529
- n[e] = r;
9530
- return;
9531
- }
9532
- n[e].push(...r);
9447
+ n[e] ? n[e].push(...r) : n[e] = r;
9533
9448
  }), n;
9534
9449
  }
9535
9450
  async function Jr(e) {
@@ -9622,34 +9537,34 @@ async function Zr(e) {
9622
9537
  expression: h
9623
9538
  };
9624
9539
  i[u].push(e);
9625
- return;
9626
- }
9627
- if (m === "C" && h && p === 1 && f.length === 1) {
9628
- r[u] || (r[u] = {});
9629
- let e = f[0];
9630
- r[u][e] || (r[u][e] = { checks: [] }), r[u][e].checks.push({
9631
- name: d,
9632
- expression: h
9633
- });
9634
- }
9635
- if (["P", "U"].includes(m) && p === 1 && f.length === 1) {
9636
- r[u] || (r[u] = {});
9637
- let e = f[0];
9638
- r[u][e] || (r[u][e] = { checks: [] }), r[u][e].pk ||= m === "P", r[u][e].unique ||= m === "U";
9639
- }
9640
- if (["P", "U"].includes(m) && p > 1) {
9641
- r[u] || (r[u] = {}), n[u] || (n[u] = []);
9642
- let e = {
9643
- name: d,
9644
- type: "",
9645
- unique: !0,
9646
- pk: m === "P",
9647
- columns: f.map((e) => ({
9648
- type: "column",
9649
- value: e
9650
- }))
9651
- };
9652
- n[u].push(e);
9540
+ } else {
9541
+ if (m === "C" && h && p === 1 && f.length === 1) {
9542
+ r[u] || (r[u] = {});
9543
+ let e = f[0];
9544
+ r[u][e] || (r[u][e] = { checks: [] }), r[u][e].checks.push({
9545
+ name: d,
9546
+ expression: h
9547
+ });
9548
+ }
9549
+ if (["P", "U"].includes(m) && p === 1 && f.length === 1) {
9550
+ r[u] || (r[u] = {});
9551
+ let e = f[0];
9552
+ r[u][e] || (r[u][e] = { checks: [] }), r[u][e].pk ||= m === "P", r[u][e].unique ||= m === "U";
9553
+ }
9554
+ if (["P", "U"].includes(m) && p > 1) {
9555
+ r[u] || (r[u] = {}), n[u] || (n[u] = []);
9556
+ let e = {
9557
+ name: d,
9558
+ type: "",
9559
+ unique: !0,
9560
+ pk: m === "P",
9561
+ columns: f.map((e) => ({
9562
+ type: "column",
9563
+ value: e
9564
+ }))
9565
+ };
9566
+ n[u].push(e);
9567
+ }
9653
9568
  }
9654
9569
  }), {
9655
9570
  indexes: n,
@@ -9663,30 +9578,23 @@ async function Qr(e) {
9663
9578
  let t = await e.execute("\n SELECT\n i.INDEX_NAME AS \"index_name\",\n i.TABLE_NAME AS \"table_name\",\n CASE\n WHEN i.INDEX_TYPE LIKE '%NORMAL' THEN 'btree'\n ELSE LOWER(REGEXP_REPLACE(i.INDEX_TYPE, '^FUNCTION-BASED ', ''))\n END AS \"index_type\",\n CASE WHEN i.UNIQUENESS = 'UNIQUE' THEN 1 ELSE 0 END AS \"is_unique\",\n ic.COLUMN_NAME AS \"column_name\",\n ic.COLUMN_POSITION AS \"column_position\",\n ie.COLUMN_EXPRESSION AS \"column_expression\"\n FROM USER_INDEXES i\n LEFT JOIN USER_IND_COLUMNS ic\n ON i.INDEX_NAME = ic.INDEX_NAME\n LEFT JOIN USER_IND_EXPRESSIONS ie\n ON i.INDEX_NAME = ie.INDEX_NAME\n AND ic.COLUMN_POSITION = ie.COLUMN_POSITION\n LEFT JOIN USER_OBJECTS obj\n ON obj.OBJECT_NAME = i.TABLE_NAME\n AND obj.OBJECT_TYPE = 'TABLE'\n WHERE NOT EXISTS (\n SELECT 1\n FROM USER_CONSTRAINTS c\n WHERE c.INDEX_NAME = i.INDEX_NAME\n )\n ORDER BY obj.CREATED, obj.OBJECT_ID, i.INDEX_NAME, ic.COLUMN_POSITION\n ", [], Yr), n = {}, r = {};
9664
9579
  return t.rows?.forEach((e) => {
9665
9580
  let { index_name: t, table_name: n, index_type: i, is_unique: a, column_name: o, column_expression: s } = e, c = t, l = n, u = i, d = !!a;
9666
- if (s) {
9667
- r[c] || (r[c] = {
9668
- table: l,
9669
- type: u,
9670
- unique: d,
9671
- columns: []
9672
- }), r[c].columns.push({
9673
- type: "expression",
9674
- value: s
9675
- });
9676
- return;
9677
- }
9678
- if (o) {
9679
- r[c] || (r[c] = {
9680
- table: l,
9681
- type: u,
9682
- unique: d,
9683
- columns: []
9684
- }), r[c].columns.push({
9685
- type: "column",
9686
- value: o
9687
- });
9688
- return;
9689
- }
9581
+ s ? (r[c] || (r[c] = {
9582
+ table: l,
9583
+ type: u,
9584
+ unique: d,
9585
+ columns: []
9586
+ }), r[c].columns.push({
9587
+ type: "expression",
9588
+ value: s
9589
+ })) : o && (r[c] || (r[c] = {
9590
+ table: l,
9591
+ type: u,
9592
+ unique: d,
9593
+ columns: []
9594
+ }), r[c].columns.push({
9595
+ type: "column",
9596
+ value: o
9597
+ }));
9690
9598
  }), Object.entries(r).forEach(([e, { table: t, type: r, unique: i, columns: a }]) => {
9691
9599
  let o = {
9692
9600
  name: e,
@@ -9803,7 +9711,7 @@ function ri(e, t) {
9803
9711
  type: t
9804
9712
  };
9805
9713
  }
9806
- var ii = new Set([
9714
+ var ii = /* @__PURE__ */ new Set([
9807
9715
  "char",
9808
9716
  "varchar2",
9809
9717
  "nchar",
@@ -9819,7 +9727,7 @@ var ii = new Set([
9819
9727
  "national character",
9820
9728
  "national char varying",
9821
9729
  "national char"
9822
- ]), ai = new Set(["float"]), oi = "timestamp with local time zone", si = "timestamp with time zone", ci = "timestamp", li = "interval year to month", ui = "interval day to second", di = new Set([
9730
+ ]), ai = /* @__PURE__ */ new Set(["float"]), oi = "timestamp with local time zone", si = "timestamp with time zone", ci = "timestamp", li = "interval year to month", ui = "interval day to second", di = /* @__PURE__ */ new Set([
9823
9731
  "number",
9824
9732
  "numeric",
9825
9733
  "decimal",
@@ -10205,17 +10113,13 @@ var gi = async (e) => {
10205
10113
  let { table_schema: t, table_name: n, check_name: r, check_definition: i, column_name: a, is_column_constraint: s } = e;
10206
10114
  if (typeof t != "string" || typeof n != "string" || typeof i != "string" || !i.match(/CHECK \(\(.*\)\)/) || s && typeof a != "string") return;
10207
10115
  let c = `${t}.${n}`;
10208
- if (s) {
10209
- o[c] || (o[c] = {}), o[c][a] || (o[c][a] = { checks: [] }), o[c][a].checks.push({
10210
- name: r || void 0,
10211
- expression: i.slice(8, -2)
10212
- });
10213
- return;
10214
- }
10215
- l[c] || (l[c] = []), l[c].push({
10116
+ s ? (o[c] || (o[c] = {}), o[c][a] || (o[c][a] = { checks: [] }), o[c][a].checks.push({
10216
10117
  name: r || void 0,
10217
10118
  expression: i.slice(8, -2)
10218
- });
10119
+ })) : (l[c] || (l[c] = []), l[c].push({
10120
+ name: r || void 0,
10121
+ expression: i.slice(8, -2)
10122
+ }));
10219
10123
  }), {
10220
10124
  indexes: a,
10221
10125
  tableConstraints: o,
@@ -10392,7 +10296,7 @@ var gi = async (e) => {
10392
10296
  };
10393
10297
  }, Ii = (e, t, n) => e.reduce((e, r) => {
10394
10298
  let { schema_name: i, table_name: a, column_name: o, constraint_name: s } = r;
10395
- if (!(!(t.length > 0) || t.includes(i))) return e;
10299
+ if (t.length > 0 && !t.includes(i)) return e;
10396
10300
  let c = `${i}.${a}.${s}`;
10397
10301
  if (e[c]) {
10398
10302
  let { columnNames: t } = e[c];