drizzle-kit 1.0.0-beta.2-31baa2b → 1.0.0-beta.2-f9236e3

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/bin.cjs CHANGED
@@ -5892,8 +5892,7 @@ var init_schemaValidator = __esm({
5892
5892
  "singlestore",
5893
5893
  "gel",
5894
5894
  "mssql",
5895
- "cockroach",
5896
- "duckdb"
5895
+ "cockroach"
5897
5896
  ];
5898
5897
  dialect = enumType(dialects);
5899
5898
  }
@@ -28624,41 +28623,41 @@ var require_ms = __commonJS({
28624
28623
  return void 0;
28625
28624
  }
28626
28625
  }
28627
- function fmtShort(ms) {
28628
- var msAbs = Math.abs(ms);
28626
+ function fmtShort(ms2) {
28627
+ var msAbs = Math.abs(ms2);
28629
28628
  if (msAbs >= d5) {
28630
- return Math.round(ms / d5) + "d";
28629
+ return Math.round(ms2 / d5) + "d";
28631
28630
  }
28632
28631
  if (msAbs >= h6) {
28633
- return Math.round(ms / h6) + "h";
28632
+ return Math.round(ms2 / h6) + "h";
28634
28633
  }
28635
28634
  if (msAbs >= m6) {
28636
- return Math.round(ms / m6) + "m";
28635
+ return Math.round(ms2 / m6) + "m";
28637
28636
  }
28638
28637
  if (msAbs >= s6) {
28639
- return Math.round(ms / s6) + "s";
28638
+ return Math.round(ms2 / s6) + "s";
28640
28639
  }
28641
- return ms + "ms";
28640
+ return ms2 + "ms";
28642
28641
  }
28643
- function fmtLong(ms) {
28644
- var msAbs = Math.abs(ms);
28642
+ function fmtLong(ms2) {
28643
+ var msAbs = Math.abs(ms2);
28645
28644
  if (msAbs >= d5) {
28646
- return plural2(ms, msAbs, d5, "day");
28645
+ return plural2(ms2, msAbs, d5, "day");
28647
28646
  }
28648
28647
  if (msAbs >= h6) {
28649
- return plural2(ms, msAbs, h6, "hour");
28648
+ return plural2(ms2, msAbs, h6, "hour");
28650
28649
  }
28651
28650
  if (msAbs >= m6) {
28652
- return plural2(ms, msAbs, m6, "minute");
28651
+ return plural2(ms2, msAbs, m6, "minute");
28653
28652
  }
28654
28653
  if (msAbs >= s6) {
28655
- return plural2(ms, msAbs, s6, "second");
28654
+ return plural2(ms2, msAbs, s6, "second");
28656
28655
  }
28657
- return ms + " ms";
28656
+ return ms2 + " ms";
28658
28657
  }
28659
- function plural2(ms, msAbs, n5, name) {
28658
+ function plural2(ms2, msAbs, n5, name) {
28660
28659
  var isPlural = msAbs >= n5 * 1.5;
28661
- return Math.round(ms / n5) + " " + name + (isPlural ? "s" : "");
28660
+ return Math.round(ms2 / n5) + " " + name + (isPlural ? "s" : "");
28662
28661
  }
28663
28662
  }
28664
28663
  });
@@ -28701,8 +28700,8 @@ var require_common2 = __commonJS({
28701
28700
  }
28702
28701
  const self2 = debug;
28703
28702
  const curr = Number(/* @__PURE__ */ new Date());
28704
- const ms = curr - (prevTime || curr);
28705
- self2.diff = ms;
28703
+ const ms2 = curr - (prevTime || curr);
28704
+ self2.diff = ms2;
28706
28705
  self2.prev = prevTime;
28707
28706
  self2.curr = curr;
28708
28707
  prevTime = curr;
@@ -34305,9 +34304,6 @@ var init_utils_node = __esm({
34305
34304
  case "gel":
34306
34305
  throw Error("gel validator is not implemented yet");
34307
34306
  // TODO
34308
- case "duckdb":
34309
- throw Error("duckdb validator is not implemented yet");
34310
- // TODO
34311
34307
  default:
34312
34308
  assertUnreachable(dialect6);
34313
34309
  }
@@ -35843,8 +35839,8 @@ ${sql}
35843
35839
  `;
35844
35840
  return content;
35845
35841
  };
35846
- prepareSnapshotFolderName = (ms) => {
35847
- const now = ms ? new Date(ms) : /* @__PURE__ */ new Date();
35842
+ prepareSnapshotFolderName = (ms2) => {
35843
+ const now = ms2 ? new Date(ms2) : /* @__PURE__ */ new Date();
35848
35844
  return `${now.getFullYear()}${two(now.getUTCMonth() + 1)}${two(
35849
35845
  now.getUTCDate()
35850
35846
  )}${two(now.getUTCHours())}${two(now.getUTCMinutes())}${two(
@@ -55593,7 +55589,7 @@ var require_websocket = __commonJS({
55593
55589
  var EventEmitter = require("events");
55594
55590
  var https2 = require("https");
55595
55591
  var http3 = require("http");
55596
- var net = require("net");
55592
+ var net2 = require("net");
55597
55593
  var tls = require("tls");
55598
55594
  var { randomBytes, createHash: createHash2 } = require("crypto");
55599
55595
  var { Duplex, Readable: Readable2 } = require("stream");
@@ -56324,12 +56320,12 @@ var require_websocket = __commonJS({
56324
56320
  }
56325
56321
  function netConnect(options) {
56326
56322
  options.path = options.socketPath;
56327
- return net.connect(options);
56323
+ return net2.connect(options);
56328
56324
  }
56329
56325
  function tlsConnect(options) {
56330
56326
  options.path = void 0;
56331
56327
  if (!options.servername && options.servername !== "") {
56332
- options.servername = net.isIP(options.host) ? "" : options.host;
56328
+ options.servername = net2.isIP(options.host) ? "" : options.host;
56333
56329
  }
56334
56330
  return tls.connect(options);
56335
56331
  }
@@ -58620,7 +58616,7 @@ var require_dist_cjs14 = __commonJS({
58620
58616
  return transformedHeaders;
58621
58617
  };
58622
58618
  var timing = {
58623
- setTimeout: (cb, ms) => setTimeout(cb, ms),
58619
+ setTimeout: (cb, ms2) => setTimeout(cb, ms2),
58624
58620
  clearTimeout: (timeoutId) => clearTimeout(timeoutId)
58625
58621
  };
58626
58622
  var DEFER_EVENT_LISTENER_TIME$2 = 1e3;
@@ -61679,13 +61675,13 @@ var init_schema_date_utils = __esm({
61679
61675
  if (!matches) {
61680
61676
  throw new TypeError(`Invalid RFC3339 timestamp format ${value}`);
61681
61677
  }
61682
- const [, yearStr, monthStr, dayStr, hours, minutes, seconds, , ms, offsetStr] = matches;
61678
+ const [, yearStr, monthStr, dayStr, hours, minutes, seconds, , ms2, offsetStr] = matches;
61683
61679
  range(monthStr, 1, 12);
61684
61680
  range(dayStr, 1, 31);
61685
61681
  range(hours, 0, 23);
61686
61682
  range(minutes, 0, 59);
61687
61683
  range(seconds, 0, 60);
61688
- 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));
61684
+ 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));
61689
61685
  date2.setUTCFullYear(Number(yearStr));
61690
61686
  if (offsetStr.toUpperCase() != "Z") {
61691
61687
  const [, sign, offsetH, offsetM] = /([+-])(\d\d):(\d\d)/.exec(offsetStr) || [void 0, "+", 0, 0];
@@ -81576,8 +81572,8 @@ var require_datetime2 = __commonJS({
81576
81572
  if (!(object instanceof Date)) {
81577
81573
  throw new errors_1.InvalidArgumentError(`a Date instance was expected, got "${object}"`);
81578
81574
  }
81579
- const ms = object.getTime() - TIMESHIFT;
81580
- const us = ms * 1e3;
81575
+ const ms2 = object.getTime() - TIMESHIFT;
81576
+ const us = ms2 * 1e3;
81581
81577
  buf.writeInt32(8);
81582
81578
  buf.writeInt64(us);
81583
81579
  }
@@ -81587,12 +81583,12 @@ var require_datetime2 = __commonJS({
81587
81583
  return ctx.postDecode(this, us2 + BI_TIMESHIFT_US);
81588
81584
  }
81589
81585
  const us = Number(buf.readBigInt64());
81590
- let ms = Math.round(us / 1e3);
81591
- if (Math.abs(us % 1e3) === 500 && Math.abs(ms) % 2 === 1) {
81592
- ms -= 1;
81586
+ let ms2 = Math.round(us / 1e3);
81587
+ if (Math.abs(us % 1e3) === 500 && Math.abs(ms2) % 2 === 1) {
81588
+ ms2 -= 1;
81593
81589
  }
81594
- ms += TIMESHIFT;
81595
- return new Date(ms);
81590
+ ms2 += TIMESHIFT;
81591
+ return new Date(ms2);
81596
81592
  }
81597
81593
  };
81598
81594
  exports2.DateTimeCodec = DateTimeCodec;
@@ -81613,8 +81609,8 @@ var require_datetime2 = __commonJS({
81613
81609
  if (!(object instanceof datetime_1.LocalDateTime)) {
81614
81610
  throw new errors_1.InvalidArgumentError(`a LocalDateTime instance was expected, got "${object}"`);
81615
81611
  }
81616
- const ms = BigInt(datetime_1.localDateInstances.get(object).getTime() - TIMESHIFT);
81617
- let us = ms * 1000n + BigInt(object.hour * 36e8 + object.minute * 6e7 + object.second * 1e6 + object.millisecond * 1e3 + object.microsecond);
81612
+ const ms2 = BigInt(datetime_1.localDateInstances.get(object).getTime() - TIMESHIFT);
81613
+ let us = ms2 * 1000n + BigInt(object.hour * 36e8 + object.minute * 6e7 + object.second * 1e6 + object.millisecond * 1e3 + object.microsecond);
81618
81614
  if (object.nanosecond === 500 && Math.abs(object.microsecond) % 2 === 1 || object.nanosecond > 500) {
81619
81615
  us += 1n;
81620
81616
  }
@@ -81628,13 +81624,13 @@ var require_datetime2 = __commonJS({
81628
81624
  }
81629
81625
  const bi_ms = bi_us / 1000n;
81630
81626
  let us = Number(bi_us - bi_ms * 1000n);
81631
- let ms = Number(bi_ms);
81627
+ let ms2 = Number(bi_ms);
81632
81628
  if (us < 0) {
81633
81629
  us += 1e3;
81634
- ms -= 1;
81630
+ ms2 -= 1;
81635
81631
  }
81636
- ms += TIMESHIFT;
81637
- const date2 = new Date(ms);
81632
+ ms2 += TIMESHIFT;
81633
+ const date2 = new Date(ms2);
81638
81634
  return new datetime_1.LocalDateTime(date2.getUTCFullYear(), date2.getUTCMonth() + 1, date2.getUTCDate(), date2.getUTCHours(), date2.getUTCMinutes(), date2.getUTCSeconds(), date2.getUTCMilliseconds(), us);
81639
81635
  }
81640
81636
  };
@@ -81696,13 +81692,13 @@ var require_datetime2 = __commonJS({
81696
81692
  }
81697
81693
  let us = Number(bius);
81698
81694
  let seconds = Math.floor(us / 1e6);
81699
- const ms = Math.floor(us % 1e6 / 1e3);
81700
- us = us % 1e6 - ms * 1e3;
81695
+ const ms2 = Math.floor(us % 1e6 / 1e3);
81696
+ us = us % 1e6 - ms2 * 1e3;
81701
81697
  let minutes = Math.floor(seconds / 60);
81702
81698
  seconds = Math.floor(seconds % 60);
81703
81699
  const hours = Math.floor(minutes / 60);
81704
81700
  minutes = Math.floor(minutes % 60);
81705
- return new datetime_1.LocalTime(hours, minutes, seconds, ms, us);
81701
+ return new datetime_1.LocalTime(hours, minutes, seconds, ms2, us);
81706
81702
  }
81707
81703
  };
81708
81704
  exports2.LocalTimeCodec = LocalTimeCodec;
@@ -81779,14 +81775,14 @@ var require_datetime2 = __commonJS({
81779
81775
  const biMillion = 1000000n;
81780
81776
  const biSeconds = bius / biMillion;
81781
81777
  let us = Number(bius - biSeconds * biMillion);
81782
- const ms = Math.floor(us / 1e3);
81778
+ const ms2 = Math.floor(us / 1e3);
81783
81779
  us = us % 1e3;
81784
81780
  let seconds = Number(biSeconds);
81785
81781
  let minutes = Math.floor(seconds / 60);
81786
81782
  seconds = Math.floor(seconds % 60);
81787
81783
  const hours = Math.floor(minutes / 60);
81788
81784
  minutes = Math.floor(minutes % 60);
81789
- return new datetime_1.Duration(0, 0, 0, 0, hours * sign, minutes * sign, seconds * sign, ms * sign, us * sign);
81785
+ return new datetime_1.Duration(0, 0, 0, 0, hours * sign, minutes * sign, seconds * sign, ms2 * sign, us * sign);
81790
81786
  }
81791
81787
  };
81792
81788
  exports2.DurationCodec = DurationCodec;
@@ -81832,7 +81828,7 @@ var require_datetime2 = __commonJS({
81832
81828
  const million = BigInt(1e6);
81833
81829
  const biSeconds = bius / million;
81834
81830
  let us = Number(bius - biSeconds * million);
81835
- const ms = Math.trunc(us / 1e3);
81831
+ const ms2 = Math.trunc(us / 1e3);
81836
81832
  us = us % 1e3;
81837
81833
  let seconds = Number(biSeconds);
81838
81834
  let minutes = Math.trunc(seconds / 60);
@@ -81843,7 +81839,7 @@ var require_datetime2 = __commonJS({
81843
81839
  days = Math.trunc(days % 7);
81844
81840
  const years = Math.trunc(months2 / 12);
81845
81841
  months2 = Math.trunc(months2 % 12);
81846
- return new datetime_1.RelativeDuration(years, months2, weeks, days, hours * sign, minutes * sign, seconds * sign, ms * sign, us * sign);
81842
+ return new datetime_1.RelativeDuration(years, months2, weeks, days, hours * sign, minutes * sign, seconds * sign, ms2 * sign, us * sign);
81847
81843
  }
81848
81844
  };
81849
81845
  exports2.RelativeDurationCodec = RelativeDurationCodec;
@@ -106330,11 +106326,11 @@ var require_TokenExpiredError = __commonJS({
106330
106326
  // ../node_modules/.pnpm/jsonwebtoken@9.0.2/node_modules/jsonwebtoken/lib/timespan.js
106331
106327
  var require_timespan = __commonJS({
106332
106328
  "../node_modules/.pnpm/jsonwebtoken@9.0.2/node_modules/jsonwebtoken/lib/timespan.js"(exports2, module2) {
106333
- var ms = require_ms();
106329
+ var ms2 = require_ms();
106334
106330
  module2.exports = function(time2, iat) {
106335
106331
  var timestamp = iat || Math.floor(Date.now() / 1e3);
106336
106332
  if (typeof time2 === "string") {
106337
- var milliseconds = ms(time2);
106333
+ var milliseconds = ms2(time2);
106338
106334
  if (typeof milliseconds === "undefined") {
106339
106335
  return;
106340
106336
  }
@@ -120921,7 +120917,7 @@ var require_dist = __commonJS({
120921
120917
  };
120922
120918
  Object.defineProperty(exports2, "__esModule", { value: true });
120923
120919
  exports2.Agent = void 0;
120924
- var net = __importStar2(require("net"));
120920
+ var net2 = __importStar2(require("net"));
120925
120921
  var http3 = __importStar2(require("http"));
120926
120922
  var https_1 = require("https");
120927
120923
  __exportStar2(require_helpers2(), exports2);
@@ -120961,7 +120957,7 @@ var require_dist = __commonJS({
120961
120957
  if (!this.sockets[name]) {
120962
120958
  this.sockets[name] = [];
120963
120959
  }
120964
- const fakeSocket = new net.Socket({ writable: false });
120960
+ const fakeSocket = new net2.Socket({ writable: false });
120965
120961
  this.sockets[name].push(fakeSocket);
120966
120962
  this.totalSocketCount++;
120967
120963
  return fakeSocket;
@@ -121173,7 +121169,7 @@ var require_dist2 = __commonJS({
121173
121169
  };
121174
121170
  Object.defineProperty(exports2, "__esModule", { value: true });
121175
121171
  exports2.HttpsProxyAgent = void 0;
121176
- var net = __importStar2(require("net"));
121172
+ var net2 = __importStar2(require("net"));
121177
121173
  var tls = __importStar2(require("tls"));
121178
121174
  var assert_1 = __importDefault2(require("assert"));
121179
121175
  var debug_1 = __importDefault2(require_src2());
@@ -121182,7 +121178,7 @@ var require_dist2 = __commonJS({
121182
121178
  var parse_proxy_response_1 = require_parse_proxy_response();
121183
121179
  var debug = (0, debug_1.default)("https-proxy-agent");
121184
121180
  var setServernameFromNonIpHost = (options) => {
121185
- if (options.servername === void 0 && options.host && !net.isIP(options.host)) {
121181
+ if (options.servername === void 0 && options.host && !net2.isIP(options.host)) {
121186
121182
  return {
121187
121183
  ...options,
121188
121184
  servername: options.host
@@ -121222,10 +121218,10 @@ var require_dist2 = __commonJS({
121222
121218
  socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
121223
121219
  } else {
121224
121220
  debug("Creating `net.Socket`: %o", this.connectOpts);
121225
- socket = net.connect(this.connectOpts);
121221
+ socket = net2.connect(this.connectOpts);
121226
121222
  }
121227
121223
  const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
121228
- const host = net.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
121224
+ const host = net2.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
121229
121225
  let payload2 = `CONNECT ${host}:${opts.port} HTTP/1.1\r
121230
121226
  `;
121231
121227
  if (proxy.username || proxy.password) {
@@ -121258,7 +121254,7 @@ var require_dist2 = __commonJS({
121258
121254
  return socket;
121259
121255
  }
121260
121256
  socket.destroy();
121261
- const fakeSocket = new net.Socket({ writable: false });
121257
+ const fakeSocket = new net2.Socket({ writable: false });
121262
121258
  fakeSocket.readable = true;
121263
121259
  req.once("socket", (s6) => {
121264
121260
  debug("Replaying proxy buffer for failed request");
@@ -121323,7 +121319,7 @@ var require_dist3 = __commonJS({
121323
121319
  };
121324
121320
  Object.defineProperty(exports2, "__esModule", { value: true });
121325
121321
  exports2.HttpProxyAgent = void 0;
121326
- var net = __importStar2(require("net"));
121322
+ var net2 = __importStar2(require("net"));
121327
121323
  var tls = __importStar2(require("tls"));
121328
121324
  var debug_1 = __importDefault2(require_src2());
121329
121325
  var events_1 = require("events");
@@ -121396,7 +121392,7 @@ var require_dist3 = __commonJS({
121396
121392
  socket = tls.connect(this.connectOpts);
121397
121393
  } else {
121398
121394
  debug("Creating `net.Socket`: %o", this.connectOpts);
121399
- socket = net.connect(this.connectOpts);
121395
+ socket = net2.connect(this.connectOpts);
121400
121396
  }
121401
121397
  await (0, events_1.once)(socket, "connect");
121402
121398
  return socket;
@@ -160310,7 +160306,7 @@ var require_connection = __commonJS({
160310
160306
  var _crypto = _interopRequireDefault(require("crypto"));
160311
160307
  var _os = _interopRequireDefault(require("os"));
160312
160308
  var tls = _interopRequireWildcard(require("tls"));
160313
- var net = _interopRequireWildcard(require("net"));
160309
+ var net2 = _interopRequireWildcard(require("net"));
160314
160310
  var _dns = _interopRequireDefault(require("dns"));
160315
160311
  var _constants = _interopRequireDefault(require("constants"));
160316
160312
  var _stream = require("stream");
@@ -161359,7 +161355,7 @@ var require_connection = __commonJS({
161359
161355
  async wrapWithTls(socket, signal) {
161360
161356
  signal.throwIfAborted();
161361
161357
  const secureContext = tls.createSecureContext(this.secureContextOptions);
161362
- const serverName = !net.isIP(this.config.server) ? this.config.server : "";
161358
+ const serverName = !net2.isIP(this.config.server) ? this.config.server : "";
161363
161359
  const encryptOptions = {
161364
161360
  host: this.config.server,
161365
161361
  socket,
@@ -164270,7 +164266,6 @@ __export(connections_exports, {
164270
164266
  connectToSQLite: () => connectToSQLite,
164271
164267
  connectToSingleStore: () => connectToSingleStore,
164272
164268
  prepareCockroach: () => prepareCockroach,
164273
- prepareDuckDb: () => prepareDuckDb,
164274
164269
  prepareGelDB: () => prepareGelDB,
164275
164270
  preparePostgresDB: () => preparePostgresDB
164276
164271
  });
@@ -164287,10 +164282,11 @@ function parseMssqlUrl(url) {
164287
164282
  }
164288
164283
  };
164289
164284
  }
164290
- var normalisePGliteUrl, preparePostgresDB, prepareDuckDb, prepareCockroach, prepareGelDB, parseSingleStoreCredentials, connectToSingleStore, parseMysqlCredentials, connectToMySQL, parseMssqlCredentials, connectToMsSQL, prepareSqliteParams, preparePGliteParams, connectToSQLite, connectToLibSQL;
164285
+ var import_net, ms, normalisePGliteUrl, preparePostgresDB, prepareCockroach, prepareGelDB, parseSingleStoreCredentials, connectToSingleStore, parseMysqlCredentials, connectToMySQL, parseMssqlCredentials, connectToMsSQL, prepareSqliteParams, preparePGliteParams, connectToSQLite, connectToLibSQL;
164291
164286
  var init_connections = __esm({
164292
164287
  "src/cli/connections.ts"() {
164293
164288
  "use strict";
164289
+ import_net = __toESM(require("net"));
164294
164290
  init_src();
164295
164291
  init_wrapper();
164296
164292
  init_utils2();
@@ -164298,6 +164294,7 @@ var init_connections = __esm({
164298
164294
  init_when_json_met_bigint();
164299
164295
  init_utils4();
164300
164296
  init_outputs();
164297
+ ms = (a5, b5) => Number(b5 - a5) / 1e6;
164301
164298
  normalisePGliteUrl = (it2) => {
164302
164299
  if (it2.startsWith("file:")) {
164303
164300
  return it2.substring(5);
@@ -164421,13 +164418,7 @@ var init_connections = __esm({
164421
164418
  }
164422
164419
  return results;
164423
164420
  };
164424
- return {
164425
- packageName: "pglite",
164426
- query,
164427
- proxy,
164428
- transactionProxy,
164429
- migrate: migrateFn
164430
- };
164421
+ return { packageName: "pglite", query, proxy, transactionProxy, migrate: migrateFn };
164431
164422
  }
164432
164423
  assertUnreachable(driver2);
164433
164424
  }
@@ -164458,13 +164449,13 @@ var init_connections = __esm({
164458
164449
  return pg.types.getTypeParser(typeId, format2);
164459
164450
  }
164460
164451
  };
164461
- const client = "url" in credentials2 ? new pg.Pool({ connectionString: credentials2.url, max: 1 }) : new pg.Pool({ ...credentials2, ssl, max: 1 });
164462
- const db = drizzle({ client });
164452
+ const pool = "url" in credentials2 ? new pg.Pool({ connectionString: credentials2.url, max: 1 }) : new pg.Pool({ ...credentials2, ssl, max: 1 });
164453
+ const db = drizzle({ client: pool });
164463
164454
  const migrateFn = async (config) => {
164464
164455
  return migrate2(db, config);
164465
164456
  };
164466
164457
  const query = async (sql, params) => {
164467
- const result2 = await client.query({
164458
+ const result2 = await pool.query({
164468
164459
  text: sql,
164469
164460
  values: params ?? [],
164470
164461
  types: types3
@@ -164474,7 +164465,7 @@ var init_connections = __esm({
164474
164465
  return result2.rows;
164475
164466
  };
164476
164467
  const proxy = async (params) => {
164477
- const result2 = await client.query({
164468
+ const result2 = await pool.query({
164478
164469
  text: params.sql,
164479
164470
  values: params.params,
164480
164471
  ...params.mode === "array" && { rowMode: "array" },
@@ -164486,7 +164477,7 @@ var init_connections = __esm({
164486
164477
  };
164487
164478
  const transactionProxy = async (queries) => {
164488
164479
  const results = [];
164489
- const tx = await client.connect();
164480
+ const tx = await pool.connect();
164490
164481
  try {
164491
164482
  await tx.query("BEGIN");
164492
164483
  for (const query2 of queries) {
@@ -164505,13 +164496,119 @@ var init_connections = __esm({
164505
164496
  }
164506
164497
  return results;
164507
164498
  };
164508
- return {
164509
- packageName: "pg",
164510
- query,
164511
- proxy,
164512
- transactionProxy,
164513
- migrate: migrateFn
164499
+ const benchmarkQuery = async (client, sql, params) => {
164500
+ const explainResult = await pool.query({
164501
+ text: `EXPLAIN ANALYZE ${sql}`,
164502
+ values: params ?? [],
164503
+ types: types3
164504
+ });
164505
+ const stringifiedResult = JSON.stringify(explainResult.rows);
164506
+ const planningMatch = stringifiedResult.match(/Planning Time:\s*([\d.]+)\s*ms/i);
164507
+ const executionMatch = stringifiedResult.match(/Execution Time:\s*([\d.]+)\s*ms/i);
164508
+ let planningTime = Number(planningMatch[1]);
164509
+ let executionTime = Number(executionMatch[1]);
164510
+ let querySentAt = 0n;
164511
+ let firstDataAt = 0n;
164512
+ let lastDataAt = 0n;
164513
+ let lastRowParsedAt = 0n;
164514
+ let queryCompletedAt = 0n;
164515
+ let bytesReceived = 0;
164516
+ let rowCount = 0;
164517
+ let parseTime = 0;
164518
+ let lastParseTime = 0;
164519
+ const rowDescriptionListener = (data2) => {
164520
+ if (firstDataAt === 0n) {
164521
+ firstDataAt = process.hrtime.bigint();
164522
+ }
164523
+ bytesReceived += data2.length;
164524
+ };
164525
+ const originalRowListener = client.connection.listeners("dataRow")[0];
164526
+ const wrappedRowListener = (data2) => {
164527
+ rowCount += 1;
164528
+ const start = process.hrtime.bigint();
164529
+ lastDataAt = start;
164530
+ originalRowListener.apply(client.connection, [data2]);
164531
+ const end2 = process.hrtime.bigint();
164532
+ lastRowParsedAt = end2;
164533
+ lastParseTime = ms(start, end2);
164534
+ parseTime += lastParseTime;
164535
+ bytesReceived += data2.length;
164536
+ };
164537
+ client.connection.removeAllListeners("dataRow");
164538
+ client.connection.addListener("dataRow", wrappedRowListener);
164539
+ client.connection.prependListener("rowDescription", rowDescriptionListener);
164540
+ querySentAt = process.hrtime.bigint();
164541
+ await client.query({
164542
+ text: sql,
164543
+ values: params,
164544
+ types: types3
164545
+ });
164546
+ queryCompletedAt = process.hrtime.bigint();
164547
+ client.connection.removeListener("rowDescription", rowDescriptionListener);
164548
+ client.connection.removeAllListeners("dataRow");
164549
+ client.connection.addListener("dataRow", originalRowListener);
164550
+ let querySentTime = ms(querySentAt, firstDataAt) - executionTime - planningTime;
164551
+ if (querySentTime < 0) {
164552
+ const percent = 0.1;
164553
+ const overflow = -querySentTime;
164554
+ const keepForSent = overflow * percent;
164555
+ const adjustedOverflow = overflow * (1 + percent);
164556
+ const total2 = planningTime + executionTime;
164557
+ const ratioPlanning = planningTime / total2;
164558
+ const ratioExecution = executionTime / total2;
164559
+ planningTime -= adjustedOverflow * ratioPlanning;
164560
+ executionTime -= adjustedOverflow * ratioExecution;
164561
+ querySentTime = keepForSent;
164562
+ }
164563
+ const networkLatencyBefore = querySentTime / 2;
164564
+ const networkLatencyAfter = querySentTime / 2;
164565
+ const downloadTime = ms(firstDataAt, lastDataAt) - (rowCount > 1 ? parseTime - lastParseTime : 0);
164566
+ const total = ms(querySentAt, queryCompletedAt);
164567
+ const calculatedTotal = networkLatencyBefore + planningTime + executionTime + networkLatencyAfter + downloadTime + parseTime + ms(lastRowParsedAt, queryCompletedAt);
164568
+ const errorMargin = Math.abs(total - calculatedTotal);
164569
+ return {
164570
+ networkLatencyBefore,
164571
+ planning: planningTime,
164572
+ execution: executionTime,
164573
+ networkLatencyAfter,
164574
+ dataDownload: downloadTime,
164575
+ dataParse: parseTime,
164576
+ total,
164577
+ errorMargin,
164578
+ dataSize: bytesReceived
164579
+ };
164514
164580
  };
164581
+ const benchmarkProxy = async ({ sql, params }, repeats) => {
164582
+ let startAt = 0n;
164583
+ let tcpConnectedAt = 0n;
164584
+ let tlsConnectedAt = null;
164585
+ let dbReadyAt = 0n;
164586
+ const client = "url" in credentials2 ? new pg.Client({ connectionString: credentials2.url }) : new pg.Client({ ...credentials2, ssl });
164587
+ client.connection.once("connect", () => {
164588
+ tcpConnectedAt = process.hrtime.bigint();
164589
+ });
164590
+ client.connection.prependOnceListener("sslconnect", () => {
164591
+ tlsConnectedAt = process.hrtime.bigint();
164592
+ });
164593
+ client.connection.prependOnceListener("readyForQuery", () => {
164594
+ dbReadyAt = process.hrtime.bigint();
164595
+ });
164596
+ startAt = process.hrtime.bigint();
164597
+ await client.connect();
164598
+ const results = [];
164599
+ for (let i6 = 0; i6 < repeats; i6++) {
164600
+ const r6 = await benchmarkQuery(client, sql, params);
164601
+ results.push(r6);
164602
+ }
164603
+ await client.end();
164604
+ return {
164605
+ tcpHandshake: ms(startAt, tcpConnectedAt),
164606
+ tlsHandshake: tlsConnectedAt ? ms(tcpConnectedAt, tlsConnectedAt) : null,
164607
+ dbHandshake: ms(tlsConnectedAt ?? tcpConnectedAt, dbReadyAt),
164608
+ queries: results
164609
+ };
164610
+ };
164611
+ return { packageName: "pg", query, proxy, transactionProxy, benchmarkProxy, migrate: migrateFn };
164515
164612
  }
164516
164613
  if (await checkPackage("postgres")) {
164517
164614
  console.log(
@@ -164562,13 +164659,7 @@ var init_connections = __esm({
164562
164659
  }
164563
164660
  return results;
164564
164661
  };
164565
- return {
164566
- packageName: "postgres",
164567
- query,
164568
- proxy,
164569
- transactionProxy,
164570
- migrate: migrateFn
164571
- };
164662
+ return { packageName: "postgres", query, proxy, transactionProxy, migrate: migrateFn };
164572
164663
  }
164573
164664
  if (await checkPackage("@vercel/postgres")) {
164574
164665
  console.log(
@@ -164649,13 +164740,7 @@ var init_connections = __esm({
164649
164740
  }
164650
164741
  return results;
164651
164742
  };
164652
- return {
164653
- packageName: "@vercel/postgres",
164654
- query,
164655
- proxy,
164656
- transactionProxy,
164657
- migrate: migrateFn
164658
- };
164743
+ return { packageName: "@vercel/postgres", query, proxy, transactionProxy, migrate: migrateFn };
164659
164744
  }
164660
164745
  if (await checkPackage("@neondatabase/serverless")) {
164661
164746
  console.log(
@@ -164668,11 +164753,7 @@ var init_connections = __esm({
164668
164753
  "'@neondatabase/serverless' can only connect to remote Neon/Vercel Postgres/Supabase instances through a websocket"
164669
164754
  )
164670
164755
  );
164671
- const {
164672
- Pool,
164673
- neonConfig,
164674
- types: pgTypes
164675
- } = await import("@neondatabase/serverless");
164756
+ const { Pool, neonConfig, types: pgTypes } = await import("@neondatabase/serverless");
164676
164757
  const { drizzle } = await import("drizzle-orm/neon-serverless");
164677
164758
  const { migrate: migrate2 } = await import("drizzle-orm/neon-serverless/migrator");
164678
164759
  const ssl = "ssl" in credentials2 ? credentials2.ssl === "prefer" || credentials2.ssl === "require" || credentials2.ssl === "allow" ? { rejectUnauthorized: false } : credentials2.ssl === "verify-full" ? {} : credentials2.ssl : {};
@@ -164742,13 +164823,7 @@ var init_connections = __esm({
164742
164823
  }
164743
164824
  return results;
164744
164825
  };
164745
- return {
164746
- packageName: "@neondatabase/serverless",
164747
- query,
164748
- proxy,
164749
- transactionProxy,
164750
- migrate: migrateFn
164751
- };
164826
+ return { packageName: "@neondatabase/serverless", query, proxy, transactionProxy, migrate: migrateFn };
164752
164827
  }
164753
164828
  if (await checkPackage("bun")) {
164754
164829
  console.log(withStyle.info(`Using 'bun' driver for database querying`));
@@ -164799,54 +164874,6 @@ var init_connections = __esm({
164799
164874
  console.warn("For the 'bun' driver, run your script using: bun --bun");
164800
164875
  process.exit(1);
164801
164876
  };
164802
- prepareDuckDb = async (credentials2) => {
164803
- if (await checkPackage("@duckdb/node-api")) {
164804
- console.log(
164805
- withStyle.info(`Using '@duckdb/node-api' driver for database querying`)
164806
- );
164807
- const { DuckDBInstance } = await import("@duckdb/node-api");
164808
- const instance = await DuckDBInstance.create(credentials2.url);
164809
- const client = await instance.connect();
164810
- const query = async (sql, params = []) => {
164811
- const result2 = await client.run(sql, params);
164812
- const rows = await result2.getRowObjectsJson();
164813
- return rows;
164814
- };
164815
- const proxy = async (params) => {
164816
- const result2 = await client.run(params.sql, params.params);
164817
- return params.mode === "array" ? await result2.getRowsJson() : await result2.getRowObjectsJson();
164818
- };
164819
- const transactionProxy = async (queries) => {
164820
- const results = [];
164821
- try {
164822
- await client.run("BEGIN");
164823
- for (const query2 of queries) {
164824
- const result2 = await client.run(query2.sql);
164825
- results.push(await result2.getRowObjectsJson());
164826
- }
164827
- await client.run("COMMIT");
164828
- } catch (error4) {
164829
- await client.run("ROLLBACK");
164830
- results.push(error4);
164831
- }
164832
- return results;
164833
- };
164834
- return {
164835
- packageName: "@duckdb/node-api",
164836
- query,
164837
- proxy,
164838
- transactionProxy,
164839
- migrate: () => {
164840
- throw new Error("DuckDB does not support migrations");
164841
- }
164842
- };
164843
- }
164844
- console.error(
164845
- // "To connect to DuckDb database - please install either of 'duckdb', '@duckdb/node-api' drivers",
164846
- "To connect to DuckDb database - please install '@duckdb/node-api' driver"
164847
- );
164848
- process.exit(1);
164849
- };
164850
164877
  prepareCockroach = async (credentials2) => {
164851
164878
  if (await checkPackage("pg")) {
164852
164879
  const { default: pg } = await import("pg");
@@ -164899,7 +164926,9 @@ var init_connections = __esm({
164899
164926
  };
164900
164927
  return { query, proxy, migrate: migrateFn };
164901
164928
  }
164902
- console.error("To connect to Cockroach - please install 'pg' package");
164929
+ console.error(
164930
+ "To connect to Cockroach - please install 'pg' package"
164931
+ );
164903
164932
  process.exit(1);
164904
164933
  };
164905
164934
  prepareGelDB = async (credentials2) => {
@@ -164958,7 +164987,9 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
164958
164987
  };
164959
164988
  return { packageName: "gel", query, proxy, transactionProxy };
164960
164989
  }
164961
- console.error("To connect to gel database - please install 'edgedb' driver");
164990
+ console.error(
164991
+ "To connect to gel database - please install 'edgedb' driver"
164992
+ );
164962
164993
  process.exit(1);
164963
164994
  };
164964
164995
  parseSingleStoreCredentials = (credentials2) => {
@@ -165072,7 +165103,6 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
165072
165103
  }
165073
165104
  return next();
165074
165105
  };
165075
- await connection.connect();
165076
165106
  const query = async (sql, params) => {
165077
165107
  const res = await connection.execute({
165078
165108
  sql,
@@ -165112,11 +165142,156 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
165112
165142
  }
165113
165143
  return results;
165114
165144
  };
165145
+ const benchmarkQuery = async (newConnection, sql, params) => {
165146
+ const explainResult = await connection.query({
165147
+ sql: `EXPLAIN ANALYZE ${sql}`,
165148
+ values: params ?? [],
165149
+ typeCast
165150
+ });
165151
+ const stringifiedResult = JSON.stringify(explainResult[0]);
165152
+ const timeMatch = stringifiedResult.match(
165153
+ /actual time=([0-9.eE+-]+)\.\.([0-9.eE+-]+)/
165154
+ );
165155
+ const lastRowTime = Number(timeMatch[2]);
165156
+ let executionTime = lastRowTime;
165157
+ let querySentAt = 0n;
165158
+ let firstDataAt = 0n;
165159
+ let lastDataAt = 0n;
165160
+ let lastRowParsedAt = 0n;
165161
+ let queryCompletedAt = 0n;
165162
+ let bytesReceived = 0;
165163
+ let rowCount = 0;
165164
+ let parseTime = 0;
165165
+ let lastParseTime = 0;
165166
+ querySentAt = process.hrtime.bigint();
165167
+ await new Promise((resolve3, reject) => {
165168
+ const query2 = newConnection.query({
165169
+ sql,
165170
+ values: params ?? [],
165171
+ typeCast
165172
+ });
165173
+ const originalRowHandler = query2.row;
165174
+ let packets = 0;
165175
+ const wrappedRowListener = (packet, connection2) => {
165176
+ packets += 1;
165177
+ if (firstDataAt === 0n) {
165178
+ firstDataAt = process.hrtime.bigint();
165179
+ bytesReceived += packet.start;
165180
+ }
165181
+ const start = process.hrtime.bigint();
165182
+ lastDataAt = start;
165183
+ const res = originalRowHandler.apply(query2, [packet, connection2]);
165184
+ const end2 = process.hrtime.bigint();
165185
+ lastRowParsedAt = end2;
165186
+ lastParseTime = ms(start, end2);
165187
+ parseTime += lastParseTime;
165188
+ bytesReceived += packet.length();
165189
+ if (!res || packet.isEOF()) {
165190
+ return res;
165191
+ }
165192
+ return wrappedRowListener;
165193
+ };
165194
+ query2.row = wrappedRowListener;
165195
+ query2.on("result", () => {
165196
+ rowCount += 1;
165197
+ });
165198
+ query2.on("error", (err2) => {
165199
+ reject(err2);
165200
+ });
165201
+ query2.on("end", () => {
165202
+ resolve3();
165203
+ });
165204
+ });
165205
+ queryCompletedAt = process.hrtime.bigint();
165206
+ let querySentTime = ms(querySentAt, firstDataAt) - executionTime;
165207
+ if (querySentTime < 0) {
165208
+ const percent = 0.1;
165209
+ const overflow = -querySentTime;
165210
+ const keepForSent = overflow * percent;
165211
+ const adjustedOverflow = overflow * (1 + percent);
165212
+ const total2 = executionTime;
165213
+ const ratioExecution = executionTime / total2;
165214
+ executionTime -= adjustedOverflow * ratioExecution;
165215
+ querySentTime = keepForSent;
165216
+ }
165217
+ const networkLatencyBefore = querySentTime / 2;
165218
+ const networkLatencyAfter = querySentTime / 2;
165219
+ const downloadTime = ms(firstDataAt, lastDataAt) - (rowCount > 1 ? parseTime - lastParseTime : 0);
165220
+ const total = ms(querySentAt, queryCompletedAt);
165221
+ const calculatedTotal = networkLatencyBefore + executionTime + networkLatencyAfter + downloadTime + parseTime + ms(lastRowParsedAt, queryCompletedAt);
165222
+ const errorMargin = Math.abs(total - calculatedTotal);
165223
+ return {
165224
+ networkLatencyBefore,
165225
+ planning: null,
165226
+ execution: executionTime,
165227
+ networkLatencyAfter,
165228
+ dataDownload: downloadTime,
165229
+ dataParse: parseTime,
165230
+ total,
165231
+ errorMargin,
165232
+ dataSize: bytesReceived
165233
+ };
165234
+ };
165235
+ const benchmarkProxy = async ({ sql, params }, repeats) => {
165236
+ const { createConnection: createConnection2 } = await import("mysql2");
165237
+ let startAt = 0n;
165238
+ let tcpConnectedAt = 0n;
165239
+ let tlsConnectedAt = null;
165240
+ const createStream = ({ config }) => {
165241
+ let stream;
165242
+ if (config.socketPath) {
165243
+ stream = import_net.default.connect(config.socketPath);
165244
+ } else {
165245
+ stream = import_net.default.connect(config.port, config.host);
165246
+ }
165247
+ if (config.enableKeepAlive) {
165248
+ stream.on("connect", () => {
165249
+ stream.setKeepAlive(true, config.keepAliveInitialDelay);
165250
+ });
165251
+ }
165252
+ stream.setNoDelay(true);
165253
+ stream.once("connect", () => {
165254
+ tcpConnectedAt = process.hrtime.bigint();
165255
+ });
165256
+ return stream;
165257
+ };
165258
+ startAt = process.hrtime.bigint();
165259
+ const connection2 = result2.url ? createConnection2({
165260
+ uri: result2.url,
165261
+ stream: createStream
165262
+ }) : createConnection2({
165263
+ ...result2.credentials,
165264
+ stream: createStream
165265
+ });
165266
+ await new Promise((resolve3, reject) => {
165267
+ connection2.connect((err2) => {
165268
+ tlsConnectedAt = process.hrtime.bigint();
165269
+ if (err2) {
165270
+ reject(err2);
165271
+ } else {
165272
+ resolve3();
165273
+ }
165274
+ });
165275
+ });
165276
+ const results = [];
165277
+ for (let i6 = 0; i6 < repeats; i6++) {
165278
+ const r6 = await benchmarkQuery(connection2, sql, params);
165279
+ results.push(r6);
165280
+ }
165281
+ connection2.end();
165282
+ return {
165283
+ tcpHandshake: ms(startAt, tcpConnectedAt),
165284
+ tlsHandshake: tlsConnectedAt ? ms(tcpConnectedAt, tlsConnectedAt) : null,
165285
+ dbHandshake: null,
165286
+ queries: results
165287
+ };
165288
+ };
165115
165289
  return {
165116
165290
  db: { query },
165117
165291
  packageName: "mysql2",
165118
165292
  proxy,
165119
165293
  transactionProxy,
165294
+ benchmarkProxy,
165120
165295
  database: result2.database,
165121
165296
  migrate: migrateFn
165122
165297
  };
@@ -165266,7 +165441,9 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
165266
165441
  migrate: migrateFn
165267
165442
  };
165268
165443
  }
165269
- console.error("To connect to MsSQL database - please install 'mssql' driver");
165444
+ console.error(
165445
+ "To connect to MsSQL database - please install 'mssql' driver"
165446
+ );
165270
165447
  process.exit(1);
165271
165448
  };
165272
165449
  prepareSqliteParams = (params, driver2) => {
@@ -165371,10 +165548,7 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
165371
165548
  await remoteCallback(query2, [], "run");
165372
165549
  };
165373
165550
  const proxy = async (params) => {
165374
- const preparedParams = prepareSqliteParams(
165375
- params.params || [],
165376
- "d1-http"
165377
- );
165551
+ const preparedParams = prepareSqliteParams(params.params || [], "d1-http");
165378
165552
  const result2 = await remoteCallback(
165379
165553
  params.sql,
165380
165554
  preparedParams,
@@ -165599,19 +165773,17 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
165599
165773
  };
165600
165774
  const transactionProxy = async (queries) => {
165601
165775
  const results = [];
165602
- const tx = sqlite.transaction(
165603
- (queries2) => {
165604
- for (const query of queries2) {
165605
- let result2 = [];
165606
- if (query.method === "values" || query.method === "get" || query.method === "all") {
165607
- result2 = sqlite.prepare(query.sql).all();
165608
- } else {
165609
- sqlite.prepare(query.sql).run();
165610
- }
165611
- results.push(result2);
165776
+ const tx = sqlite.transaction((queries2) => {
165777
+ for (const query of queries2) {
165778
+ let result2 = [];
165779
+ if (query.method === "values" || query.method === "get" || query.method === "all") {
165780
+ result2 = sqlite.prepare(query.sql).all();
165781
+ } else {
165782
+ sqlite.prepare(query.sql).run();
165612
165783
  }
165784
+ results.push(result2);
165613
165785
  }
165614
- );
165786
+ });
165615
165787
  try {
165616
165788
  tx(queries);
165617
165789
  } catch (error4) {
@@ -165619,13 +165791,7 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
165619
165791
  }
165620
165792
  return results;
165621
165793
  };
165622
- return {
165623
- ...db,
165624
- packageName: "better-sqlite3",
165625
- proxy,
165626
- transactionProxy,
165627
- migrate: migrateFn
165628
- };
165794
+ return { ...db, packageName: "better-sqlite3", proxy, transactionProxy, migrate: migrateFn };
165629
165795
  }
165630
165796
  if (await checkPackage("bun")) {
165631
165797
  console.log(withStyle.info(`Using 'bun' driver for database querying`));
@@ -169393,7 +169559,7 @@ var init_introspect2 = __esm({
169393
169559
  let checksCount = 0;
169394
169560
  let viewsCount = 0;
169395
169561
  for (const seq of sequencesList) {
169396
- const depend = dependList.find((it2) => Number(it2.oid) === Number(seq.oid));
169562
+ const depend = dependList.find((it2) => it2.oid === seq.oid);
169397
169563
  if (depend && (depend.deptype === "a" || depend.deptype === "i")) {
169398
169564
  continue;
169399
169565
  }
@@ -169459,22 +169625,22 @@ var init_introspect2 = __esm({
169459
169625
  continue;
169460
169626
  }
169461
169627
  const expr = serialsList.find(
169462
- (it2) => Number(it2.tableId) === Number(column12.tableId) && it2.ordinality === column12.ordinality
169628
+ (it2) => it2.tableId === column12.tableId && it2.ordinality === column12.ordinality
169463
169629
  );
169464
169630
  if (expr) {
169465
- const table7 = tablesList.find((it2) => Number(it2.oid) === Number(column12.tableId));
169631
+ const table7 = tablesList.find((it2) => it2.oid === column12.tableId);
169466
169632
  const isSerial = isSerialExpression(expr.expression, table7.schema);
169467
169633
  column12.type = isSerial ? type === "bigint" ? "bigserial" : type === "integer" ? "serial" : "smallserial" : type;
169468
169634
  }
169469
169635
  }
169470
169636
  for (const column12 of columnsList.filter((x6) => x6.kind === "r" || x6.kind === "p")) {
169471
- const table7 = tablesList.find((it2) => Number(it2.oid) === Number(column12.tableId));
169637
+ const table7 = tablesList.find((it2) => it2.oid === column12.tableId);
169472
169638
  const enumType2 = column12.typeId in groupedEnums ? groupedEnums[column12.typeId] : column12.typeId in groupedArrEnums ? groupedArrEnums[column12.typeId] : null;
169473
169639
  let columnTypeMapped = enumType2 ? enumType2.name : column12.type.replaceAll("[]", "");
169474
169640
  columnTypeMapped = columnTypeMapped.replace("character varying", "varchar").replace(" without time zone", "").replace("character", "char").replace("geometry(Point", "geometry(point");
169475
169641
  columnTypeMapped = trimChar(columnTypeMapped, '"');
169476
169642
  const columnDefault = defaultsList.find(
169477
- (it2) => Number(it2.tableId) === Number(column12.tableId) && it2.ordinality === column12.ordinality
169643
+ (it2) => it2.tableId === column12.tableId && it2.ordinality === column12.ordinality
169478
169644
  );
169479
169645
  const defaultValue = defaultForColumn(
169480
169646
  columnTypeMapped,
@@ -169483,10 +169649,10 @@ var init_introspect2 = __esm({
169483
169649
  Boolean(enumType2)
169484
169650
  );
169485
169651
  const unique = constraintsList.find((it2) => {
169486
- return it2.type === "u" && Number(it2.tableId) === Number(column12.tableId) && it2.columnsOrdinals.length === 1 && it2.columnsOrdinals.includes(column12.ordinality);
169652
+ return it2.type === "u" && it2.tableId === column12.tableId && it2.columnsOrdinals.length === 1 && it2.columnsOrdinals.includes(column12.ordinality);
169487
169653
  }) ?? null;
169488
169654
  const pk = constraintsList.find((it2) => {
169489
- return it2.type === "p" && Number(it2.tableId) === Number(column12.tableId) && it2.columnsOrdinals.length === 1 && it2.columnsOrdinals.includes(column12.ordinality);
169655
+ return it2.type === "p" && it2.tableId === column12.tableId && it2.columnsOrdinals.length === 1 && it2.columnsOrdinals.includes(column12.ordinality);
169490
169656
  }) ?? null;
169491
169657
  const metadata = column12.metadata;
169492
169658
  if (column12.generatedType === "s" && (!metadata || !metadata.expression)) {
@@ -169501,7 +169667,7 @@ ${JSON.stringify(column12.metadata)}`
169501
169667
  ${JSON.stringify(column12.metadata)}`
169502
169668
  );
169503
169669
  }
169504
- const sequence = (metadata == null ? void 0 : metadata.seqId) ? sequencesList.find((it2) => Number(it2.oid) === Number(metadata.seqId)) ?? null : null;
169670
+ const sequence = (metadata == null ? void 0 : metadata.seqId) ? sequencesList.find((it2) => it2.oid === Number(metadata.seqId)) ?? null : null;
169505
169671
  columns.push({
169506
169672
  entityType: "columns",
169507
169673
  schema: table7.schema,
@@ -169531,12 +169697,10 @@ ${JSON.stringify(column12.metadata)}`
169531
169697
  });
169532
169698
  }
169533
169699
  for (const unique of constraintsList.filter((it2) => it2.type === "u")) {
169534
- const table7 = tablesList.find((it2) => Number(it2.oid) === Number(unique.tableId));
169535
- const schema6 = namespaces.find((it2) => Number(it2.oid) === Number(unique.schemaId));
169700
+ const table7 = tablesList.find((it2) => it2.oid === unique.tableId);
169701
+ const schema6 = namespaces.find((it2) => it2.oid === unique.schemaId);
169536
169702
  const columns2 = unique.columnsOrdinals.map((it2) => {
169537
- const column12 = columnsList.find(
169538
- (column13) => Number(column13.tableId) === Number(unique.tableId) && column13.ordinality === it2
169539
- );
169703
+ const column12 = columnsList.find((column13) => column13.tableId === unique.tableId && column13.ordinality === it2);
169540
169704
  return column12.name;
169541
169705
  });
169542
169706
  uniques.push({
@@ -169550,12 +169714,10 @@ ${JSON.stringify(column12.metadata)}`
169550
169714
  });
169551
169715
  }
169552
169716
  for (const pk of constraintsList.filter((it2) => it2.type === "p")) {
169553
- const table7 = tablesList.find((it2) => Number(it2.oid) === Number(pk.tableId));
169554
- const schema6 = namespaces.find((it2) => Number(it2.oid) === Number(pk.schemaId));
169717
+ const table7 = tablesList.find((it2) => it2.oid === pk.tableId);
169718
+ const schema6 = namespaces.find((it2) => it2.oid === pk.schemaId);
169555
169719
  const columns2 = pk.columnsOrdinals.map((it2) => {
169556
- const column12 = columnsList.find(
169557
- (column13) => Number(column13.tableId) === Number(pk.tableId) && column13.ordinality === it2
169558
- );
169720
+ const column12 = columnsList.find((column13) => column13.tableId === pk.tableId && column13.ordinality === it2);
169559
169721
  return column12.name;
169560
169722
  });
169561
169723
  pks.push({
@@ -169568,19 +169730,15 @@ ${JSON.stringify(column12.metadata)}`
169568
169730
  });
169569
169731
  }
169570
169732
  for (const fk6 of constraintsList.filter((it2) => it2.type === "f")) {
169571
- const table7 = tablesList.find((it2) => Number(it2.oid) === Number(fk6.tableId));
169572
- const schema6 = namespaces.find((it2) => Number(it2.oid) === Number(fk6.schemaId));
169573
- const tableTo = tablesList.find((it2) => Number(it2.oid) === Number(fk6.tableToId));
169733
+ const table7 = tablesList.find((it2) => it2.oid === fk6.tableId);
169734
+ const schema6 = namespaces.find((it2) => it2.oid === fk6.schemaId);
169735
+ const tableTo = tablesList.find((it2) => it2.oid === fk6.tableToId);
169574
169736
  const columns2 = fk6.columnsOrdinals.map((it2) => {
169575
- const column12 = columnsList.find(
169576
- (column13) => Number(column13.tableId) === Number(fk6.tableId) && column13.ordinality === it2
169577
- );
169737
+ const column12 = columnsList.find((column13) => column13.tableId === fk6.tableId && column13.ordinality === it2);
169578
169738
  return column12.name;
169579
169739
  });
169580
169740
  const columnsTo = fk6.columnsToOrdinals.map((it2) => {
169581
- const column12 = columnsList.find(
169582
- (column13) => Number(column13.tableId) === Number(fk6.tableToId) && column13.ordinality === it2
169583
- );
169741
+ const column12 = columnsList.find((column13) => column13.tableId === fk6.tableToId && column13.ordinality === it2);
169584
169742
  return column12.name;
169585
169743
  });
169586
169744
  fks.push({
@@ -169598,8 +169756,8 @@ ${JSON.stringify(column12.metadata)}`
169598
169756
  });
169599
169757
  }
169600
169758
  for (const check2 of constraintsList.filter((it2) => it2.type === "c")) {
169601
- const table7 = tablesList.find((it2) => Number(it2.oid) === Number(check2.tableId));
169602
- const schema6 = namespaces.find((it2) => Number(it2.oid) === Number(check2.schemaId));
169759
+ const table7 = tablesList.find((it2) => it2.oid === check2.tableId);
169760
+ const schema6 = namespaces.find((it2) => it2.oid === check2.schemaId);
169603
169761
  checks.push({
169604
169762
  entityType: "checks",
169605
169763
  schema: schema6.name,
@@ -169660,10 +169818,10 @@ ${JSON.stringify(column12.metadata)}`
169660
169818
  });
169661
169819
  for (const idx of idxs) {
169662
169820
  const { metadata } = idx;
169663
- const forUnique = metadata.isUnique && constraintsList.some((x6) => x6.type === "u" && Number(x6.indexId) === Number(idx.oid));
169664
- const forPK = metadata.isPrimary && constraintsList.some((x6) => x6.type === "p" && Number(x6.indexId) === Number(idx.oid));
169821
+ const forUnique = metadata.isUnique && constraintsList.some((x6) => x6.type === "u" && x6.indexId === idx.oid);
169822
+ const forPK = metadata.isPrimary && constraintsList.some((x6) => x6.type === "p" && x6.indexId === idx.oid);
169665
169823
  const expr = splitExpressions(metadata.expression);
169666
- const table7 = tablesList.find((it2) => Number(it2.oid) === Number(idx.metadata.tableId));
169824
+ const table7 = tablesList.find((it2) => it2.oid === idx.metadata.tableId);
169667
169825
  const nonColumnsCount = metadata.columnOrdinals.reduce((acc, it2) => {
169668
169826
  if (it2 === 0) acc += 1;
169669
169827
  return acc;
@@ -169695,7 +169853,7 @@ ${JSON.stringify(column12.metadata)}`
169695
169853
  k5 += 1;
169696
169854
  } else {
169697
169855
  const column12 = columnsList.find((column13) => {
169698
- return Number(column13.tableId) === Number(metadata.tableId) && column13.ordinality === ordinal;
169856
+ return column13.tableId === metadata.tableId && column13.ordinality === ordinal;
169699
169857
  });
169700
169858
  if (!column12) throw new Error(`missing column: ${metadata.tableId}:${ordinal}`);
169701
169859
  const options = opts[i6];
@@ -169744,7 +169902,7 @@ ${JSON.stringify(column12.metadata)}`
169744
169902
  progressCallback("indexes", indexesCount, "fetching");
169745
169903
  progressCallback("tables", tableCount, "done");
169746
169904
  for (const it2 of columnsList.filter((x6) => x6.kind === "m" || x6.kind === "v")) {
169747
- const view6 = viewsList.find((x6) => Number(x6.oid) === Number(it2.tableId));
169905
+ const view6 = viewsList.find((x6) => x6.oid === it2.tableId);
169748
169906
  const typeDimensions = it2.type.split("[]").length - 1;
169749
169907
  const enumType2 = it2.typeId in groupedEnums ? groupedEnums[it2.typeId] : it2.typeId in groupedArrEnums ? groupedArrEnums[it2.typeId] : null;
169750
169908
  let columnTypeMapped = enumType2 ? enumType2.name : it2.type.replace("[]", "");
@@ -169767,8 +169925,8 @@ ${JSON.stringify(column12.metadata)}`
169767
169925
  }
169768
169926
  for (const view6 of viewsList) {
169769
169927
  tableCount += 1;
169770
- const accessMethod = Number(view6.accessMethod) === 0 ? null : ams.find((it2) => Number(it2.oid) === Number(view6.accessMethod));
169771
- const tablespace = Number(view6.tablespaceid) === 0 ? null : tablespaces.find((it2) => Number(it2.oid) === Number(view6.tablespaceid)).name;
169928
+ const accessMethod = view6.accessMethod === 0 ? null : ams.find((it2) => it2.oid === view6.accessMethod);
169929
+ const tablespace = view6.tablespaceid === 0 ? null : tablespaces.find((it2) => it2.oid === view6.tablespaceid).name;
169772
169930
  const definition = parseViewDefinition(view6.definition);
169773
169931
  const withOpts = wrapRecord(
169774
169932
  ((_b = view6.options) == null ? void 0 : _b.reduce((acc, it2) => {
@@ -176775,7 +176933,6 @@ var init_cors = __esm({
176775
176933
  // src/cli/commands/studio.ts
176776
176934
  var studio_exports = {};
176777
176935
  __export(studio_exports, {
176778
- drizzleForDuckDb: () => drizzleForDuckDb,
176779
176936
  drizzleForLibSQL: () => drizzleForLibSQL,
176780
176937
  drizzleForMySQL: () => drizzleForMySQL,
176781
176938
  drizzleForPostgres: () => drizzleForPostgres,
@@ -176789,7 +176946,7 @@ __export(studio_exports, {
176789
176946
  prepareServer: () => prepareServer,
176790
176947
  prepareSingleStoreSchema: () => prepareSingleStoreSchema
176791
176948
  });
176792
- var import_crypto11, import_drizzle_orm8, import_relations8, import_mssql_core3, import_mysql_core3, import_pg_core3, import_singlestore_core2, import_sqlite_core3, import_fs16, import_node_https2, preparePgSchema, prepareMySqlSchema, prepareMsSqlSchema, prepareSQLiteSchema, prepareSingleStoreSchema, getCustomDefaults, drizzleForPostgres, drizzleForDuckDb, drizzleForMySQL, drizzleForSQLite, drizzleForLibSQL, drizzleForSingleStore, extractRelations, init, proxySchema, transactionProxySchema, defaultsSchema, schema5, jsonStringify, prepareServer;
176949
+ var import_crypto11, import_drizzle_orm8, import_relations8, import_mssql_core3, import_mysql_core3, import_pg_core3, import_singlestore_core2, import_sqlite_core3, import_fs16, import_node_https2, preparePgSchema, prepareMySqlSchema, prepareMsSqlSchema, prepareSQLiteSchema, prepareSingleStoreSchema, getCustomDefaults, drizzleForPostgres, drizzleForMySQL, drizzleForSQLite, drizzleForLibSQL, drizzleForSingleStore, extractRelations, init, proxySchema, transactionProxySchema, benchmarkProxySchema, defaultsSchema, schema5, jsonStringify, prepareServer;
176793
176950
  var init_studio = __esm({
176794
176951
  "src/cli/commands/studio.ts"() {
176795
176952
  "use strict";
@@ -177013,6 +177170,7 @@ var init_studio = __esm({
177013
177170
  packageName: db.packageName,
177014
177171
  proxy: db.proxy,
177015
177172
  transactionProxy: db.transactionProxy,
177173
+ benchmarkProxy: db.benchmarkProxy,
177016
177174
  customDefaults,
177017
177175
  schema: pgSchema2,
177018
177176
  relations: relations5,
@@ -177020,26 +177178,9 @@ var init_studio = __esm({
177020
177178
  casing: casing2
177021
177179
  };
177022
177180
  };
177023
- drizzleForDuckDb = async (credentials2) => {
177024
- const { prepareDuckDb: prepareDuckDb2 } = await Promise.resolve().then(() => (init_connections(), connections_exports));
177025
- const db = await prepareDuckDb2(credentials2);
177026
- const dbUrl = `duckdb://${credentials2.url}`;
177027
- const dbHash = (0, import_crypto11.createHash)("sha256").update(dbUrl).digest("hex");
177028
- return {
177029
- dbHash,
177030
- dialect: "duckdb",
177031
- driver: void 0,
177032
- packageName: db.packageName,
177033
- proxy: db.proxy,
177034
- transactionProxy: db.transactionProxy,
177035
- customDefaults: [],
177036
- schema: {},
177037
- relations: {}
177038
- };
177039
- };
177040
177181
  drizzleForMySQL = async (credentials2, mysqlSchema, relations5, schemaFiles, casing2) => {
177041
177182
  const { connectToMySQL: connectToMySQL2 } = await Promise.resolve().then(() => (init_connections(), connections_exports));
177042
- const { proxy, transactionProxy, database, packageName } = await connectToMySQL2(credentials2);
177183
+ const { proxy, transactionProxy, benchmarkProxy, database, packageName } = await connectToMySQL2(credentials2);
177043
177184
  const customDefaults = getCustomDefaults(mysqlSchema, casing2);
177044
177185
  let dbUrl;
177045
177186
  if ("url" in credentials2) {
@@ -177055,6 +177196,7 @@ var init_studio = __esm({
177055
177196
  databaseName: database,
177056
177197
  proxy,
177057
177198
  transactionProxy,
177199
+ benchmarkProxy,
177058
177200
  customDefaults,
177059
177201
  schema: mysqlSchema,
177060
177202
  relations: relations5,
@@ -177224,6 +177366,23 @@ var init_studio = __esm({
177224
177366
  ]).optional()
177225
177367
  }).array()
177226
177368
  });
177369
+ benchmarkProxySchema = external_exports.object({
177370
+ type: external_exports.literal("bproxy"),
177371
+ data: external_exports.object({
177372
+ query: external_exports.object({
177373
+ sql: external_exports.string(),
177374
+ params: external_exports.array(external_exports.any()).optional(),
177375
+ method: external_exports.union([
177376
+ external_exports.literal("values"),
177377
+ external_exports.literal("get"),
177378
+ external_exports.literal("all"),
177379
+ external_exports.literal("run"),
177380
+ external_exports.literal("execute")
177381
+ ]).optional()
177382
+ }),
177383
+ repeats: external_exports.number().min(1).optional()
177384
+ })
177385
+ });
177227
177386
  defaultsSchema = external_exports.object({
177228
177387
  type: external_exports.literal("defaults"),
177229
177388
  data: external_exports.array(
@@ -177238,6 +177397,7 @@ var init_studio = __esm({
177238
177397
  init,
177239
177398
  proxySchema,
177240
177399
  transactionProxySchema,
177400
+ benchmarkProxySchema,
177241
177401
  defaultsSchema
177242
177402
  ]);
177243
177403
  jsonStringify = (data2) => {
@@ -177260,6 +177420,7 @@ var init_studio = __esm({
177260
177420
  databaseName,
177261
177421
  proxy,
177262
177422
  transactionProxy,
177423
+ benchmarkProxy,
177263
177424
  customDefaults,
177264
177425
  schema: drizzleSchema,
177265
177426
  relations: relations5,
@@ -177323,7 +177484,7 @@ var init_studio = __esm({
177323
177484
  console.warn("Error message:", error4.message);
177324
177485
  }
177325
177486
  return c5.json({
177326
- version: "6.2",
177487
+ version: "6.3",
177327
177488
  dialect: dialect6,
177328
177489
  driver: driver2,
177329
177490
  packageName,
@@ -177361,6 +177522,21 @@ var init_studio = __esm({
177361
177522
  }
177362
177523
  );
177363
177524
  }
177525
+ if (type === "bproxy") {
177526
+ if (!benchmarkProxy) {
177527
+ throw new Error("Benchmark proxy is not configured for this database.");
177528
+ }
177529
+ const result2 = await benchmarkProxy(body.data.query, body.data.repeats || 1);
177530
+ const res = jsonStringify(result2);
177531
+ return c5.body(
177532
+ res,
177533
+ {
177534
+ headers: {
177535
+ "Content-Type": "application/json"
177536
+ }
177537
+ }
177538
+ );
177539
+ }
177364
177540
  if (type === "defaults") {
177365
177541
  const columns = body.data;
177366
177542
  const result2 = columns.map((column12) => {
@@ -179298,25 +179474,6 @@ var printConfigConnectionIssues = (options) => {
179298
179474
  // src/cli/commands/utils.ts
179299
179475
  init_common3();
179300
179476
 
179301
- // src/cli/validations/duckdb.ts
179302
- init_esm();
179303
- init_views();
179304
- init_common3();
179305
- var duckdbCredentials = objectType({
179306
- driver: undefinedType(),
179307
- url: stringType().min(1)
179308
- }).transform((o5) => {
179309
- delete o5.driver;
179310
- return o5;
179311
- });
179312
- var printConfigConnectionIssues2 = (options) => {
179313
- const text = `Please provide required params:
179314
- `;
179315
- console.log(error2(text));
179316
- console.log(wrapParam("url", options.url));
179317
- process.exit(1);
179318
- };
179319
-
179320
179477
  // src/cli/validations/gel.ts
179321
179478
  init_esm();
179322
179479
  init_views();
@@ -179357,7 +179514,7 @@ var gelCredentials = unionType([
179357
179514
  }).transform(() => {
179358
179515
  })
179359
179516
  ]);
179360
- var printConfigConnectionIssues3 = (options) => {
179517
+ var printConfigConnectionIssues2 = (options) => {
179361
179518
  if ("url" in options) {
179362
179519
  let text = `Please provide required params for Gel driver:
179363
179520
  `;
@@ -179393,7 +179550,7 @@ var libSQLCredentials = objectType({
179393
179550
  url: stringType().min(1),
179394
179551
  authToken: stringType().min(1).optional()
179395
179552
  });
179396
- var printConfigConnectionIssues4 = (options, _command) => {
179553
+ var printConfigConnectionIssues3 = (options, _command) => {
179397
179554
  let text = `Please provide required params for 'turso' dialect:
179398
179555
  `;
179399
179556
  console.log(error2(text));
@@ -179423,7 +179580,7 @@ var mssqlCredentials = unionType([
179423
179580
  url: stringType().min(1)
179424
179581
  })
179425
179582
  ]);
179426
- var printConfigConnectionIssues5 = (options) => {
179583
+ var printConfigConnectionIssues4 = (options) => {
179427
179584
  if ("url" in options) {
179428
179585
  let text2 = `Please provide required params for MsSQL driver:
179429
179586
  `;
@@ -179472,7 +179629,7 @@ var mysqlCredentials = unionType([
179472
179629
  url: stringType().min(1)
179473
179630
  })
179474
179631
  ]);
179475
- var printConfigConnectionIssues6 = (options) => {
179632
+ var printConfigConnectionIssues5 = (options) => {
179476
179633
  if ("url" in options) {
179477
179634
  let text2 = `Please provide required params for MySQL driver:
179478
179635
  `;
@@ -179537,7 +179694,7 @@ var postgresCredentials = unionType([
179537
179694
  url: stringType().min(1)
179538
179695
  })
179539
179696
  ]);
179540
- var printConfigConnectionIssues7 = (options) => {
179697
+ var printConfigConnectionIssues6 = (options) => {
179541
179698
  if (options.driver === "aws-data-api") {
179542
179699
  let text = `Please provide required params for AWS Data API driver:
179543
179700
  `;
@@ -179604,7 +179761,7 @@ var singlestoreCredentials = unionType([
179604
179761
  url: stringType().min(1)
179605
179762
  })
179606
179763
  ]);
179607
- var printConfigConnectionIssues8 = (options) => {
179764
+ var printConfigConnectionIssues7 = (options) => {
179608
179765
  if ("url" in options) {
179609
179766
  let text2 = `Please provide required params for SingleStore driver:
179610
179767
  `;
@@ -179653,7 +179810,7 @@ var sqliteCredentials = unionType([
179653
179810
  return o5;
179654
179811
  })
179655
179812
  ]);
179656
- var printConfigConnectionIssues9 = (options, command2) => {
179813
+ var printConfigConnectionIssues8 = (options, command2) => {
179657
179814
  const parsedDriver = sqliteDriver.safeParse(options.driver);
179658
179815
  const driver2 = parsedDriver.success ? parsedDriver.data : "";
179659
179816
  if (driver2 === "expo") {
@@ -179857,7 +180014,7 @@ var preparePushConfig = async (options, from) => {
179857
180014
  if (config.dialect === "postgresql") {
179858
180015
  const parsed2 = postgresCredentials.safeParse(config);
179859
180016
  if (!parsed2.success) {
179860
- printConfigConnectionIssues7(config);
180017
+ printConfigConnectionIssues6(config);
179861
180018
  process.exit(1);
179862
180019
  }
179863
180020
  return {
@@ -179874,7 +180031,7 @@ var preparePushConfig = async (options, from) => {
179874
180031
  if (config.dialect === "mysql") {
179875
180032
  const parsed2 = mysqlCredentials.safeParse(config);
179876
180033
  if (!parsed2.success) {
179877
- printConfigConnectionIssues6(config);
180034
+ printConfigConnectionIssues5(config);
179878
180035
  process.exit(1);
179879
180036
  }
179880
180037
  return {
@@ -179891,7 +180048,7 @@ var preparePushConfig = async (options, from) => {
179891
180048
  if (config.dialect === "singlestore") {
179892
180049
  const parsed2 = singlestoreCredentials.safeParse(config);
179893
180050
  if (!parsed2.success) {
179894
- printConfigConnectionIssues8(config);
180051
+ printConfigConnectionIssues7(config);
179895
180052
  process.exit(1);
179896
180053
  }
179897
180054
  return {
@@ -179907,7 +180064,7 @@ var preparePushConfig = async (options, from) => {
179907
180064
  if (config.dialect === "sqlite") {
179908
180065
  const parsed2 = sqliteCredentials.safeParse(config);
179909
180066
  if (!parsed2.success) {
179910
- printConfigConnectionIssues9(config, "push");
180067
+ printConfigConnectionIssues8(config, "push");
179911
180068
  process.exit(1);
179912
180069
  }
179913
180070
  return {
@@ -179924,7 +180081,7 @@ var preparePushConfig = async (options, from) => {
179924
180081
  if (config.dialect === "turso") {
179925
180082
  const parsed2 = libSQLCredentials.safeParse(config);
179926
180083
  if (!parsed2.success) {
179927
- printConfigConnectionIssues9(config, "push");
180084
+ printConfigConnectionIssues8(config, "push");
179928
180085
  process.exit(1);
179929
180086
  }
179930
180087
  return {
@@ -179979,14 +180136,6 @@ var preparePushConfig = async (options, from) => {
179979
180136
  explain: false
179980
180137
  };
179981
180138
  }
179982
- if (config.dialect === "duckdb") {
179983
- console.log(
179984
- error2(
179985
- `You can't use 'push' command with DuckDb dialect`
179986
- )
179987
- );
179988
- process.exit(1);
179989
- }
179990
180139
  assertUnreachable(config.dialect);
179991
180140
  };
179992
180141
  var preparePullConfig = async (options, from) => {
@@ -180012,7 +180161,7 @@ var preparePullConfig = async (options, from) => {
180012
180161
  if (dialect6 === "postgresql") {
180013
180162
  const parsed2 = postgresCredentials.safeParse(config);
180014
180163
  if (!parsed2.success) {
180015
- printConfigConnectionIssues7(config);
180164
+ printConfigConnectionIssues6(config);
180016
180165
  process.exit(1);
180017
180166
  }
180018
180167
  return {
@@ -180031,7 +180180,7 @@ var preparePullConfig = async (options, from) => {
180031
180180
  if (dialect6 === "mysql") {
180032
180181
  const parsed2 = mysqlCredentials.safeParse(config);
180033
180182
  if (!parsed2.success) {
180034
- printConfigConnectionIssues6(config);
180183
+ printConfigConnectionIssues5(config);
180035
180184
  process.exit(1);
180036
180185
  }
180037
180186
  return {
@@ -180050,7 +180199,7 @@ var preparePullConfig = async (options, from) => {
180050
180199
  if (dialect6 === "singlestore") {
180051
180200
  const parsed2 = singlestoreCredentials.safeParse(config);
180052
180201
  if (!parsed2.success) {
180053
- printConfigConnectionIssues8(config);
180202
+ printConfigConnectionIssues7(config);
180054
180203
  process.exit(1);
180055
180204
  }
180056
180205
  return {
@@ -180069,7 +180218,7 @@ var preparePullConfig = async (options, from) => {
180069
180218
  if (dialect6 === "sqlite") {
180070
180219
  const parsed2 = sqliteCredentials.safeParse(config);
180071
180220
  if (!parsed2.success) {
180072
- printConfigConnectionIssues9(config, "pull");
180221
+ printConfigConnectionIssues8(config, "pull");
180073
180222
  process.exit(1);
180074
180223
  }
180075
180224
  return {
@@ -180088,7 +180237,7 @@ var preparePullConfig = async (options, from) => {
180088
180237
  if (dialect6 === "turso") {
180089
180238
  const parsed2 = libSQLCredentials.safeParse(config);
180090
180239
  if (!parsed2.success) {
180091
- printConfigConnectionIssues4(config, "pull");
180240
+ printConfigConnectionIssues3(config, "pull");
180092
180241
  process.exit(1);
180093
180242
  }
180094
180243
  return {
@@ -180107,7 +180256,7 @@ var preparePullConfig = async (options, from) => {
180107
180256
  if (dialect6 === "gel") {
180108
180257
  const parsed2 = gelCredentials.safeParse(config);
180109
180258
  if (!parsed2.success) {
180110
- printConfigConnectionIssues3(config);
180259
+ printConfigConnectionIssues2(config);
180111
180260
  process.exit(1);
180112
180261
  }
180113
180262
  return {
@@ -180160,14 +180309,6 @@ var preparePullConfig = async (options, from) => {
180160
180309
  migrationsTable: table7
180161
180310
  };
180162
180311
  }
180163
- if (dialect6 === "duckdb") {
180164
- console.log(
180165
- error2(
180166
- `You can't use 'pull' command with DuckDb dialect`
180167
- )
180168
- );
180169
- process.exit(1);
180170
- }
180171
180312
  assertUnreachable(dialect6);
180172
180313
  };
180173
180314
  var prepareStudioConfig = async (options) => {
@@ -180190,7 +180331,7 @@ var prepareStudioConfig = async (options) => {
180190
180331
  if (dialect6 === "postgresql") {
180191
180332
  const parsed = postgresCredentials.safeParse(flattened);
180192
180333
  if (!parsed.success) {
180193
- printConfigConnectionIssues7(flattened);
180334
+ printConfigConnectionIssues6(flattened);
180194
180335
  process.exit(1);
180195
180336
  }
180196
180337
  const credentials2 = parsed.data;
@@ -180206,7 +180347,7 @@ var prepareStudioConfig = async (options) => {
180206
180347
  if (dialect6 === "mysql") {
180207
180348
  const parsed = mysqlCredentials.safeParse(flattened);
180208
180349
  if (!parsed.success) {
180209
- printConfigConnectionIssues6(flattened);
180350
+ printConfigConnectionIssues5(flattened);
180210
180351
  process.exit(1);
180211
180352
  }
180212
180353
  const credentials2 = parsed.data;
@@ -180222,7 +180363,7 @@ var prepareStudioConfig = async (options) => {
180222
180363
  if (dialect6 === "singlestore") {
180223
180364
  const parsed = singlestoreCredentials.safeParse(flattened);
180224
180365
  if (!parsed.success) {
180225
- printConfigConnectionIssues8(flattened);
180366
+ printConfigConnectionIssues7(flattened);
180226
180367
  process.exit(1);
180227
180368
  }
180228
180369
  const credentials2 = parsed.data;
@@ -180238,7 +180379,7 @@ var prepareStudioConfig = async (options) => {
180238
180379
  if (dialect6 === "sqlite") {
180239
180380
  const parsed = sqliteCredentials.safeParse(flattened);
180240
180381
  if (!parsed.success) {
180241
- printConfigConnectionIssues9(flattened, "studio");
180382
+ printConfigConnectionIssues8(flattened, "studio");
180242
180383
  process.exit(1);
180243
180384
  }
180244
180385
  const credentials2 = parsed.data;
@@ -180254,7 +180395,7 @@ var prepareStudioConfig = async (options) => {
180254
180395
  if (dialect6 === "turso") {
180255
180396
  const parsed = libSQLCredentials.safeParse(flattened);
180256
180397
  if (!parsed.success) {
180257
- printConfigConnectionIssues4(flattened, "studio");
180398
+ printConfigConnectionIssues3(flattened, "studio");
180258
180399
  process.exit(1);
180259
180400
  }
180260
180401
  const credentials2 = parsed.data;
@@ -180288,21 +180429,6 @@ var prepareStudioConfig = async (options) => {
180288
180429
  if (dialect6 === "mssql") {
180289
180430
  throw new Error(`You can't use 'studio' command with MsSql dialect yet`);
180290
180431
  }
180291
- if (dialect6 === "duckdb") {
180292
- const parsed = duckdbCredentials.safeParse(flattened);
180293
- if (!parsed.success) {
180294
- printConfigConnectionIssues2(flattened);
180295
- process.exit(1);
180296
- }
180297
- const credentials2 = parsed.data;
180298
- return {
180299
- dialect: dialect6,
180300
- schema: schema6,
180301
- host,
180302
- port,
180303
- credentials: credentials2
180304
- };
180305
- }
180306
180432
  assertUnreachable(dialect6);
180307
180433
  };
180308
180434
  var migrateConfig = objectType({
@@ -180324,7 +180450,7 @@ var prepareMigrateConfig = async (configPath) => {
180324
180450
  if (dialect6 === "postgresql") {
180325
180451
  const parsed2 = postgresCredentials.safeParse(flattened);
180326
180452
  if (!parsed2.success) {
180327
- printConfigConnectionIssues7(flattened);
180453
+ printConfigConnectionIssues6(flattened);
180328
180454
  process.exit(1);
180329
180455
  }
180330
180456
  const credentials2 = parsed2.data;
@@ -180339,7 +180465,7 @@ var prepareMigrateConfig = async (configPath) => {
180339
180465
  if (dialect6 === "mysql") {
180340
180466
  const parsed2 = mysqlCredentials.safeParse(flattened);
180341
180467
  if (!parsed2.success) {
180342
- printConfigConnectionIssues6(flattened);
180468
+ printConfigConnectionIssues5(flattened);
180343
180469
  process.exit(1);
180344
180470
  }
180345
180471
  const credentials2 = parsed2.data;
@@ -180354,7 +180480,7 @@ var prepareMigrateConfig = async (configPath) => {
180354
180480
  if (dialect6 === "singlestore") {
180355
180481
  const parsed2 = singlestoreCredentials.safeParse(flattened);
180356
180482
  if (!parsed2.success) {
180357
- printConfigConnectionIssues8(flattened);
180483
+ printConfigConnectionIssues7(flattened);
180358
180484
  process.exit(1);
180359
180485
  }
180360
180486
  const credentials2 = parsed2.data;
@@ -180369,7 +180495,7 @@ var prepareMigrateConfig = async (configPath) => {
180369
180495
  if (dialect6 === "sqlite") {
180370
180496
  const parsed2 = sqliteCredentials.safeParse(flattened);
180371
180497
  if (!parsed2.success) {
180372
- printConfigConnectionIssues9(flattened, "migrate");
180498
+ printConfigConnectionIssues8(flattened, "migrate");
180373
180499
  process.exit(1);
180374
180500
  }
180375
180501
  const credentials2 = parsed2.data;
@@ -180384,7 +180510,7 @@ var prepareMigrateConfig = async (configPath) => {
180384
180510
  if (dialect6 === "turso") {
180385
180511
  const parsed2 = libSQLCredentials.safeParse(flattened);
180386
180512
  if (!parsed2.success) {
180387
- printConfigConnectionIssues4(flattened, "migrate");
180513
+ printConfigConnectionIssues3(flattened, "migrate");
180388
180514
  process.exit(1);
180389
180515
  }
180390
180516
  const credentials2 = parsed2.data;
@@ -180407,7 +180533,7 @@ var prepareMigrateConfig = async (configPath) => {
180407
180533
  if (dialect6 === "mssql") {
180408
180534
  const parsed2 = mssqlCredentials.safeParse(flattened);
180409
180535
  if (!parsed2.success) {
180410
- printConfigConnectionIssues5(flattened);
180536
+ printConfigConnectionIssues4(flattened);
180411
180537
  process.exit(1);
180412
180538
  }
180413
180539
  const credentials2 = parsed2.data;
@@ -180434,14 +180560,6 @@ var prepareMigrateConfig = async (configPath) => {
180434
180560
  table: table7
180435
180561
  };
180436
180562
  }
180437
- if (dialect6 === "duckdb") {
180438
- console.log(
180439
- error2(
180440
- `You can't use 'migrate' command with DuckDb dialect`
180441
- )
180442
- );
180443
- process.exit(1);
180444
- }
180445
180563
  assertUnreachable(dialect6);
180446
180564
  };
180447
180565
  var drizzleConfigFromFile = async (configPath, isExport) => {
@@ -181317,7 +181435,7 @@ init_common3();
181317
181435
  init_outputs();
181318
181436
  init_views();
181319
181437
  var optionDialect = string("dialect").enum(...dialects).desc(
181320
- `Database dialect: 'gel', 'postgresql', 'mysql', 'sqlite', 'turso', 'singlestore', 'duckdb' or 'mssql'`
181438
+ `Database dialect: 'gel', 'postgresql', 'mysql', 'sqlite', 'turso', 'singlestore' or 'mssql'`
181321
181439
  );
181322
181440
  var optionOut = string().desc("Output folder, 'drizzle' by default");
181323
181441
  var optionConfig = string().desc("Path to drizzle config file");
@@ -181378,13 +181496,6 @@ var generate = command({
181378
181496
  } else if (dialect6 === "cockroach") {
181379
181497
  const { handle: handle21 } = await Promise.resolve().then(() => (init_generate_cockroach(), generate_cockroach_exports));
181380
181498
  await handle21(opts);
181381
- } else if (dialect6 === "duckdb") {
181382
- console.log(
181383
- error2(
181384
- `You can't use 'generate' command with DuckDb dialect`
181385
- )
181386
- );
181387
- process.exit(1);
181388
181499
  } else {
181389
181500
  assertUnreachable(dialect6);
181390
181501
  }
@@ -181848,8 +181959,7 @@ var studio = command({
181848
181959
  drizzleForSQLite: drizzleForSQLite2,
181849
181960
  prepareSingleStoreSchema: prepareSingleStoreSchema2,
181850
181961
  drizzleForSingleStore: drizzleForSingleStore2,
181851
- drizzleForLibSQL: drizzleForLibSQL2,
181852
- drizzleForDuckDb: drizzleForDuckDb2
181962
+ drizzleForLibSQL: drizzleForLibSQL2
181853
181963
  // drizzleForMsSQL,
181854
181964
  } = await Promise.resolve().then(() => (init_studio(), studio_exports));
181855
181965
  let setup;
@@ -181894,8 +182004,6 @@ var studio = command({
181894
182004
  files,
181895
182005
  casing2
181896
182006
  );
181897
- } else if (dialect6 === "duckdb") {
181898
- setup = await drizzleForDuckDb2(credentials2);
181899
182007
  } else if (dialect6 === "cockroach") {
181900
182008
  throw new Error(`You can't use 'studio' command with 'cockroach' dialect`);
181901
182009
  } else {
@@ -181981,13 +182089,6 @@ var exportRaw = command({
181981
182089
  } else if (dialect6 === "cockroach") {
181982
182090
  const { handleExport: handleExport7 } = await Promise.resolve().then(() => (init_generate_cockroach(), generate_cockroach_exports));
181983
182091
  await handleExport7(opts);
181984
- } else if (dialect6 === "duckdb") {
181985
- console.log(
181986
- error2(
181987
- `You can't use 'export' command with DuckDb dialect`
181988
- )
181989
- );
181990
- process.exit(1);
181991
182092
  } else {
181992
182093
  assertUnreachable(dialect6);
181993
182094
  }