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-sqlite.js CHANGED
@@ -17324,7 +17324,8 @@ var init_schemaValidator = __esm({
17324
17324
  "singlestore",
17325
17325
  "gel",
17326
17326
  "mssql",
17327
- "cockroach"
17327
+ "cockroach",
17328
+ "duckdb"
17328
17329
  ];
17329
17330
  dialect3 = enumType(dialects);
17330
17331
  }
@@ -28717,7 +28718,7 @@ var require_websocket = __commonJS({
28717
28718
  var EventEmitter = require("events");
28718
28719
  var https2 = require("https");
28719
28720
  var http3 = require("http");
28720
- var net2 = require("net");
28721
+ var net = require("net");
28721
28722
  var tls = require("tls");
28722
28723
  var { randomBytes, createHash: createHash5 } = require("crypto");
28723
28724
  var { Duplex, Readable: Readable6 } = require("stream");
@@ -29448,12 +29449,12 @@ var require_websocket = __commonJS({
29448
29449
  }
29449
29450
  function netConnect(options) {
29450
29451
  options.path = options.socketPath;
29451
- return net2.connect(options);
29452
+ return net.connect(options);
29452
29453
  }
29453
29454
  function tlsConnect(options) {
29454
29455
  options.path = void 0;
29455
29456
  if (!options.servername && options.servername !== "") {
29456
- options.servername = net2.isIP(options.host) ? "" : options.host;
29457
+ options.servername = net.isIP(options.host) ? "" : options.host;
29457
29458
  }
29458
29459
  return tls.connect(options);
29459
29460
  }
@@ -33772,7 +33773,7 @@ var init_timing = __esm({
33772
33773
  "../node_modules/.pnpm/@smithy+node-http-handler@4.4.5/node_modules/@smithy/node-http-handler/dist-es/timing.js"() {
33773
33774
  "use strict";
33774
33775
  timing = {
33775
- setTimeout: (cb, ms2) => setTimeout(cb, ms2),
33776
+ setTimeout: (cb, ms) => setTimeout(cb, ms),
33776
33777
  clearTimeout: (timeoutId) => clearTimeout(timeoutId)
33777
33778
  };
33778
33779
  }
@@ -35660,13 +35661,13 @@ var init_schema_date_utils = __esm({
35660
35661
  if (!matches) {
35661
35662
  throw new TypeError(`Invalid RFC3339 timestamp format ${value}`);
35662
35663
  }
35663
- const [, yearStr, monthStr, dayStr, hours, minutes, seconds, , ms2, offsetStr] = matches;
35664
+ const [, yearStr, monthStr, dayStr, hours, minutes, seconds, , ms, offsetStr] = matches;
35664
35665
  range(monthStr, 1, 12);
35665
35666
  range(dayStr, 1, 31);
35666
35667
  range(hours, 0, 23);
35667
35668
  range(minutes, 0, 59);
35668
35669
  range(seconds, 0, 60);
35669
- 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));
35670
+ 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));
35670
35671
  date2.setUTCFullYear(Number(yearStr));
35671
35672
  if (offsetStr.toUpperCase() != "Z") {
35672
35673
  const [, sign2, offsetH, offsetM] = /([+-])(\d\d):(\d\d)/.exec(offsetStr) || [void 0, "+", 0, 0];
@@ -55680,8 +55681,8 @@ var require_datetime2 = __commonJS({
55680
55681
  if (!(object instanceof Date)) {
55681
55682
  throw new errors_1.InvalidArgumentError(`a Date instance was expected, got "${object}"`);
55682
55683
  }
55683
- const ms2 = object.getTime() - TIMESHIFT;
55684
- const us = ms2 * 1e3;
55684
+ const ms = object.getTime() - TIMESHIFT;
55685
+ const us = ms * 1e3;
55685
55686
  buf.writeInt32(8);
55686
55687
  buf.writeInt64(us);
55687
55688
  }
@@ -55691,12 +55692,12 @@ var require_datetime2 = __commonJS({
55691
55692
  return ctx.postDecode(this, us2 + BI_TIMESHIFT_US);
55692
55693
  }
55693
55694
  const us = Number(buf.readBigInt64());
55694
- let ms2 = Math.round(us / 1e3);
55695
- if (Math.abs(us % 1e3) === 500 && Math.abs(ms2) % 2 === 1) {
55696
- ms2 -= 1;
55695
+ let ms = Math.round(us / 1e3);
55696
+ if (Math.abs(us % 1e3) === 500 && Math.abs(ms) % 2 === 1) {
55697
+ ms -= 1;
55697
55698
  }
55698
- ms2 += TIMESHIFT;
55699
- return new Date(ms2);
55699
+ ms += TIMESHIFT;
55700
+ return new Date(ms);
55700
55701
  }
55701
55702
  };
55702
55703
  exports2.DateTimeCodec = DateTimeCodec;
@@ -55717,8 +55718,8 @@ var require_datetime2 = __commonJS({
55717
55718
  if (!(object instanceof datetime_1.LocalDateTime)) {
55718
55719
  throw new errors_1.InvalidArgumentError(`a LocalDateTime instance was expected, got "${object}"`);
55719
55720
  }
55720
- const ms2 = BigInt(datetime_1.localDateInstances.get(object).getTime() - TIMESHIFT);
55721
- let us = ms2 * 1000n + BigInt(object.hour * 36e8 + object.minute * 6e7 + object.second * 1e6 + object.millisecond * 1e3 + object.microsecond);
55721
+ const ms = BigInt(datetime_1.localDateInstances.get(object).getTime() - TIMESHIFT);
55722
+ let us = ms * 1000n + BigInt(object.hour * 36e8 + object.minute * 6e7 + object.second * 1e6 + object.millisecond * 1e3 + object.microsecond);
55722
55723
  if (object.nanosecond === 500 && Math.abs(object.microsecond) % 2 === 1 || object.nanosecond > 500) {
55723
55724
  us += 1n;
55724
55725
  }
@@ -55732,13 +55733,13 @@ var require_datetime2 = __commonJS({
55732
55733
  }
55733
55734
  const bi_ms = bi_us / 1000n;
55734
55735
  let us = Number(bi_us - bi_ms * 1000n);
55735
- let ms2 = Number(bi_ms);
55736
+ let ms = Number(bi_ms);
55736
55737
  if (us < 0) {
55737
55738
  us += 1e3;
55738
- ms2 -= 1;
55739
+ ms -= 1;
55739
55740
  }
55740
- ms2 += TIMESHIFT;
55741
- const date2 = new Date(ms2);
55741
+ ms += TIMESHIFT;
55742
+ const date2 = new Date(ms);
55742
55743
  return new datetime_1.LocalDateTime(date2.getUTCFullYear(), date2.getUTCMonth() + 1, date2.getUTCDate(), date2.getUTCHours(), date2.getUTCMinutes(), date2.getUTCSeconds(), date2.getUTCMilliseconds(), us);
55743
55744
  }
55744
55745
  };
@@ -55800,13 +55801,13 @@ var require_datetime2 = __commonJS({
55800
55801
  }
55801
55802
  let us = Number(bius);
55802
55803
  let seconds = Math.floor(us / 1e6);
55803
- const ms2 = Math.floor(us % 1e6 / 1e3);
55804
- us = us % 1e6 - ms2 * 1e3;
55804
+ const ms = Math.floor(us % 1e6 / 1e3);
55805
+ us = us % 1e6 - ms * 1e3;
55805
55806
  let minutes = Math.floor(seconds / 60);
55806
55807
  seconds = Math.floor(seconds % 60);
55807
55808
  const hours = Math.floor(minutes / 60);
55808
55809
  minutes = Math.floor(minutes % 60);
55809
- return new datetime_1.LocalTime(hours, minutes, seconds, ms2, us);
55810
+ return new datetime_1.LocalTime(hours, minutes, seconds, ms, us);
55810
55811
  }
55811
55812
  };
55812
55813
  exports2.LocalTimeCodec = LocalTimeCodec;
@@ -55883,14 +55884,14 @@ var require_datetime2 = __commonJS({
55883
55884
  const biMillion = 1000000n;
55884
55885
  const biSeconds = bius / biMillion;
55885
55886
  let us = Number(bius - biSeconds * biMillion);
55886
- const ms2 = Math.floor(us / 1e3);
55887
+ const ms = Math.floor(us / 1e3);
55887
55888
  us = us % 1e3;
55888
55889
  let seconds = Number(biSeconds);
55889
55890
  let minutes = Math.floor(seconds / 60);
55890
55891
  seconds = Math.floor(seconds % 60);
55891
55892
  const hours = Math.floor(minutes / 60);
55892
55893
  minutes = Math.floor(minutes % 60);
55893
- return new datetime_1.Duration(0, 0, 0, 0, hours * sign2, minutes * sign2, seconds * sign2, ms2 * sign2, us * sign2);
55894
+ return new datetime_1.Duration(0, 0, 0, 0, hours * sign2, minutes * sign2, seconds * sign2, ms * sign2, us * sign2);
55894
55895
  }
55895
55896
  };
55896
55897
  exports2.DurationCodec = DurationCodec;
@@ -55936,7 +55937,7 @@ var require_datetime2 = __commonJS({
55936
55937
  const million = BigInt(1e6);
55937
55938
  const biSeconds = bius / million;
55938
55939
  let us = Number(bius - biSeconds * million);
55939
- const ms2 = Math.trunc(us / 1e3);
55940
+ const ms = Math.trunc(us / 1e3);
55940
55941
  us = us % 1e3;
55941
55942
  let seconds = Number(biSeconds);
55942
55943
  let minutes = Math.trunc(seconds / 60);
@@ -55947,7 +55948,7 @@ var require_datetime2 = __commonJS({
55947
55948
  days = Math.trunc(days % 7);
55948
55949
  const years = Math.trunc(months2 / 12);
55949
55950
  months2 = Math.trunc(months2 % 12);
55950
- return new datetime_1.RelativeDuration(years, months2, weeks, days, hours * sign2, minutes * sign2, seconds * sign2, ms2 * sign2, us * sign2);
55951
+ return new datetime_1.RelativeDuration(years, months2, weeks, days, hours * sign2, minutes * sign2, seconds * sign2, ms * sign2, us * sign2);
55951
55952
  }
55952
55953
  };
55953
55954
  exports2.RelativeDurationCodec = RelativeDurationCodec;
@@ -66111,41 +66112,41 @@ var require_ms = __commonJS({
66111
66112
  return void 0;
66112
66113
  }
66113
66114
  }
66114
- function fmtShort(ms2) {
66115
- var msAbs = Math.abs(ms2);
66115
+ function fmtShort(ms) {
66116
+ var msAbs = Math.abs(ms);
66116
66117
  if (msAbs >= d6) {
66117
- return Math.round(ms2 / d6) + "d";
66118
+ return Math.round(ms / d6) + "d";
66118
66119
  }
66119
66120
  if (msAbs >= h7) {
66120
- return Math.round(ms2 / h7) + "h";
66121
+ return Math.round(ms / h7) + "h";
66121
66122
  }
66122
66123
  if (msAbs >= m7) {
66123
- return Math.round(ms2 / m7) + "m";
66124
+ return Math.round(ms / m7) + "m";
66124
66125
  }
66125
66126
  if (msAbs >= s7) {
66126
- return Math.round(ms2 / s7) + "s";
66127
+ return Math.round(ms / s7) + "s";
66127
66128
  }
66128
- return ms2 + "ms";
66129
+ return ms + "ms";
66129
66130
  }
66130
- function fmtLong(ms2) {
66131
- var msAbs = Math.abs(ms2);
66131
+ function fmtLong(ms) {
66132
+ var msAbs = Math.abs(ms);
66132
66133
  if (msAbs >= d6) {
66133
- return plural(ms2, msAbs, d6, "day");
66134
+ return plural(ms, msAbs, d6, "day");
66134
66135
  }
66135
66136
  if (msAbs >= h7) {
66136
- return plural(ms2, msAbs, h7, "hour");
66137
+ return plural(ms, msAbs, h7, "hour");
66137
66138
  }
66138
66139
  if (msAbs >= m7) {
66139
- return plural(ms2, msAbs, m7, "minute");
66140
+ return plural(ms, msAbs, m7, "minute");
66140
66141
  }
66141
66142
  if (msAbs >= s7) {
66142
- return plural(ms2, msAbs, s7, "second");
66143
+ return plural(ms, msAbs, s7, "second");
66143
66144
  }
66144
- return ms2 + " ms";
66145
+ return ms + " ms";
66145
66146
  }
66146
- function plural(ms2, msAbs, n6, name) {
66147
+ function plural(ms, msAbs, n6, name) {
66147
66148
  var isPlural = msAbs >= n6 * 1.5;
66148
- return Math.round(ms2 / n6) + " " + name + (isPlural ? "s" : "");
66149
+ return Math.round(ms / n6) + " " + name + (isPlural ? "s" : "");
66149
66150
  }
66150
66151
  }
66151
66152
  });
@@ -66189,8 +66190,8 @@ var require_common2 = __commonJS({
66189
66190
  }
66190
66191
  const self2 = debug;
66191
66192
  const curr = Number(/* @__PURE__ */ new Date());
66192
- const ms2 = curr - (prevTime || curr);
66193
- self2.diff = ms2;
66193
+ const ms = curr - (prevTime || curr);
66194
+ self2.diff = ms;
66194
66195
  self2.prev = prevTime;
66195
66196
  self2.curr = curr;
66196
66197
  prevTime = curr;
@@ -81693,11 +81694,11 @@ var require_TokenExpiredError = __commonJS({
81693
81694
  var require_timespan = __commonJS({
81694
81695
  "../node_modules/.pnpm/jsonwebtoken@9.0.2/node_modules/jsonwebtoken/lib/timespan.js"(exports2, module2) {
81695
81696
  "use strict";
81696
- var ms2 = require_ms();
81697
+ var ms = require_ms();
81697
81698
  module2.exports = function(time2, iat) {
81698
81699
  var timestamp = iat || Math.floor(Date.now() / 1e3);
81699
81700
  if (typeof time2 === "string") {
81700
- var milliseconds = ms2(time2);
81701
+ var milliseconds = ms(time2);
81701
81702
  if (typeof milliseconds === "undefined") {
81702
81703
  return;
81703
81704
  }
@@ -96235,7 +96236,7 @@ var require_dist = __commonJS({
96235
96236
  };
96236
96237
  Object.defineProperty(exports2, "__esModule", { value: true });
96237
96238
  exports2.Agent = void 0;
96238
- var net2 = __importStar2(require("net"));
96239
+ var net = __importStar2(require("net"));
96239
96240
  var http3 = __importStar2(require("http"));
96240
96241
  var https_1 = require("https");
96241
96242
  __exportStar2(require_helpers2(), exports2);
@@ -96275,7 +96276,7 @@ var require_dist = __commonJS({
96275
96276
  if (!this.sockets[name]) {
96276
96277
  this.sockets[name] = [];
96277
96278
  }
96278
- const fakeSocket = new net2.Socket({ writable: false });
96279
+ const fakeSocket = new net.Socket({ writable: false });
96279
96280
  this.sockets[name].push(fakeSocket);
96280
96281
  this.totalSocketCount++;
96281
96282
  return fakeSocket;
@@ -96487,7 +96488,7 @@ var require_dist2 = __commonJS({
96487
96488
  };
96488
96489
  Object.defineProperty(exports2, "__esModule", { value: true });
96489
96490
  exports2.HttpsProxyAgent = void 0;
96490
- var net2 = __importStar2(require("net"));
96491
+ var net = __importStar2(require("net"));
96491
96492
  var tls = __importStar2(require("tls"));
96492
96493
  var assert_1 = __importDefault2(require("assert"));
96493
96494
  var debug_1 = __importDefault2(require_src2());
@@ -96496,7 +96497,7 @@ var require_dist2 = __commonJS({
96496
96497
  var parse_proxy_response_1 = require_parse_proxy_response();
96497
96498
  var debug = (0, debug_1.default)("https-proxy-agent");
96498
96499
  var setServernameFromNonIpHost = (options) => {
96499
- if (options.servername === void 0 && options.host && !net2.isIP(options.host)) {
96500
+ if (options.servername === void 0 && options.host && !net.isIP(options.host)) {
96500
96501
  return {
96501
96502
  ...options,
96502
96503
  servername: options.host
@@ -96536,10 +96537,10 @@ var require_dist2 = __commonJS({
96536
96537
  socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
96537
96538
  } else {
96538
96539
  debug("Creating `net.Socket`: %o", this.connectOpts);
96539
- socket = net2.connect(this.connectOpts);
96540
+ socket = net.connect(this.connectOpts);
96540
96541
  }
96541
96542
  const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
96542
- const host = net2.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
96543
+ const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
96543
96544
  let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r
96544
96545
  `;
96545
96546
  if (proxy.username || proxy.password) {
@@ -96572,7 +96573,7 @@ var require_dist2 = __commonJS({
96572
96573
  return socket;
96573
96574
  }
96574
96575
  socket.destroy();
96575
- const fakeSocket = new net2.Socket({ writable: false });
96576
+ const fakeSocket = new net.Socket({ writable: false });
96576
96577
  fakeSocket.readable = true;
96577
96578
  req.once("socket", (s7) => {
96578
96579
  debug("Replaying proxy buffer for failed request");
@@ -96637,7 +96638,7 @@ var require_dist3 = __commonJS({
96637
96638
  };
96638
96639
  Object.defineProperty(exports2, "__esModule", { value: true });
96639
96640
  exports2.HttpProxyAgent = void 0;
96640
- var net2 = __importStar2(require("net"));
96641
+ var net = __importStar2(require("net"));
96641
96642
  var tls = __importStar2(require("tls"));
96642
96643
  var debug_1 = __importDefault2(require_src2());
96643
96644
  var events_1 = require("events");
@@ -96710,7 +96711,7 @@ var require_dist3 = __commonJS({
96710
96711
  socket = tls.connect(this.connectOpts);
96711
96712
  } else {
96712
96713
  debug("Creating `net.Socket`: %o", this.connectOpts);
96713
- socket = net2.connect(this.connectOpts);
96714
+ socket = net.connect(this.connectOpts);
96714
96715
  }
96715
96716
  await (0, events_1.once)(socket, "connect");
96716
96717
  return socket;
@@ -135590,7 +135591,7 @@ var require_connection = __commonJS({
135590
135591
  var _crypto = _interopRequireDefault(require("crypto"));
135591
135592
  var _os = _interopRequireDefault(require("os"));
135592
135593
  var tls = _interopRequireWildcard(require("tls"));
135593
- var net2 = _interopRequireWildcard(require("net"));
135594
+ var net = _interopRequireWildcard(require("net"));
135594
135595
  var _dns = _interopRequireDefault(require("dns"));
135595
135596
  var _constants = _interopRequireDefault(require("constants"));
135596
135597
  var _stream = require("stream");
@@ -136639,7 +136640,7 @@ var require_connection = __commonJS({
136639
136640
  async wrapWithTls(socket, signal) {
136640
136641
  signal.throwIfAborted();
136641
136642
  const secureContext = tls.createSecureContext(this.secureContextOptions);
136642
- const serverName = !net2.isIP(this.config.server) ? this.config.server : "";
136643
+ const serverName = !net.isIP(this.config.server) ? this.config.server : "";
136643
136644
  const encryptOptions = {
136644
136645
  host: this.config.server,
136645
136646
  socket,
@@ -139545,6 +139546,7 @@ __export(connections_exports, {
139545
139546
  connectToSQLite: () => connectToSQLite,
139546
139547
  connectToSingleStore: () => connectToSingleStore,
139547
139548
  prepareCockroach: () => prepareCockroach,
139549
+ prepareDuckDb: () => prepareDuckDb,
139548
139550
  prepareGelDB: () => prepareGelDB,
139549
139551
  preparePostgresDB: () => preparePostgresDB
139550
139552
  });
@@ -139561,11 +139563,10 @@ function parseMssqlUrl(url) {
139561
139563
  }
139562
139564
  };
139563
139565
  }
139564
- var import_net, ms, normalisePGliteUrl, preparePostgresDB, prepareCockroach, prepareGelDB, parseSingleStoreCredentials, connectToSingleStore, parseMysqlCredentials, connectToMySQL, parseMssqlCredentials, connectToMsSQL, prepareSqliteParams, preparePGliteParams, connectToSQLite, connectToLibSQL;
139566
+ var normalisePGliteUrl, preparePostgresDB, prepareDuckDb, prepareCockroach, prepareGelDB, parseSingleStoreCredentials, connectToSingleStore, parseMysqlCredentials, connectToMySQL, parseMssqlCredentials, connectToMsSQL, prepareSqliteParams, preparePGliteParams, connectToSQLite, connectToLibSQL;
139565
139567
  var init_connections = __esm({
139566
139568
  "src/cli/connections.ts"() {
139567
139569
  "use strict";
139568
- import_net = __toESM(require("net"));
139569
139570
  init_src();
139570
139571
  init_wrapper();
139571
139572
  init_utils();
@@ -139573,7 +139574,6 @@ var init_connections = __esm({
139573
139574
  init_when_json_met_bigint();
139574
139575
  init_utils3();
139575
139576
  init_outputs();
139576
- ms = (a6, b6) => Number(b6 - a6) / 1e6;
139577
139577
  normalisePGliteUrl = (it) => {
139578
139578
  if (it.startsWith("file:")) {
139579
139579
  return it.substring(5);
@@ -139697,7 +139697,13 @@ var init_connections = __esm({
139697
139697
  }
139698
139698
  return results;
139699
139699
  };
139700
- return { packageName: "pglite", query, proxy, transactionProxy, migrate: migrateFn };
139700
+ return {
139701
+ packageName: "pglite",
139702
+ query,
139703
+ proxy,
139704
+ transactionProxy,
139705
+ migrate: migrateFn
139706
+ };
139701
139707
  }
139702
139708
  assertUnreachable(driver2);
139703
139709
  }
@@ -139728,13 +139734,13 @@ var init_connections = __esm({
139728
139734
  return pg.types.getTypeParser(typeId, format2);
139729
139735
  }
139730
139736
  };
139731
- const pool = "url" in credentials ? new pg.Pool({ connectionString: credentials.url, max: 1 }) : new pg.Pool({ ...credentials, ssl, max: 1 });
139732
- const db = drizzle({ client: pool });
139737
+ const client = "url" in credentials ? new pg.Pool({ connectionString: credentials.url, max: 1 }) : new pg.Pool({ ...credentials, ssl, max: 1 });
139738
+ const db = drizzle({ client });
139733
139739
  const migrateFn = async (config) => {
139734
139740
  return migrate(db, config);
139735
139741
  };
139736
139742
  const query = async (sql, params) => {
139737
- const result2 = await pool.query({
139743
+ const result2 = await client.query({
139738
139744
  text: sql,
139739
139745
  values: params ?? [],
139740
139746
  types: types3
@@ -139744,7 +139750,7 @@ var init_connections = __esm({
139744
139750
  return result2.rows;
139745
139751
  };
139746
139752
  const proxy = async (params) => {
139747
- const result2 = await pool.query({
139753
+ const result2 = await client.query({
139748
139754
  text: params.sql,
139749
139755
  values: params.params,
139750
139756
  ...params.mode === "array" && { rowMode: "array" },
@@ -139756,7 +139762,7 @@ var init_connections = __esm({
139756
139762
  };
139757
139763
  const transactionProxy = async (queries) => {
139758
139764
  const results = [];
139759
- const tx = await pool.connect();
139765
+ const tx = await client.connect();
139760
139766
  try {
139761
139767
  await tx.query("BEGIN");
139762
139768
  for (const query2 of queries) {
@@ -139775,119 +139781,13 @@ var init_connections = __esm({
139775
139781
  }
139776
139782
  return results;
139777
139783
  };
139778
- const benchmarkQuery = async (client, sql, params) => {
139779
- const explainResult = await pool.query({
139780
- text: `EXPLAIN ANALYZE ${sql}`,
139781
- values: params ?? [],
139782
- types: types3
139783
- });
139784
- const stringifiedResult = JSON.stringify(explainResult.rows);
139785
- const planningMatch = stringifiedResult.match(/Planning Time:\s*([\d.]+)\s*ms/i);
139786
- const executionMatch = stringifiedResult.match(/Execution Time:\s*([\d.]+)\s*ms/i);
139787
- let planningTime = Number(planningMatch[1]);
139788
- let executionTime = Number(executionMatch[1]);
139789
- let querySentAt = 0n;
139790
- let firstDataAt = 0n;
139791
- let lastDataAt = 0n;
139792
- let lastRowParsedAt = 0n;
139793
- let queryCompletedAt = 0n;
139794
- let bytesReceived = 0;
139795
- let rowCount = 0;
139796
- let parseTime = 0;
139797
- let lastParseTime = 0;
139798
- const rowDescriptionListener = (data) => {
139799
- if (firstDataAt === 0n) {
139800
- firstDataAt = process.hrtime.bigint();
139801
- }
139802
- bytesReceived += data.length;
139803
- };
139804
- const originalRowListener = client.connection.listeners("dataRow")[0];
139805
- const wrappedRowListener = (data) => {
139806
- rowCount += 1;
139807
- const start = process.hrtime.bigint();
139808
- lastDataAt = start;
139809
- originalRowListener.apply(client.connection, [data]);
139810
- const end2 = process.hrtime.bigint();
139811
- lastRowParsedAt = end2;
139812
- lastParseTime = ms(start, end2);
139813
- parseTime += lastParseTime;
139814
- bytesReceived += data.length;
139815
- };
139816
- client.connection.removeAllListeners("dataRow");
139817
- client.connection.addListener("dataRow", wrappedRowListener);
139818
- client.connection.prependListener("rowDescription", rowDescriptionListener);
139819
- querySentAt = process.hrtime.bigint();
139820
- await client.query({
139821
- text: sql,
139822
- values: params,
139823
- types: types3
139824
- });
139825
- queryCompletedAt = process.hrtime.bigint();
139826
- client.connection.removeListener("rowDescription", rowDescriptionListener);
139827
- client.connection.removeAllListeners("dataRow");
139828
- client.connection.addListener("dataRow", originalRowListener);
139829
- let querySentTime = ms(querySentAt, firstDataAt) - executionTime - planningTime;
139830
- if (querySentTime < 0) {
139831
- const percent = 0.1;
139832
- const overflow = -querySentTime;
139833
- const keepForSent = overflow * percent;
139834
- const adjustedOverflow = overflow * (1 + percent);
139835
- const total2 = planningTime + executionTime;
139836
- const ratioPlanning = planningTime / total2;
139837
- const ratioExecution = executionTime / total2;
139838
- planningTime -= adjustedOverflow * ratioPlanning;
139839
- executionTime -= adjustedOverflow * ratioExecution;
139840
- querySentTime = keepForSent;
139841
- }
139842
- const networkLatencyBefore = querySentTime / 2;
139843
- const networkLatencyAfter = querySentTime / 2;
139844
- const downloadTime = ms(firstDataAt, lastDataAt) - (rowCount > 1 ? parseTime - lastParseTime : 0);
139845
- const total = ms(querySentAt, queryCompletedAt);
139846
- const calculatedTotal = networkLatencyBefore + planningTime + executionTime + networkLatencyAfter + downloadTime + parseTime + ms(lastRowParsedAt, queryCompletedAt);
139847
- const errorMargin = Math.abs(total - calculatedTotal);
139848
- return {
139849
- networkLatencyBefore,
139850
- planning: planningTime,
139851
- execution: executionTime,
139852
- networkLatencyAfter,
139853
- dataDownload: downloadTime,
139854
- dataParse: parseTime,
139855
- total,
139856
- errorMargin,
139857
- dataSize: bytesReceived
139858
- };
139859
- };
139860
- const benchmarkProxy = async ({ sql, params }, repeats) => {
139861
- let startAt = 0n;
139862
- let tcpConnectedAt = 0n;
139863
- let tlsConnectedAt = null;
139864
- let dbReadyAt = 0n;
139865
- const client = "url" in credentials ? new pg.Client({ connectionString: credentials.url }) : new pg.Client({ ...credentials, ssl });
139866
- client.connection.once("connect", () => {
139867
- tcpConnectedAt = process.hrtime.bigint();
139868
- });
139869
- client.connection.prependOnceListener("sslconnect", () => {
139870
- tlsConnectedAt = process.hrtime.bigint();
139871
- });
139872
- client.connection.prependOnceListener("readyForQuery", () => {
139873
- dbReadyAt = process.hrtime.bigint();
139874
- });
139875
- startAt = process.hrtime.bigint();
139876
- await client.connect();
139877
- const results = [];
139878
- for (let i7 = 0; i7 < repeats; i7++) {
139879
- const r7 = await benchmarkQuery(client, sql, params);
139880
- results.push(r7);
139881
- }
139882
- await client.end();
139883
- return {
139884
- tcpHandshake: ms(startAt, tcpConnectedAt),
139885
- tlsHandshake: tlsConnectedAt ? ms(tcpConnectedAt, tlsConnectedAt) : null,
139886
- dbHandshake: ms(tlsConnectedAt ?? tcpConnectedAt, dbReadyAt),
139887
- queries: results
139888
- };
139784
+ return {
139785
+ packageName: "pg",
139786
+ query,
139787
+ proxy,
139788
+ transactionProxy,
139789
+ migrate: migrateFn
139889
139790
  };
139890
- return { packageName: "pg", query, proxy, transactionProxy, benchmarkProxy, migrate: migrateFn };
139891
139791
  }
139892
139792
  if (await checkPackage("postgres")) {
139893
139793
  console.log(
@@ -139938,7 +139838,13 @@ var init_connections = __esm({
139938
139838
  }
139939
139839
  return results;
139940
139840
  };
139941
- return { packageName: "postgres", query, proxy, transactionProxy, migrate: migrateFn };
139841
+ return {
139842
+ packageName: "postgres",
139843
+ query,
139844
+ proxy,
139845
+ transactionProxy,
139846
+ migrate: migrateFn
139847
+ };
139942
139848
  }
139943
139849
  if (await checkPackage("@vercel/postgres")) {
139944
139850
  console.log(
@@ -140019,7 +139925,13 @@ var init_connections = __esm({
140019
139925
  }
140020
139926
  return results;
140021
139927
  };
140022
- return { packageName: "@vercel/postgres", query, proxy, transactionProxy, migrate: migrateFn };
139928
+ return {
139929
+ packageName: "@vercel/postgres",
139930
+ query,
139931
+ proxy,
139932
+ transactionProxy,
139933
+ migrate: migrateFn
139934
+ };
140023
139935
  }
140024
139936
  if (await checkPackage("@neondatabase/serverless")) {
140025
139937
  console.log(
@@ -140032,7 +139944,11 @@ var init_connections = __esm({
140032
139944
  "'@neondatabase/serverless' can only connect to remote Neon/Vercel Postgres/Supabase instances through a websocket"
140033
139945
  )
140034
139946
  );
140035
- const { Pool, neonConfig, types: pgTypes } = require("@neondatabase/serverless");
139947
+ const {
139948
+ Pool,
139949
+ neonConfig,
139950
+ types: pgTypes
139951
+ } = require("@neondatabase/serverless");
140036
139952
  const { drizzle } = require("drizzle-orm/neon-serverless");
140037
139953
  const { migrate } = require("drizzle-orm/neon-serverless/migrator");
140038
139954
  const ssl = "ssl" in credentials ? credentials.ssl === "prefer" || credentials.ssl === "require" || credentials.ssl === "allow" ? { rejectUnauthorized: false } : credentials.ssl === "verify-full" ? {} : credentials.ssl : {};
@@ -140102,7 +140018,13 @@ var init_connections = __esm({
140102
140018
  }
140103
140019
  return results;
140104
140020
  };
140105
- return { packageName: "@neondatabase/serverless", query, proxy, transactionProxy, migrate: migrateFn };
140021
+ return {
140022
+ packageName: "@neondatabase/serverless",
140023
+ query,
140024
+ proxy,
140025
+ transactionProxy,
140026
+ migrate: migrateFn
140027
+ };
140106
140028
  }
140107
140029
  if (await checkPackage("bun")) {
140108
140030
  console.log(withStyle.info(`Using 'bun' driver for database querying`));
@@ -140153,6 +140075,54 @@ var init_connections = __esm({
140153
140075
  console.warn("For the 'bun' driver, run your script using: bun --bun");
140154
140076
  process.exit(1);
140155
140077
  };
140078
+ prepareDuckDb = async (credentials) => {
140079
+ if (await checkPackage("@duckdb/node-api")) {
140080
+ console.log(
140081
+ withStyle.info(`Using '@duckdb/node-api' driver for database querying`)
140082
+ );
140083
+ const { DuckDBInstance } = require("@duckdb/node-api");
140084
+ const instance = await DuckDBInstance.create(credentials.url);
140085
+ const client = await instance.connect();
140086
+ const query = async (sql, params = []) => {
140087
+ const result2 = await client.run(sql, params);
140088
+ const rows = await result2.getRowObjectsJson();
140089
+ return rows;
140090
+ };
140091
+ const proxy = async (params) => {
140092
+ const result2 = await client.run(params.sql, params.params);
140093
+ return params.mode === "array" ? await result2.getRowsJson() : await result2.getRowObjectsJson();
140094
+ };
140095
+ const transactionProxy = async (queries) => {
140096
+ const results = [];
140097
+ try {
140098
+ await client.run("BEGIN");
140099
+ for (const query2 of queries) {
140100
+ const result2 = await client.run(query2.sql);
140101
+ results.push(await result2.getRowObjectsJson());
140102
+ }
140103
+ await client.run("COMMIT");
140104
+ } catch (error3) {
140105
+ await client.run("ROLLBACK");
140106
+ results.push(error3);
140107
+ }
140108
+ return results;
140109
+ };
140110
+ return {
140111
+ packageName: "@duckdb/node-api",
140112
+ query,
140113
+ proxy,
140114
+ transactionProxy,
140115
+ migrate: () => {
140116
+ throw new Error("DuckDB does not support migrations");
140117
+ }
140118
+ };
140119
+ }
140120
+ console.error(
140121
+ // "To connect to DuckDb database - please install either of 'duckdb', '@duckdb/node-api' drivers",
140122
+ "To connect to DuckDb database - please install '@duckdb/node-api' driver"
140123
+ );
140124
+ process.exit(1);
140125
+ };
140156
140126
  prepareCockroach = async (credentials) => {
140157
140127
  if (await checkPackage("pg")) {
140158
140128
  const { default: pg } = require("pg");
@@ -140205,9 +140175,7 @@ var init_connections = __esm({
140205
140175
  };
140206
140176
  return { query, proxy, migrate: migrateFn };
140207
140177
  }
140208
- console.error(
140209
- "To connect to Cockroach - please install 'pg' package"
140210
- );
140178
+ console.error("To connect to Cockroach - please install 'pg' package");
140211
140179
  process.exit(1);
140212
140180
  };
140213
140181
  prepareGelDB = async (credentials) => {
@@ -140266,9 +140234,7 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
140266
140234
  };
140267
140235
  return { packageName: "gel", query, proxy, transactionProxy };
140268
140236
  }
140269
- console.error(
140270
- "To connect to gel database - please install 'edgedb' driver"
140271
- );
140237
+ console.error("To connect to gel database - please install 'edgedb' driver");
140272
140238
  process.exit(1);
140273
140239
  };
140274
140240
  parseSingleStoreCredentials = (credentials) => {
@@ -140382,6 +140348,7 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
140382
140348
  }
140383
140349
  return next();
140384
140350
  };
140351
+ await connection.connect();
140385
140352
  const query = async (sql, params) => {
140386
140353
  const res = await connection.execute({
140387
140354
  sql,
@@ -140421,156 +140388,11 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
140421
140388
  }
140422
140389
  return results;
140423
140390
  };
140424
- const benchmarkQuery = async (newConnection, sql, params) => {
140425
- const explainResult = await connection.query({
140426
- sql: `EXPLAIN ANALYZE ${sql}`,
140427
- values: params ?? [],
140428
- typeCast
140429
- });
140430
- const stringifiedResult = JSON.stringify(explainResult[0]);
140431
- const timeMatch = stringifiedResult.match(
140432
- /actual time=([0-9.eE+-]+)\.\.([0-9.eE+-]+)/
140433
- );
140434
- const lastRowTime = Number(timeMatch[2]);
140435
- let executionTime = lastRowTime;
140436
- let querySentAt = 0n;
140437
- let firstDataAt = 0n;
140438
- let lastDataAt = 0n;
140439
- let lastRowParsedAt = 0n;
140440
- let queryCompletedAt = 0n;
140441
- let bytesReceived = 0;
140442
- let rowCount = 0;
140443
- let parseTime = 0;
140444
- let lastParseTime = 0;
140445
- querySentAt = process.hrtime.bigint();
140446
- await new Promise((resolve2, reject) => {
140447
- const query2 = newConnection.query({
140448
- sql,
140449
- values: params ?? [],
140450
- typeCast
140451
- });
140452
- const originalRowHandler = query2.row;
140453
- let packets = 0;
140454
- const wrappedRowListener = (packet, connection2) => {
140455
- packets += 1;
140456
- if (firstDataAt === 0n) {
140457
- firstDataAt = process.hrtime.bigint();
140458
- bytesReceived += packet.start;
140459
- }
140460
- const start = process.hrtime.bigint();
140461
- lastDataAt = start;
140462
- const res = originalRowHandler.apply(query2, [packet, connection2]);
140463
- const end2 = process.hrtime.bigint();
140464
- lastRowParsedAt = end2;
140465
- lastParseTime = ms(start, end2);
140466
- parseTime += lastParseTime;
140467
- bytesReceived += packet.length();
140468
- if (!res || packet.isEOF()) {
140469
- return res;
140470
- }
140471
- return wrappedRowListener;
140472
- };
140473
- query2.row = wrappedRowListener;
140474
- query2.on("result", () => {
140475
- rowCount += 1;
140476
- });
140477
- query2.on("error", (err2) => {
140478
- reject(err2);
140479
- });
140480
- query2.on("end", () => {
140481
- resolve2();
140482
- });
140483
- });
140484
- queryCompletedAt = process.hrtime.bigint();
140485
- let querySentTime = ms(querySentAt, firstDataAt) - executionTime;
140486
- if (querySentTime < 0) {
140487
- const percent = 0.1;
140488
- const overflow = -querySentTime;
140489
- const keepForSent = overflow * percent;
140490
- const adjustedOverflow = overflow * (1 + percent);
140491
- const total2 = executionTime;
140492
- const ratioExecution = executionTime / total2;
140493
- executionTime -= adjustedOverflow * ratioExecution;
140494
- querySentTime = keepForSent;
140495
- }
140496
- const networkLatencyBefore = querySentTime / 2;
140497
- const networkLatencyAfter = querySentTime / 2;
140498
- const downloadTime = ms(firstDataAt, lastDataAt) - (rowCount > 1 ? parseTime - lastParseTime : 0);
140499
- const total = ms(querySentAt, queryCompletedAt);
140500
- const calculatedTotal = networkLatencyBefore + executionTime + networkLatencyAfter + downloadTime + parseTime + ms(lastRowParsedAt, queryCompletedAt);
140501
- const errorMargin = Math.abs(total - calculatedTotal);
140502
- return {
140503
- networkLatencyBefore,
140504
- planning: null,
140505
- execution: executionTime,
140506
- networkLatencyAfter,
140507
- dataDownload: downloadTime,
140508
- dataParse: parseTime,
140509
- total,
140510
- errorMargin,
140511
- dataSize: bytesReceived
140512
- };
140513
- };
140514
- const benchmarkProxy = async ({ sql, params }, repeats) => {
140515
- const { createConnection: createConnection2 } = require("mysql2");
140516
- let startAt = 0n;
140517
- let tcpConnectedAt = 0n;
140518
- let tlsConnectedAt = null;
140519
- const createStream = ({ config }) => {
140520
- let stream;
140521
- if (config.socketPath) {
140522
- stream = import_net.default.connect(config.socketPath);
140523
- } else {
140524
- stream = import_net.default.connect(config.port, config.host);
140525
- }
140526
- if (config.enableKeepAlive) {
140527
- stream.on("connect", () => {
140528
- stream.setKeepAlive(true, config.keepAliveInitialDelay);
140529
- });
140530
- }
140531
- stream.setNoDelay(true);
140532
- stream.once("connect", () => {
140533
- tcpConnectedAt = process.hrtime.bigint();
140534
- });
140535
- return stream;
140536
- };
140537
- startAt = process.hrtime.bigint();
140538
- const connection2 = result2.url ? createConnection2({
140539
- uri: result2.url,
140540
- stream: createStream
140541
- }) : createConnection2({
140542
- ...result2.credentials,
140543
- stream: createStream
140544
- });
140545
- await new Promise((resolve2, reject) => {
140546
- connection2.connect((err2) => {
140547
- tlsConnectedAt = process.hrtime.bigint();
140548
- if (err2) {
140549
- reject(err2);
140550
- } else {
140551
- resolve2();
140552
- }
140553
- });
140554
- });
140555
- const results = [];
140556
- for (let i7 = 0; i7 < repeats; i7++) {
140557
- const r7 = await benchmarkQuery(connection2, sql, params);
140558
- results.push(r7);
140559
- }
140560
- connection2.end();
140561
- return {
140562
- tcpHandshake: ms(startAt, tcpConnectedAt),
140563
- tlsHandshake: tlsConnectedAt ? ms(tcpConnectedAt, tlsConnectedAt) : null,
140564
- dbHandshake: null,
140565
- queries: results
140566
- };
140567
- };
140568
140391
  return {
140569
140392
  db: { query },
140570
140393
  packageName: "mysql2",
140571
140394
  proxy,
140572
140395
  transactionProxy,
140573
- benchmarkProxy,
140574
140396
  database: result2.database,
140575
140397
  migrate: migrateFn
140576
140398
  };
@@ -140720,9 +140542,7 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
140720
140542
  migrate: migrateFn
140721
140543
  };
140722
140544
  }
140723
- console.error(
140724
- "To connect to MsSQL database - please install 'mssql' driver"
140725
- );
140545
+ console.error("To connect to MsSQL database - please install 'mssql' driver");
140726
140546
  process.exit(1);
140727
140547
  };
140728
140548
  prepareSqliteParams = (params, driver2) => {
@@ -140827,7 +140647,10 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
140827
140647
  await remoteCallback(query2, [], "run");
140828
140648
  };
140829
140649
  const proxy = async (params) => {
140830
- const preparedParams = prepareSqliteParams(params.params || [], "d1-http");
140650
+ const preparedParams = prepareSqliteParams(
140651
+ params.params || [],
140652
+ "d1-http"
140653
+ );
140831
140654
  const result2 = await remoteCallback(
140832
140655
  params.sql,
140833
140656
  preparedParams,
@@ -141052,17 +140875,19 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
141052
140875
  };
141053
140876
  const transactionProxy = async (queries) => {
141054
140877
  const results = [];
141055
- const tx = sqlite.transaction((queries2) => {
141056
- for (const query of queries2) {
141057
- let result2 = [];
141058
- if (query.method === "values" || query.method === "get" || query.method === "all") {
141059
- result2 = sqlite.prepare(query.sql).all();
141060
- } else {
141061
- sqlite.prepare(query.sql).run();
140878
+ const tx = sqlite.transaction(
140879
+ (queries2) => {
140880
+ for (const query of queries2) {
140881
+ let result2 = [];
140882
+ if (query.method === "values" || query.method === "get" || query.method === "all") {
140883
+ result2 = sqlite.prepare(query.sql).all();
140884
+ } else {
140885
+ sqlite.prepare(query.sql).run();
140886
+ }
140887
+ results.push(result2);
141062
140888
  }
141063
- results.push(result2);
141064
140889
  }
141065
- });
140890
+ );
141066
140891
  try {
141067
140892
  tx(queries);
141068
140893
  } catch (error3) {
@@ -141070,7 +140895,13 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
141070
140895
  }
141071
140896
  return results;
141072
140897
  };
141073
- return { ...db, packageName: "better-sqlite3", proxy, transactionProxy, migrate: migrateFn };
140898
+ return {
140899
+ ...db,
140900
+ packageName: "better-sqlite3",
140901
+ proxy,
140902
+ transactionProxy,
140903
+ migrate: migrateFn
140904
+ };
141074
140905
  }
141075
140906
  if (await checkPackage("bun")) {
141076
140907
  console.log(withStyle.info(`Using 'bun' driver for database querying`));
@@ -141200,6 +141031,7 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
141200
141031
  // src/cli/commands/studio.ts
141201
141032
  var studio_exports = {};
141202
141033
  __export(studio_exports, {
141034
+ drizzleForDuckDb: () => drizzleForDuckDb,
141203
141035
  drizzleForLibSQL: () => drizzleForLibSQL,
141204
141036
  drizzleForMySQL: () => drizzleForMySQL,
141205
141037
  drizzleForPostgres: () => drizzleForPostgres,
@@ -141213,7 +141045,7 @@ __export(studio_exports, {
141213
141045
  prepareServer: () => prepareServer,
141214
141046
  prepareSingleStoreSchema: () => prepareSingleStoreSchema
141215
141047
  });
141216
- var import_crypto9, import_drizzle_orm, import_relations, import_mssql_core2, import_mysql_core2, import_pg_core2, import_singlestore_core, import_sqlite_core2, import_fs4, import_node_https2, preparePgSchema, prepareMySqlSchema, prepareMsSqlSchema, prepareSQLiteSchema, prepareSingleStoreSchema, getCustomDefaults, drizzleForPostgres, drizzleForMySQL, drizzleForSQLite, drizzleForLibSQL, drizzleForSingleStore, extractRelations, init2, proxySchema, transactionProxySchema, benchmarkProxySchema, defaultsSchema, schema5, jsonStringify, prepareServer;
141048
+ var import_crypto9, import_drizzle_orm, import_relations, import_mssql_core2, import_mysql_core2, import_pg_core2, import_singlestore_core, import_sqlite_core2, import_fs4, import_node_https2, preparePgSchema, prepareMySqlSchema, prepareMsSqlSchema, prepareSQLiteSchema, prepareSingleStoreSchema, getCustomDefaults, drizzleForPostgres, drizzleForDuckDb, drizzleForMySQL, drizzleForSQLite, drizzleForLibSQL, drizzleForSingleStore, extractRelations, init2, proxySchema, transactionProxySchema, defaultsSchema, schema5, jsonStringify, prepareServer;
141217
141049
  var init_studio = __esm({
141218
141050
  "src/cli/commands/studio.ts"() {
141219
141051
  "use strict";
@@ -141437,7 +141269,6 @@ var init_studio = __esm({
141437
141269
  packageName: db.packageName,
141438
141270
  proxy: db.proxy,
141439
141271
  transactionProxy: db.transactionProxy,
141440
- benchmarkProxy: db.benchmarkProxy,
141441
141272
  customDefaults,
141442
141273
  schema: pgSchema2,
141443
141274
  relations,
@@ -141445,9 +141276,26 @@ var init_studio = __esm({
141445
141276
  casing: casing2
141446
141277
  };
141447
141278
  };
141279
+ drizzleForDuckDb = async (credentials) => {
141280
+ const { prepareDuckDb: prepareDuckDb2 } = await Promise.resolve().then(() => (init_connections(), connections_exports));
141281
+ const db = await prepareDuckDb2(credentials);
141282
+ const dbUrl = `duckdb://${credentials.url}`;
141283
+ const dbHash = (0, import_crypto9.createHash)("sha256").update(dbUrl).digest("hex");
141284
+ return {
141285
+ dbHash,
141286
+ dialect: "duckdb",
141287
+ driver: void 0,
141288
+ packageName: db.packageName,
141289
+ proxy: db.proxy,
141290
+ transactionProxy: db.transactionProxy,
141291
+ customDefaults: [],
141292
+ schema: {},
141293
+ relations: {}
141294
+ };
141295
+ };
141448
141296
  drizzleForMySQL = async (credentials, mysqlSchema, relations, schemaFiles, casing2) => {
141449
141297
  const { connectToMySQL: connectToMySQL2 } = await Promise.resolve().then(() => (init_connections(), connections_exports));
141450
- const { proxy, transactionProxy, benchmarkProxy, database, packageName } = await connectToMySQL2(credentials);
141298
+ const { proxy, transactionProxy, database, packageName } = await connectToMySQL2(credentials);
141451
141299
  const customDefaults = getCustomDefaults(mysqlSchema, casing2);
141452
141300
  let dbUrl;
141453
141301
  if ("url" in credentials) {
@@ -141463,7 +141311,6 @@ var init_studio = __esm({
141463
141311
  databaseName: database,
141464
141312
  proxy,
141465
141313
  transactionProxy,
141466
- benchmarkProxy,
141467
141314
  customDefaults,
141468
141315
  schema: mysqlSchema,
141469
141316
  relations,
@@ -141633,23 +141480,6 @@ var init_studio = __esm({
141633
141480
  ]).optional()
141634
141481
  }).array()
141635
141482
  });
141636
- benchmarkProxySchema = external_exports.object({
141637
- type: external_exports.literal("bproxy"),
141638
- data: external_exports.object({
141639
- query: external_exports.object({
141640
- sql: external_exports.string(),
141641
- params: external_exports.array(external_exports.any()).optional(),
141642
- method: external_exports.union([
141643
- external_exports.literal("values"),
141644
- external_exports.literal("get"),
141645
- external_exports.literal("all"),
141646
- external_exports.literal("run"),
141647
- external_exports.literal("execute")
141648
- ]).optional()
141649
- }),
141650
- repeats: external_exports.number().min(1).optional()
141651
- })
141652
- });
141653
141483
  defaultsSchema = external_exports.object({
141654
141484
  type: external_exports.literal("defaults"),
141655
141485
  data: external_exports.array(
@@ -141664,7 +141494,6 @@ var init_studio = __esm({
141664
141494
  init2,
141665
141495
  proxySchema,
141666
141496
  transactionProxySchema,
141667
- benchmarkProxySchema,
141668
141497
  defaultsSchema
141669
141498
  ]);
141670
141499
  jsonStringify = (data) => {
@@ -141687,7 +141516,6 @@ var init_studio = __esm({
141687
141516
  databaseName,
141688
141517
  proxy,
141689
141518
  transactionProxy,
141690
- benchmarkProxy,
141691
141519
  customDefaults,
141692
141520
  schema: drizzleSchema,
141693
141521
  relations,
@@ -141751,7 +141579,7 @@ var init_studio = __esm({
141751
141579
  console.warn("Error message:", error3.message);
141752
141580
  }
141753
141581
  return c6.json({
141754
- version: "6.3",
141582
+ version: "6.2",
141755
141583
  dialect: dialect6,
141756
141584
  driver: driver2,
141757
141585
  packageName,
@@ -141789,21 +141617,6 @@ var init_studio = __esm({
141789
141617
  }
141790
141618
  );
141791
141619
  }
141792
- if (type === "bproxy") {
141793
- if (!benchmarkProxy) {
141794
- throw new Error("Benchmark proxy is not configured for this database.");
141795
- }
141796
- const result2 = await benchmarkProxy(body.data.query, body.data.repeats || 1);
141797
- const res = jsonStringify(result2);
141798
- return c6.body(
141799
- res,
141800
- {
141801
- headers: {
141802
- "Content-Type": "application/json"
141803
- }
141804
- }
141805
- );
141806
- }
141807
141620
  if (type === "defaults") {
141808
141621
  const columns = body.data;
141809
141622
  const result2 = columns.map((column7) => {