drizzle-kit 1.0.0-beta.2-278d7e6 → 1.0.0-beta.2-31baa2b

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/api-mysql.mjs CHANGED
@@ -17336,7 +17336,8 @@ var init_schemaValidator = __esm({
17336
17336
  "singlestore",
17337
17337
  "gel",
17338
17338
  "mssql",
17339
- "cockroach"
17339
+ "cockroach",
17340
+ "duckdb"
17340
17341
  ];
17341
17342
  dialect3 = enumType(dialects);
17342
17343
  }
@@ -28729,7 +28730,7 @@ var require_websocket = __commonJS({
28729
28730
  var EventEmitter = __require("events");
28730
28731
  var https2 = __require("https");
28731
28732
  var http3 = __require("http");
28732
- var net2 = __require("net");
28733
+ var net = __require("net");
28733
28734
  var tls = __require("tls");
28734
28735
  var { randomBytes, createHash: createHash5 } = __require("crypto");
28735
28736
  var { Duplex, Readable: Readable6 } = __require("stream");
@@ -29460,12 +29461,12 @@ var require_websocket = __commonJS({
29460
29461
  }
29461
29462
  function netConnect(options) {
29462
29463
  options.path = options.socketPath;
29463
- return net2.connect(options);
29464
+ return net.connect(options);
29464
29465
  }
29465
29466
  function tlsConnect(options) {
29466
29467
  options.path = void 0;
29467
29468
  if (!options.servername && options.servername !== "") {
29468
- options.servername = net2.isIP(options.host) ? "" : options.host;
29469
+ options.servername = net.isIP(options.host) ? "" : options.host;
29469
29470
  }
29470
29471
  return tls.connect(options);
29471
29472
  }
@@ -33783,7 +33784,7 @@ var init_timing = __esm({
33783
33784
  "../node_modules/.pnpm/@smithy+node-http-handler@4.4.5/node_modules/@smithy/node-http-handler/dist-es/timing.js"() {
33784
33785
  "use strict";
33785
33786
  timing = {
33786
- setTimeout: (cb, ms2) => setTimeout(cb, ms2),
33787
+ setTimeout: (cb, ms) => setTimeout(cb, ms),
33787
33788
  clearTimeout: (timeoutId) => clearTimeout(timeoutId)
33788
33789
  };
33789
33790
  }
@@ -35671,13 +35672,13 @@ var init_schema_date_utils = __esm({
35671
35672
  if (!matches) {
35672
35673
  throw new TypeError(`Invalid RFC3339 timestamp format ${value}`);
35673
35674
  }
35674
- const [, yearStr, monthStr, dayStr, hours, minutes, seconds, , ms2, offsetStr] = matches;
35675
+ const [, yearStr, monthStr, dayStr, hours, minutes, seconds, , ms, offsetStr] = matches;
35675
35676
  range(monthStr, 1, 12);
35676
35677
  range(dayStr, 1, 31);
35677
35678
  range(hours, 0, 23);
35678
35679
  range(minutes, 0, 59);
35679
35680
  range(seconds, 0, 60);
35680
- const date2 = new Date(Date.UTC(Number(yearStr), Number(monthStr) - 1, Number(dayStr), Number(hours), Number(minutes), Number(seconds), Number(ms2) ? Math.round(parseFloat(`0.${ms2}`) * 1e3) : 0));
35681
+ const date2 = new Date(Date.UTC(Number(yearStr), Number(monthStr) - 1, Number(dayStr), Number(hours), Number(minutes), Number(seconds), Number(ms) ? Math.round(parseFloat(`0.${ms}`) * 1e3) : 0));
35681
35682
  date2.setUTCFullYear(Number(yearStr));
35682
35683
  if (offsetStr.toUpperCase() != "Z") {
35683
35684
  const [, sign2, offsetH, offsetM] = /([+-])(\d\d):(\d\d)/.exec(offsetStr) || [void 0, "+", 0, 0];
@@ -55690,8 +55691,8 @@ var require_datetime2 = __commonJS({
55690
55691
  if (!(object instanceof Date)) {
55691
55692
  throw new errors_1.InvalidArgumentError(`a Date instance was expected, got "${object}"`);
55692
55693
  }
55693
- const ms2 = object.getTime() - TIMESHIFT;
55694
- const us = ms2 * 1e3;
55694
+ const ms = object.getTime() - TIMESHIFT;
55695
+ const us = ms * 1e3;
55695
55696
  buf.writeInt32(8);
55696
55697
  buf.writeInt64(us);
55697
55698
  }
@@ -55701,12 +55702,12 @@ var require_datetime2 = __commonJS({
55701
55702
  return ctx.postDecode(this, us2 + BI_TIMESHIFT_US);
55702
55703
  }
55703
55704
  const us = Number(buf.readBigInt64());
55704
- let ms2 = Math.round(us / 1e3);
55705
- if (Math.abs(us % 1e3) === 500 && Math.abs(ms2) % 2 === 1) {
55706
- ms2 -= 1;
55705
+ let ms = Math.round(us / 1e3);
55706
+ if (Math.abs(us % 1e3) === 500 && Math.abs(ms) % 2 === 1) {
55707
+ ms -= 1;
55707
55708
  }
55708
- ms2 += TIMESHIFT;
55709
- return new Date(ms2);
55709
+ ms += TIMESHIFT;
55710
+ return new Date(ms);
55710
55711
  }
55711
55712
  };
55712
55713
  exports2.DateTimeCodec = DateTimeCodec;
@@ -55727,8 +55728,8 @@ var require_datetime2 = __commonJS({
55727
55728
  if (!(object instanceof datetime_1.LocalDateTime)) {
55728
55729
  throw new errors_1.InvalidArgumentError(`a LocalDateTime instance was expected, got "${object}"`);
55729
55730
  }
55730
- const ms2 = BigInt(datetime_1.localDateInstances.get(object).getTime() - TIMESHIFT);
55731
- let us = ms2 * 1000n + BigInt(object.hour * 36e8 + object.minute * 6e7 + object.second * 1e6 + object.millisecond * 1e3 + object.microsecond);
55731
+ const ms = BigInt(datetime_1.localDateInstances.get(object).getTime() - TIMESHIFT);
55732
+ let us = ms * 1000n + BigInt(object.hour * 36e8 + object.minute * 6e7 + object.second * 1e6 + object.millisecond * 1e3 + object.microsecond);
55732
55733
  if (object.nanosecond === 500 && Math.abs(object.microsecond) % 2 === 1 || object.nanosecond > 500) {
55733
55734
  us += 1n;
55734
55735
  }
@@ -55742,13 +55743,13 @@ var require_datetime2 = __commonJS({
55742
55743
  }
55743
55744
  const bi_ms = bi_us / 1000n;
55744
55745
  let us = Number(bi_us - bi_ms * 1000n);
55745
- let ms2 = Number(bi_ms);
55746
+ let ms = Number(bi_ms);
55746
55747
  if (us < 0) {
55747
55748
  us += 1e3;
55748
- ms2 -= 1;
55749
+ ms -= 1;
55749
55750
  }
55750
- ms2 += TIMESHIFT;
55751
- const date2 = new Date(ms2);
55751
+ ms += TIMESHIFT;
55752
+ const date2 = new Date(ms);
55752
55753
  return new datetime_1.LocalDateTime(date2.getUTCFullYear(), date2.getUTCMonth() + 1, date2.getUTCDate(), date2.getUTCHours(), date2.getUTCMinutes(), date2.getUTCSeconds(), date2.getUTCMilliseconds(), us);
55753
55754
  }
55754
55755
  };
@@ -55810,13 +55811,13 @@ var require_datetime2 = __commonJS({
55810
55811
  }
55811
55812
  let us = Number(bius);
55812
55813
  let seconds = Math.floor(us / 1e6);
55813
- const ms2 = Math.floor(us % 1e6 / 1e3);
55814
- us = us % 1e6 - ms2 * 1e3;
55814
+ const ms = Math.floor(us % 1e6 / 1e3);
55815
+ us = us % 1e6 - ms * 1e3;
55815
55816
  let minutes = Math.floor(seconds / 60);
55816
55817
  seconds = Math.floor(seconds % 60);
55817
55818
  const hours = Math.floor(minutes / 60);
55818
55819
  minutes = Math.floor(minutes % 60);
55819
- return new datetime_1.LocalTime(hours, minutes, seconds, ms2, us);
55820
+ return new datetime_1.LocalTime(hours, minutes, seconds, ms, us);
55820
55821
  }
55821
55822
  };
55822
55823
  exports2.LocalTimeCodec = LocalTimeCodec;
@@ -55893,14 +55894,14 @@ var require_datetime2 = __commonJS({
55893
55894
  const biMillion = 1000000n;
55894
55895
  const biSeconds = bius / biMillion;
55895
55896
  let us = Number(bius - biSeconds * biMillion);
55896
- const ms2 = Math.floor(us / 1e3);
55897
+ const ms = Math.floor(us / 1e3);
55897
55898
  us = us % 1e3;
55898
55899
  let seconds = Number(biSeconds);
55899
55900
  let minutes = Math.floor(seconds / 60);
55900
55901
  seconds = Math.floor(seconds % 60);
55901
55902
  const hours = Math.floor(minutes / 60);
55902
55903
  minutes = Math.floor(minutes % 60);
55903
- return new datetime_1.Duration(0, 0, 0, 0, hours * sign2, minutes * sign2, seconds * sign2, ms2 * sign2, us * sign2);
55904
+ return new datetime_1.Duration(0, 0, 0, 0, hours * sign2, minutes * sign2, seconds * sign2, ms * sign2, us * sign2);
55904
55905
  }
55905
55906
  };
55906
55907
  exports2.DurationCodec = DurationCodec;
@@ -55946,7 +55947,7 @@ var require_datetime2 = __commonJS({
55946
55947
  const million = BigInt(1e6);
55947
55948
  const biSeconds = bius / million;
55948
55949
  let us = Number(bius - biSeconds * million);
55949
- const ms2 = Math.trunc(us / 1e3);
55950
+ const ms = Math.trunc(us / 1e3);
55950
55951
  us = us % 1e3;
55951
55952
  let seconds = Number(biSeconds);
55952
55953
  let minutes = Math.trunc(seconds / 60);
@@ -55957,7 +55958,7 @@ var require_datetime2 = __commonJS({
55957
55958
  days = Math.trunc(days % 7);
55958
55959
  const years = Math.trunc(months2 / 12);
55959
55960
  months2 = Math.trunc(months2 % 12);
55960
- return new datetime_1.RelativeDuration(years, months2, weeks, days, hours * sign2, minutes * sign2, seconds * sign2, ms2 * sign2, us * sign2);
55961
+ return new datetime_1.RelativeDuration(years, months2, weeks, days, hours * sign2, minutes * sign2, seconds * sign2, ms * sign2, us * sign2);
55961
55962
  }
55962
55963
  };
55963
55964
  exports2.RelativeDurationCodec = RelativeDurationCodec;
@@ -66121,41 +66122,41 @@ var require_ms = __commonJS({
66121
66122
  return void 0;
66122
66123
  }
66123
66124
  }
66124
- function fmtShort(ms2) {
66125
- var msAbs = Math.abs(ms2);
66125
+ function fmtShort(ms) {
66126
+ var msAbs = Math.abs(ms);
66126
66127
  if (msAbs >= d6) {
66127
- return Math.round(ms2 / d6) + "d";
66128
+ return Math.round(ms / d6) + "d";
66128
66129
  }
66129
66130
  if (msAbs >= h7) {
66130
- return Math.round(ms2 / h7) + "h";
66131
+ return Math.round(ms / h7) + "h";
66131
66132
  }
66132
66133
  if (msAbs >= m7) {
66133
- return Math.round(ms2 / m7) + "m";
66134
+ return Math.round(ms / m7) + "m";
66134
66135
  }
66135
66136
  if (msAbs >= s7) {
66136
- return Math.round(ms2 / s7) + "s";
66137
+ return Math.round(ms / s7) + "s";
66137
66138
  }
66138
- return ms2 + "ms";
66139
+ return ms + "ms";
66139
66140
  }
66140
- function fmtLong(ms2) {
66141
- var msAbs = Math.abs(ms2);
66141
+ function fmtLong(ms) {
66142
+ var msAbs = Math.abs(ms);
66142
66143
  if (msAbs >= d6) {
66143
- return plural(ms2, msAbs, d6, "day");
66144
+ return plural(ms, msAbs, d6, "day");
66144
66145
  }
66145
66146
  if (msAbs >= h7) {
66146
- return plural(ms2, msAbs, h7, "hour");
66147
+ return plural(ms, msAbs, h7, "hour");
66147
66148
  }
66148
66149
  if (msAbs >= m7) {
66149
- return plural(ms2, msAbs, m7, "minute");
66150
+ return plural(ms, msAbs, m7, "minute");
66150
66151
  }
66151
66152
  if (msAbs >= s7) {
66152
- return plural(ms2, msAbs, s7, "second");
66153
+ return plural(ms, msAbs, s7, "second");
66153
66154
  }
66154
- return ms2 + " ms";
66155
+ return ms + " ms";
66155
66156
  }
66156
- function plural(ms2, msAbs, n6, name) {
66157
+ function plural(ms, msAbs, n6, name) {
66157
66158
  var isPlural = msAbs >= n6 * 1.5;
66158
- return Math.round(ms2 / n6) + " " + name + (isPlural ? "s" : "");
66159
+ return Math.round(ms / n6) + " " + name + (isPlural ? "s" : "");
66159
66160
  }
66160
66161
  }
66161
66162
  });
@@ -66199,8 +66200,8 @@ var require_common2 = __commonJS({
66199
66200
  }
66200
66201
  const self2 = debug;
66201
66202
  const curr = Number(/* @__PURE__ */ new Date());
66202
- const ms2 = curr - (prevTime || curr);
66203
- self2.diff = ms2;
66203
+ const ms = curr - (prevTime || curr);
66204
+ self2.diff = ms;
66204
66205
  self2.prev = prevTime;
66205
66206
  self2.curr = curr;
66206
66207
  prevTime = curr;
@@ -81703,11 +81704,11 @@ var require_TokenExpiredError = __commonJS({
81703
81704
  var require_timespan = __commonJS({
81704
81705
  "../node_modules/.pnpm/jsonwebtoken@9.0.2/node_modules/jsonwebtoken/lib/timespan.js"(exports2, module) {
81705
81706
  "use strict";
81706
- var ms2 = require_ms();
81707
+ var ms = require_ms();
81707
81708
  module.exports = function(time2, iat) {
81708
81709
  var timestamp = iat || Math.floor(Date.now() / 1e3);
81709
81710
  if (typeof time2 === "string") {
81710
- var milliseconds = ms2(time2);
81711
+ var milliseconds = ms(time2);
81711
81712
  if (typeof milliseconds === "undefined") {
81712
81713
  return;
81713
81714
  }
@@ -96245,7 +96246,7 @@ var require_dist = __commonJS({
96245
96246
  };
96246
96247
  Object.defineProperty(exports2, "__esModule", { value: true });
96247
96248
  exports2.Agent = void 0;
96248
- var net2 = __importStar2(__require("net"));
96249
+ var net = __importStar2(__require("net"));
96249
96250
  var http3 = __importStar2(__require("http"));
96250
96251
  var https_1 = __require("https");
96251
96252
  __exportStar2(require_helpers2(), exports2);
@@ -96285,7 +96286,7 @@ var require_dist = __commonJS({
96285
96286
  if (!this.sockets[name]) {
96286
96287
  this.sockets[name] = [];
96287
96288
  }
96288
- const fakeSocket = new net2.Socket({ writable: false });
96289
+ const fakeSocket = new net.Socket({ writable: false });
96289
96290
  this.sockets[name].push(fakeSocket);
96290
96291
  this.totalSocketCount++;
96291
96292
  return fakeSocket;
@@ -96497,7 +96498,7 @@ var require_dist2 = __commonJS({
96497
96498
  };
96498
96499
  Object.defineProperty(exports2, "__esModule", { value: true });
96499
96500
  exports2.HttpsProxyAgent = void 0;
96500
- var net2 = __importStar2(__require("net"));
96501
+ var net = __importStar2(__require("net"));
96501
96502
  var tls = __importStar2(__require("tls"));
96502
96503
  var assert_1 = __importDefault2(__require("assert"));
96503
96504
  var debug_1 = __importDefault2(require_src2());
@@ -96506,7 +96507,7 @@ var require_dist2 = __commonJS({
96506
96507
  var parse_proxy_response_1 = require_parse_proxy_response();
96507
96508
  var debug = (0, debug_1.default)("https-proxy-agent");
96508
96509
  var setServernameFromNonIpHost = (options) => {
96509
- if (options.servername === void 0 && options.host && !net2.isIP(options.host)) {
96510
+ if (options.servername === void 0 && options.host && !net.isIP(options.host)) {
96510
96511
  return {
96511
96512
  ...options,
96512
96513
  servername: options.host
@@ -96546,10 +96547,10 @@ var require_dist2 = __commonJS({
96546
96547
  socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
96547
96548
  } else {
96548
96549
  debug("Creating `net.Socket`: %o", this.connectOpts);
96549
- socket = net2.connect(this.connectOpts);
96550
+ socket = net.connect(this.connectOpts);
96550
96551
  }
96551
96552
  const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
96552
- const host = net2.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
96553
+ const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
96553
96554
  let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r
96554
96555
  `;
96555
96556
  if (proxy.username || proxy.password) {
@@ -96582,7 +96583,7 @@ var require_dist2 = __commonJS({
96582
96583
  return socket;
96583
96584
  }
96584
96585
  socket.destroy();
96585
- const fakeSocket = new net2.Socket({ writable: false });
96586
+ const fakeSocket = new net.Socket({ writable: false });
96586
96587
  fakeSocket.readable = true;
96587
96588
  req.once("socket", (s7) => {
96588
96589
  debug("Replaying proxy buffer for failed request");
@@ -96647,7 +96648,7 @@ var require_dist3 = __commonJS({
96647
96648
  };
96648
96649
  Object.defineProperty(exports2, "__esModule", { value: true });
96649
96650
  exports2.HttpProxyAgent = void 0;
96650
- var net2 = __importStar2(__require("net"));
96651
+ var net = __importStar2(__require("net"));
96651
96652
  var tls = __importStar2(__require("tls"));
96652
96653
  var debug_1 = __importDefault2(require_src2());
96653
96654
  var events_1 = __require("events");
@@ -96720,7 +96721,7 @@ var require_dist3 = __commonJS({
96720
96721
  socket = tls.connect(this.connectOpts);
96721
96722
  } else {
96722
96723
  debug("Creating `net.Socket`: %o", this.connectOpts);
96723
- socket = net2.connect(this.connectOpts);
96724
+ socket = net.connect(this.connectOpts);
96724
96725
  }
96725
96726
  await (0, events_1.once)(socket, "connect");
96726
96727
  return socket;
@@ -135599,7 +135600,7 @@ var require_connection = __commonJS({
135599
135600
  var _crypto = _interopRequireDefault(__require("crypto"));
135600
135601
  var _os = _interopRequireDefault(__require("os"));
135601
135602
  var tls = _interopRequireWildcard(__require("tls"));
135602
- var net2 = _interopRequireWildcard(__require("net"));
135603
+ var net = _interopRequireWildcard(__require("net"));
135603
135604
  var _dns = _interopRequireDefault(__require("dns"));
135604
135605
  var _constants = _interopRequireDefault(__require("constants"));
135605
135606
  var _stream = __require("stream");
@@ -136648,7 +136649,7 @@ var require_connection = __commonJS({
136648
136649
  async wrapWithTls(socket, signal) {
136649
136650
  signal.throwIfAborted();
136650
136651
  const secureContext = tls.createSecureContext(this.secureContextOptions);
136651
- const serverName = !net2.isIP(this.config.server) ? this.config.server : "";
136652
+ const serverName = !net.isIP(this.config.server) ? this.config.server : "";
136652
136653
  const encryptOptions = {
136653
136654
  host: this.config.server,
136654
136655
  socket,
@@ -139554,10 +139555,10 @@ __export(connections_exports, {
139554
139555
  connectToSQLite: () => connectToSQLite,
139555
139556
  connectToSingleStore: () => connectToSingleStore,
139556
139557
  prepareCockroach: () => prepareCockroach,
139558
+ prepareDuckDb: () => prepareDuckDb,
139557
139559
  prepareGelDB: () => prepareGelDB,
139558
139560
  preparePostgresDB: () => preparePostgresDB
139559
139561
  });
139560
- import net from "net";
139561
139562
  function parseMssqlUrl(url) {
139562
139563
  return {
139563
139564
  user: url.username,
@@ -139571,7 +139572,7 @@ function parseMssqlUrl(url) {
139571
139572
  }
139572
139573
  };
139573
139574
  }
139574
- var ms, normalisePGliteUrl, preparePostgresDB, prepareCockroach, prepareGelDB, parseSingleStoreCredentials, connectToSingleStore, parseMysqlCredentials, connectToMySQL, parseMssqlCredentials, connectToMsSQL, prepareSqliteParams, preparePGliteParams, connectToSQLite, connectToLibSQL;
139575
+ var normalisePGliteUrl, preparePostgresDB, prepareDuckDb, prepareCockroach, prepareGelDB, parseSingleStoreCredentials, connectToSingleStore, parseMysqlCredentials, connectToMySQL, parseMssqlCredentials, connectToMsSQL, prepareSqliteParams, preparePGliteParams, connectToSQLite, connectToLibSQL;
139575
139576
  var init_connections = __esm({
139576
139577
  "src/cli/connections.ts"() {
139577
139578
  "use strict";
@@ -139582,7 +139583,6 @@ var init_connections = __esm({
139582
139583
  init_when_json_met_bigint();
139583
139584
  init_utils3();
139584
139585
  init_outputs();
139585
- ms = (a6, b6) => Number(b6 - a6) / 1e6;
139586
139586
  normalisePGliteUrl = (it) => {
139587
139587
  if (it.startsWith("file:")) {
139588
139588
  return it.substring(5);
@@ -139706,7 +139706,13 @@ var init_connections = __esm({
139706
139706
  }
139707
139707
  return results;
139708
139708
  };
139709
- return { packageName: "pglite", query, proxy, transactionProxy, migrate: migrateFn };
139709
+ return {
139710
+ packageName: "pglite",
139711
+ query,
139712
+ proxy,
139713
+ transactionProxy,
139714
+ migrate: migrateFn
139715
+ };
139710
139716
  }
139711
139717
  assertUnreachable(driver2);
139712
139718
  }
@@ -139737,13 +139743,13 @@ var init_connections = __esm({
139737
139743
  return pg.types.getTypeParser(typeId, format2);
139738
139744
  }
139739
139745
  };
139740
- const pool = "url" in credentials ? new pg.Pool({ connectionString: credentials.url, max: 1 }) : new pg.Pool({ ...credentials, ssl, max: 1 });
139741
- const db = drizzle({ client: pool });
139746
+ const client = "url" in credentials ? new pg.Pool({ connectionString: credentials.url, max: 1 }) : new pg.Pool({ ...credentials, ssl, max: 1 });
139747
+ const db = drizzle({ client });
139742
139748
  const migrateFn = async (config) => {
139743
139749
  return migrate(db, config);
139744
139750
  };
139745
139751
  const query = async (sql, params) => {
139746
- const result2 = await pool.query({
139752
+ const result2 = await client.query({
139747
139753
  text: sql,
139748
139754
  values: params ?? [],
139749
139755
  types: types3
@@ -139753,7 +139759,7 @@ var init_connections = __esm({
139753
139759
  return result2.rows;
139754
139760
  };
139755
139761
  const proxy = async (params) => {
139756
- const result2 = await pool.query({
139762
+ const result2 = await client.query({
139757
139763
  text: params.sql,
139758
139764
  values: params.params,
139759
139765
  ...params.mode === "array" && { rowMode: "array" },
@@ -139765,7 +139771,7 @@ var init_connections = __esm({
139765
139771
  };
139766
139772
  const transactionProxy = async (queries) => {
139767
139773
  const results = [];
139768
- const tx = await pool.connect();
139774
+ const tx = await client.connect();
139769
139775
  try {
139770
139776
  await tx.query("BEGIN");
139771
139777
  for (const query2 of queries) {
@@ -139784,119 +139790,13 @@ var init_connections = __esm({
139784
139790
  }
139785
139791
  return results;
139786
139792
  };
139787
- const benchmarkQuery = async (client, sql, params) => {
139788
- const explainResult = await pool.query({
139789
- text: `EXPLAIN ANALYZE ${sql}`,
139790
- values: params ?? [],
139791
- types: types3
139792
- });
139793
- const stringifiedResult = JSON.stringify(explainResult.rows);
139794
- const planningMatch = stringifiedResult.match(/Planning Time:\s*([\d.]+)\s*ms/i);
139795
- const executionMatch = stringifiedResult.match(/Execution Time:\s*([\d.]+)\s*ms/i);
139796
- let planningTime = Number(planningMatch[1]);
139797
- let executionTime = Number(executionMatch[1]);
139798
- let querySentAt = 0n;
139799
- let firstDataAt = 0n;
139800
- let lastDataAt = 0n;
139801
- let lastRowParsedAt = 0n;
139802
- let queryCompletedAt = 0n;
139803
- let bytesReceived = 0;
139804
- let rowCount = 0;
139805
- let parseTime = 0;
139806
- let lastParseTime = 0;
139807
- const rowDescriptionListener = (data) => {
139808
- if (firstDataAt === 0n) {
139809
- firstDataAt = process.hrtime.bigint();
139810
- }
139811
- bytesReceived += data.length;
139812
- };
139813
- const originalRowListener = client.connection.listeners("dataRow")[0];
139814
- const wrappedRowListener = (data) => {
139815
- rowCount += 1;
139816
- const start = process.hrtime.bigint();
139817
- lastDataAt = start;
139818
- originalRowListener.apply(client.connection, [data]);
139819
- const end2 = process.hrtime.bigint();
139820
- lastRowParsedAt = end2;
139821
- lastParseTime = ms(start, end2);
139822
- parseTime += lastParseTime;
139823
- bytesReceived += data.length;
139824
- };
139825
- client.connection.removeAllListeners("dataRow");
139826
- client.connection.addListener("dataRow", wrappedRowListener);
139827
- client.connection.prependListener("rowDescription", rowDescriptionListener);
139828
- querySentAt = process.hrtime.bigint();
139829
- await client.query({
139830
- text: sql,
139831
- values: params,
139832
- types: types3
139833
- });
139834
- queryCompletedAt = process.hrtime.bigint();
139835
- client.connection.removeListener("rowDescription", rowDescriptionListener);
139836
- client.connection.removeAllListeners("dataRow");
139837
- client.connection.addListener("dataRow", originalRowListener);
139838
- let querySentTime = ms(querySentAt, firstDataAt) - executionTime - planningTime;
139839
- if (querySentTime < 0) {
139840
- const percent = 0.1;
139841
- const overflow = -querySentTime;
139842
- const keepForSent = overflow * percent;
139843
- const adjustedOverflow = overflow * (1 + percent);
139844
- const total2 = planningTime + executionTime;
139845
- const ratioPlanning = planningTime / total2;
139846
- const ratioExecution = executionTime / total2;
139847
- planningTime -= adjustedOverflow * ratioPlanning;
139848
- executionTime -= adjustedOverflow * ratioExecution;
139849
- querySentTime = keepForSent;
139850
- }
139851
- const networkLatencyBefore = querySentTime / 2;
139852
- const networkLatencyAfter = querySentTime / 2;
139853
- const downloadTime = ms(firstDataAt, lastDataAt) - (rowCount > 1 ? parseTime - lastParseTime : 0);
139854
- const total = ms(querySentAt, queryCompletedAt);
139855
- const calculatedTotal = networkLatencyBefore + planningTime + executionTime + networkLatencyAfter + downloadTime + parseTime + ms(lastRowParsedAt, queryCompletedAt);
139856
- const errorMargin = Math.abs(total - calculatedTotal);
139857
- return {
139858
- networkLatencyBefore,
139859
- planning: planningTime,
139860
- execution: executionTime,
139861
- networkLatencyAfter,
139862
- dataDownload: downloadTime,
139863
- dataParse: parseTime,
139864
- total,
139865
- errorMargin,
139866
- dataSize: bytesReceived
139867
- };
139868
- };
139869
- const benchmarkProxy = async ({ sql, params }, repeats) => {
139870
- let startAt = 0n;
139871
- let tcpConnectedAt = 0n;
139872
- let tlsConnectedAt = null;
139873
- let dbReadyAt = 0n;
139874
- const client = "url" in credentials ? new pg.Client({ connectionString: credentials.url }) : new pg.Client({ ...credentials, ssl });
139875
- client.connection.once("connect", () => {
139876
- tcpConnectedAt = process.hrtime.bigint();
139877
- });
139878
- client.connection.prependOnceListener("sslconnect", () => {
139879
- tlsConnectedAt = process.hrtime.bigint();
139880
- });
139881
- client.connection.prependOnceListener("readyForQuery", () => {
139882
- dbReadyAt = process.hrtime.bigint();
139883
- });
139884
- startAt = process.hrtime.bigint();
139885
- await client.connect();
139886
- const results = [];
139887
- for (let i7 = 0; i7 < repeats; i7++) {
139888
- const r7 = await benchmarkQuery(client, sql, params);
139889
- results.push(r7);
139890
- }
139891
- await client.end();
139892
- return {
139893
- tcpHandshake: ms(startAt, tcpConnectedAt),
139894
- tlsHandshake: tlsConnectedAt ? ms(tcpConnectedAt, tlsConnectedAt) : null,
139895
- dbHandshake: ms(tlsConnectedAt ?? tcpConnectedAt, dbReadyAt),
139896
- queries: results
139897
- };
139793
+ return {
139794
+ packageName: "pg",
139795
+ query,
139796
+ proxy,
139797
+ transactionProxy,
139798
+ migrate: migrateFn
139898
139799
  };
139899
- return { packageName: "pg", query, proxy, transactionProxy, benchmarkProxy, migrate: migrateFn };
139900
139800
  }
139901
139801
  if (await checkPackage("postgres")) {
139902
139802
  console.log(
@@ -139947,7 +139847,13 @@ var init_connections = __esm({
139947
139847
  }
139948
139848
  return results;
139949
139849
  };
139950
- return { packageName: "postgres", query, proxy, transactionProxy, migrate: migrateFn };
139850
+ return {
139851
+ packageName: "postgres",
139852
+ query,
139853
+ proxy,
139854
+ transactionProxy,
139855
+ migrate: migrateFn
139856
+ };
139951
139857
  }
139952
139858
  if (await checkPackage("@vercel/postgres")) {
139953
139859
  console.log(
@@ -140028,7 +139934,13 @@ var init_connections = __esm({
140028
139934
  }
140029
139935
  return results;
140030
139936
  };
140031
- return { packageName: "@vercel/postgres", query, proxy, transactionProxy, migrate: migrateFn };
139937
+ return {
139938
+ packageName: "@vercel/postgres",
139939
+ query,
139940
+ proxy,
139941
+ transactionProxy,
139942
+ migrate: migrateFn
139943
+ };
140032
139944
  }
140033
139945
  if (await checkPackage("@neondatabase/serverless")) {
140034
139946
  console.log(
@@ -140041,7 +139953,11 @@ var init_connections = __esm({
140041
139953
  "'@neondatabase/serverless' can only connect to remote Neon/Vercel Postgres/Supabase instances through a websocket"
140042
139954
  )
140043
139955
  );
140044
- const { Pool, neonConfig, types: pgTypes } = await import("@neondatabase/serverless");
139956
+ const {
139957
+ Pool,
139958
+ neonConfig,
139959
+ types: pgTypes
139960
+ } = await import("@neondatabase/serverless");
140045
139961
  const { drizzle } = await import("drizzle-orm/neon-serverless");
140046
139962
  const { migrate } = await import("drizzle-orm/neon-serverless/migrator");
140047
139963
  const ssl = "ssl" in credentials ? credentials.ssl === "prefer" || credentials.ssl === "require" || credentials.ssl === "allow" ? { rejectUnauthorized: false } : credentials.ssl === "verify-full" ? {} : credentials.ssl : {};
@@ -140111,7 +140027,13 @@ var init_connections = __esm({
140111
140027
  }
140112
140028
  return results;
140113
140029
  };
140114
- return { packageName: "@neondatabase/serverless", query, proxy, transactionProxy, migrate: migrateFn };
140030
+ return {
140031
+ packageName: "@neondatabase/serverless",
140032
+ query,
140033
+ proxy,
140034
+ transactionProxy,
140035
+ migrate: migrateFn
140036
+ };
140115
140037
  }
140116
140038
  if (await checkPackage("bun")) {
140117
140039
  console.log(withStyle.info(`Using 'bun' driver for database querying`));
@@ -140162,6 +140084,54 @@ var init_connections = __esm({
140162
140084
  console.warn("For the 'bun' driver, run your script using: bun --bun");
140163
140085
  process.exit(1);
140164
140086
  };
140087
+ prepareDuckDb = async (credentials) => {
140088
+ if (await checkPackage("@duckdb/node-api")) {
140089
+ console.log(
140090
+ withStyle.info(`Using '@duckdb/node-api' driver for database querying`)
140091
+ );
140092
+ const { DuckDBInstance } = await import("@duckdb/node-api");
140093
+ const instance = await DuckDBInstance.create(credentials.url);
140094
+ const client = await instance.connect();
140095
+ const query = async (sql, params = []) => {
140096
+ const result2 = await client.run(sql, params);
140097
+ const rows = await result2.getRowObjectsJson();
140098
+ return rows;
140099
+ };
140100
+ const proxy = async (params) => {
140101
+ const result2 = await client.run(params.sql, params.params);
140102
+ return params.mode === "array" ? await result2.getRowsJson() : await result2.getRowObjectsJson();
140103
+ };
140104
+ const transactionProxy = async (queries) => {
140105
+ const results = [];
140106
+ try {
140107
+ await client.run("BEGIN");
140108
+ for (const query2 of queries) {
140109
+ const result2 = await client.run(query2.sql);
140110
+ results.push(await result2.getRowObjectsJson());
140111
+ }
140112
+ await client.run("COMMIT");
140113
+ } catch (error3) {
140114
+ await client.run("ROLLBACK");
140115
+ results.push(error3);
140116
+ }
140117
+ return results;
140118
+ };
140119
+ return {
140120
+ packageName: "@duckdb/node-api",
140121
+ query,
140122
+ proxy,
140123
+ transactionProxy,
140124
+ migrate: () => {
140125
+ throw new Error("DuckDB does not support migrations");
140126
+ }
140127
+ };
140128
+ }
140129
+ console.error(
140130
+ // "To connect to DuckDb database - please install either of 'duckdb', '@duckdb/node-api' drivers",
140131
+ "To connect to DuckDb database - please install '@duckdb/node-api' driver"
140132
+ );
140133
+ process.exit(1);
140134
+ };
140165
140135
  prepareCockroach = async (credentials) => {
140166
140136
  if (await checkPackage("pg")) {
140167
140137
  const { default: pg } = await import("pg");
@@ -140214,9 +140184,7 @@ var init_connections = __esm({
140214
140184
  };
140215
140185
  return { query, proxy, migrate: migrateFn };
140216
140186
  }
140217
- console.error(
140218
- "To connect to Cockroach - please install 'pg' package"
140219
- );
140187
+ console.error("To connect to Cockroach - please install 'pg' package");
140220
140188
  process.exit(1);
140221
140189
  };
140222
140190
  prepareGelDB = async (credentials) => {
@@ -140275,9 +140243,7 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
140275
140243
  };
140276
140244
  return { packageName: "gel", query, proxy, transactionProxy };
140277
140245
  }
140278
- console.error(
140279
- "To connect to gel database - please install 'edgedb' driver"
140280
- );
140246
+ console.error("To connect to gel database - please install 'edgedb' driver");
140281
140247
  process.exit(1);
140282
140248
  };
140283
140249
  parseSingleStoreCredentials = (credentials) => {
@@ -140391,6 +140357,7 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
140391
140357
  }
140392
140358
  return next();
140393
140359
  };
140360
+ await connection.connect();
140394
140361
  const query = async (sql, params) => {
140395
140362
  const res = await connection.execute({
140396
140363
  sql,
@@ -140430,156 +140397,11 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
140430
140397
  }
140431
140398
  return results;
140432
140399
  };
140433
- const benchmarkQuery = async (newConnection, sql, params) => {
140434
- const explainResult = await connection.query({
140435
- sql: `EXPLAIN ANALYZE ${sql}`,
140436
- values: params ?? [],
140437
- typeCast
140438
- });
140439
- const stringifiedResult = JSON.stringify(explainResult[0]);
140440
- const timeMatch = stringifiedResult.match(
140441
- /actual time=([0-9.eE+-]+)\.\.([0-9.eE+-]+)/
140442
- );
140443
- const lastRowTime = Number(timeMatch[2]);
140444
- let executionTime = lastRowTime;
140445
- let querySentAt = 0n;
140446
- let firstDataAt = 0n;
140447
- let lastDataAt = 0n;
140448
- let lastRowParsedAt = 0n;
140449
- let queryCompletedAt = 0n;
140450
- let bytesReceived = 0;
140451
- let rowCount = 0;
140452
- let parseTime = 0;
140453
- let lastParseTime = 0;
140454
- querySentAt = process.hrtime.bigint();
140455
- await new Promise((resolve2, reject) => {
140456
- const query2 = newConnection.query({
140457
- sql,
140458
- values: params ?? [],
140459
- typeCast
140460
- });
140461
- const originalRowHandler = query2.row;
140462
- let packets = 0;
140463
- const wrappedRowListener = (packet, connection2) => {
140464
- packets += 1;
140465
- if (firstDataAt === 0n) {
140466
- firstDataAt = process.hrtime.bigint();
140467
- bytesReceived += packet.start;
140468
- }
140469
- const start = process.hrtime.bigint();
140470
- lastDataAt = start;
140471
- const res = originalRowHandler.apply(query2, [packet, connection2]);
140472
- const end2 = process.hrtime.bigint();
140473
- lastRowParsedAt = end2;
140474
- lastParseTime = ms(start, end2);
140475
- parseTime += lastParseTime;
140476
- bytesReceived += packet.length();
140477
- if (!res || packet.isEOF()) {
140478
- return res;
140479
- }
140480
- return wrappedRowListener;
140481
- };
140482
- query2.row = wrappedRowListener;
140483
- query2.on("result", () => {
140484
- rowCount += 1;
140485
- });
140486
- query2.on("error", (err2) => {
140487
- reject(err2);
140488
- });
140489
- query2.on("end", () => {
140490
- resolve2();
140491
- });
140492
- });
140493
- queryCompletedAt = process.hrtime.bigint();
140494
- let querySentTime = ms(querySentAt, firstDataAt) - executionTime;
140495
- if (querySentTime < 0) {
140496
- const percent = 0.1;
140497
- const overflow = -querySentTime;
140498
- const keepForSent = overflow * percent;
140499
- const adjustedOverflow = overflow * (1 + percent);
140500
- const total2 = executionTime;
140501
- const ratioExecution = executionTime / total2;
140502
- executionTime -= adjustedOverflow * ratioExecution;
140503
- querySentTime = keepForSent;
140504
- }
140505
- const networkLatencyBefore = querySentTime / 2;
140506
- const networkLatencyAfter = querySentTime / 2;
140507
- const downloadTime = ms(firstDataAt, lastDataAt) - (rowCount > 1 ? parseTime - lastParseTime : 0);
140508
- const total = ms(querySentAt, queryCompletedAt);
140509
- const calculatedTotal = networkLatencyBefore + executionTime + networkLatencyAfter + downloadTime + parseTime + ms(lastRowParsedAt, queryCompletedAt);
140510
- const errorMargin = Math.abs(total - calculatedTotal);
140511
- return {
140512
- networkLatencyBefore,
140513
- planning: null,
140514
- execution: executionTime,
140515
- networkLatencyAfter,
140516
- dataDownload: downloadTime,
140517
- dataParse: parseTime,
140518
- total,
140519
- errorMargin,
140520
- dataSize: bytesReceived
140521
- };
140522
- };
140523
- const benchmarkProxy = async ({ sql, params }, repeats) => {
140524
- const { createConnection: createConnection2 } = await import("mysql2");
140525
- let startAt = 0n;
140526
- let tcpConnectedAt = 0n;
140527
- let tlsConnectedAt = null;
140528
- const createStream = ({ config }) => {
140529
- let stream;
140530
- if (config.socketPath) {
140531
- stream = net.connect(config.socketPath);
140532
- } else {
140533
- stream = net.connect(config.port, config.host);
140534
- }
140535
- if (config.enableKeepAlive) {
140536
- stream.on("connect", () => {
140537
- stream.setKeepAlive(true, config.keepAliveInitialDelay);
140538
- });
140539
- }
140540
- stream.setNoDelay(true);
140541
- stream.once("connect", () => {
140542
- tcpConnectedAt = process.hrtime.bigint();
140543
- });
140544
- return stream;
140545
- };
140546
- startAt = process.hrtime.bigint();
140547
- const connection2 = result2.url ? createConnection2({
140548
- uri: result2.url,
140549
- stream: createStream
140550
- }) : createConnection2({
140551
- ...result2.credentials,
140552
- stream: createStream
140553
- });
140554
- await new Promise((resolve2, reject) => {
140555
- connection2.connect((err2) => {
140556
- tlsConnectedAt = process.hrtime.bigint();
140557
- if (err2) {
140558
- reject(err2);
140559
- } else {
140560
- resolve2();
140561
- }
140562
- });
140563
- });
140564
- const results = [];
140565
- for (let i7 = 0; i7 < repeats; i7++) {
140566
- const r7 = await benchmarkQuery(connection2, sql, params);
140567
- results.push(r7);
140568
- }
140569
- connection2.end();
140570
- return {
140571
- tcpHandshake: ms(startAt, tcpConnectedAt),
140572
- tlsHandshake: tlsConnectedAt ? ms(tcpConnectedAt, tlsConnectedAt) : null,
140573
- dbHandshake: null,
140574
- queries: results
140575
- };
140576
- };
140577
140400
  return {
140578
140401
  db: { query },
140579
140402
  packageName: "mysql2",
140580
140403
  proxy,
140581
140404
  transactionProxy,
140582
- benchmarkProxy,
140583
140405
  database: result2.database,
140584
140406
  migrate: migrateFn
140585
140407
  };
@@ -140729,9 +140551,7 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
140729
140551
  migrate: migrateFn
140730
140552
  };
140731
140553
  }
140732
- console.error(
140733
- "To connect to MsSQL database - please install 'mssql' driver"
140734
- );
140554
+ console.error("To connect to MsSQL database - please install 'mssql' driver");
140735
140555
  process.exit(1);
140736
140556
  };
140737
140557
  prepareSqliteParams = (params, driver2) => {
@@ -140836,7 +140656,10 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
140836
140656
  await remoteCallback(query2, [], "run");
140837
140657
  };
140838
140658
  const proxy = async (params) => {
140839
- const preparedParams = prepareSqliteParams(params.params || [], "d1-http");
140659
+ const preparedParams = prepareSqliteParams(
140660
+ params.params || [],
140661
+ "d1-http"
140662
+ );
140840
140663
  const result2 = await remoteCallback(
140841
140664
  params.sql,
140842
140665
  preparedParams,
@@ -141061,17 +140884,19 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
141061
140884
  };
141062
140885
  const transactionProxy = async (queries) => {
141063
140886
  const results = [];
141064
- const tx = sqlite.transaction((queries2) => {
141065
- for (const query of queries2) {
141066
- let result2 = [];
141067
- if (query.method === "values" || query.method === "get" || query.method === "all") {
141068
- result2 = sqlite.prepare(query.sql).all();
141069
- } else {
141070
- sqlite.prepare(query.sql).run();
140887
+ const tx = sqlite.transaction(
140888
+ (queries2) => {
140889
+ for (const query of queries2) {
140890
+ let result2 = [];
140891
+ if (query.method === "values" || query.method === "get" || query.method === "all") {
140892
+ result2 = sqlite.prepare(query.sql).all();
140893
+ } else {
140894
+ sqlite.prepare(query.sql).run();
140895
+ }
140896
+ results.push(result2);
141071
140897
  }
141072
- results.push(result2);
141073
140898
  }
141074
- });
140899
+ );
141075
140900
  try {
141076
140901
  tx(queries);
141077
140902
  } catch (error3) {
@@ -141079,7 +140904,13 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
141079
140904
  }
141080
140905
  return results;
141081
140906
  };
141082
- return { ...db, packageName: "better-sqlite3", proxy, transactionProxy, migrate: migrateFn };
140907
+ return {
140908
+ ...db,
140909
+ packageName: "better-sqlite3",
140910
+ proxy,
140911
+ transactionProxy,
140912
+ migrate: migrateFn
140913
+ };
141083
140914
  }
141084
140915
  if (await checkPackage("bun")) {
141085
140916
  console.log(withStyle.info(`Using 'bun' driver for database querying`));
@@ -141209,6 +141040,7 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
141209
141040
  // src/cli/commands/studio.ts
141210
141041
  var studio_exports = {};
141211
141042
  __export(studio_exports, {
141043
+ drizzleForDuckDb: () => drizzleForDuckDb,
141212
141044
  drizzleForLibSQL: () => drizzleForLibSQL,
141213
141045
  drizzleForMySQL: () => drizzleForMySQL,
141214
141046
  drizzleForPostgres: () => drizzleForPostgres,
@@ -141239,7 +141071,7 @@ import { getTableConfig as singlestoreTableConfig, SingleStoreTable } from "driz
141239
141071
  import { getTableConfig as sqliteTableConfig, SQLiteTable } from "drizzle-orm/sqlite-core";
141240
141072
  import fs9 from "fs";
141241
141073
  import { createServer } from "https";
141242
- var preparePgSchema, prepareMySqlSchema, prepareMsSqlSchema, prepareSQLiteSchema, prepareSingleStoreSchema, getCustomDefaults, drizzleForPostgres, drizzleForMySQL, drizzleForSQLite, drizzleForLibSQL, drizzleForSingleStore, extractRelations, init2, proxySchema, transactionProxySchema, benchmarkProxySchema, defaultsSchema, schema5, jsonStringify, prepareServer;
141074
+ var preparePgSchema, prepareMySqlSchema, prepareMsSqlSchema, prepareSQLiteSchema, prepareSingleStoreSchema, getCustomDefaults, drizzleForPostgres, drizzleForDuckDb, drizzleForMySQL, drizzleForSQLite, drizzleForLibSQL, drizzleForSingleStore, extractRelations, init2, proxySchema, transactionProxySchema, defaultsSchema, schema5, jsonStringify, prepareServer;
141243
141075
  var init_studio = __esm({
141244
141076
  "src/cli/commands/studio.ts"() {
141245
141077
  "use strict";
@@ -141453,7 +141285,6 @@ var init_studio = __esm({
141453
141285
  packageName: db.packageName,
141454
141286
  proxy: db.proxy,
141455
141287
  transactionProxy: db.transactionProxy,
141456
- benchmarkProxy: db.benchmarkProxy,
141457
141288
  customDefaults,
141458
141289
  schema: pgSchema2,
141459
141290
  relations,
@@ -141461,9 +141292,26 @@ var init_studio = __esm({
141461
141292
  casing: casing2
141462
141293
  };
141463
141294
  };
141295
+ drizzleForDuckDb = async (credentials) => {
141296
+ const { prepareDuckDb: prepareDuckDb2 } = await Promise.resolve().then(() => (init_connections(), connections_exports));
141297
+ const db = await prepareDuckDb2(credentials);
141298
+ const dbUrl = `duckdb://${credentials.url}`;
141299
+ const dbHash = createHash4("sha256").update(dbUrl).digest("hex");
141300
+ return {
141301
+ dbHash,
141302
+ dialect: "duckdb",
141303
+ driver: void 0,
141304
+ packageName: db.packageName,
141305
+ proxy: db.proxy,
141306
+ transactionProxy: db.transactionProxy,
141307
+ customDefaults: [],
141308
+ schema: {},
141309
+ relations: {}
141310
+ };
141311
+ };
141464
141312
  drizzleForMySQL = async (credentials, mysqlSchema, relations, schemaFiles, casing2) => {
141465
141313
  const { connectToMySQL: connectToMySQL2 } = await Promise.resolve().then(() => (init_connections(), connections_exports));
141466
- const { proxy, transactionProxy, benchmarkProxy, database, packageName } = await connectToMySQL2(credentials);
141314
+ const { proxy, transactionProxy, database, packageName } = await connectToMySQL2(credentials);
141467
141315
  const customDefaults = getCustomDefaults(mysqlSchema, casing2);
141468
141316
  let dbUrl;
141469
141317
  if ("url" in credentials) {
@@ -141479,7 +141327,6 @@ var init_studio = __esm({
141479
141327
  databaseName: database,
141480
141328
  proxy,
141481
141329
  transactionProxy,
141482
- benchmarkProxy,
141483
141330
  customDefaults,
141484
141331
  schema: mysqlSchema,
141485
141332
  relations,
@@ -141649,23 +141496,6 @@ var init_studio = __esm({
141649
141496
  ]).optional()
141650
141497
  }).array()
141651
141498
  });
141652
- benchmarkProxySchema = external_exports.object({
141653
- type: external_exports.literal("bproxy"),
141654
- data: external_exports.object({
141655
- query: external_exports.object({
141656
- sql: external_exports.string(),
141657
- params: external_exports.array(external_exports.any()).optional(),
141658
- method: external_exports.union([
141659
- external_exports.literal("values"),
141660
- external_exports.literal("get"),
141661
- external_exports.literal("all"),
141662
- external_exports.literal("run"),
141663
- external_exports.literal("execute")
141664
- ]).optional()
141665
- }),
141666
- repeats: external_exports.number().min(1).optional()
141667
- })
141668
- });
141669
141499
  defaultsSchema = external_exports.object({
141670
141500
  type: external_exports.literal("defaults"),
141671
141501
  data: external_exports.array(
@@ -141680,7 +141510,6 @@ var init_studio = __esm({
141680
141510
  init2,
141681
141511
  proxySchema,
141682
141512
  transactionProxySchema,
141683
- benchmarkProxySchema,
141684
141513
  defaultsSchema
141685
141514
  ]);
141686
141515
  jsonStringify = (data) => {
@@ -141703,7 +141532,6 @@ var init_studio = __esm({
141703
141532
  databaseName,
141704
141533
  proxy,
141705
141534
  transactionProxy,
141706
- benchmarkProxy,
141707
141535
  customDefaults,
141708
141536
  schema: drizzleSchema,
141709
141537
  relations,
@@ -141767,7 +141595,7 @@ var init_studio = __esm({
141767
141595
  console.warn("Error message:", error3.message);
141768
141596
  }
141769
141597
  return c6.json({
141770
- version: "6.3",
141598
+ version: "6.2",
141771
141599
  dialect: dialect6,
141772
141600
  driver: driver2,
141773
141601
  packageName,
@@ -141805,21 +141633,6 @@ var init_studio = __esm({
141805
141633
  }
141806
141634
  );
141807
141635
  }
141808
- if (type === "bproxy") {
141809
- if (!benchmarkProxy) {
141810
- throw new Error("Benchmark proxy is not configured for this database.");
141811
- }
141812
- const result2 = await benchmarkProxy(body.data.query, body.data.repeats || 1);
141813
- const res = jsonStringify(result2);
141814
- return c6.body(
141815
- res,
141816
- {
141817
- headers: {
141818
- "Content-Type": "application/json"
141819
- }
141820
- }
141821
- );
141822
- }
141823
141636
  if (type === "defaults") {
141824
141637
  const columns = body.data;
141825
141638
  const result2 = columns.map((column7) => {