drizzle-kit 1.0.0-beta.2-86f844e → 1.0.0-beta.2-ec83fa8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/api-mysql.js +358 -68
- package/api-mysql.mjs +358 -68
- package/api-postgres.js +360 -70
- package/api-postgres.mjs +360 -70
- package/api-sqlite.js +358 -68
- package/api-sqlite.mjs +358 -68
- package/bin.cjs +360 -70
- package/package.json +1 -1
package/api-sqlite.js
CHANGED
|
@@ -28717,7 +28717,7 @@ var require_websocket = __commonJS({
|
|
|
28717
28717
|
var EventEmitter = require("events");
|
|
28718
28718
|
var https2 = require("https");
|
|
28719
28719
|
var http3 = require("http");
|
|
28720
|
-
var
|
|
28720
|
+
var net2 = require("net");
|
|
28721
28721
|
var tls = require("tls");
|
|
28722
28722
|
var { randomBytes, createHash: createHash5 } = require("crypto");
|
|
28723
28723
|
var { Duplex, Readable: Readable6 } = require("stream");
|
|
@@ -29448,12 +29448,12 @@ var require_websocket = __commonJS({
|
|
|
29448
29448
|
}
|
|
29449
29449
|
function netConnect(options) {
|
|
29450
29450
|
options.path = options.socketPath;
|
|
29451
|
-
return
|
|
29451
|
+
return net2.connect(options);
|
|
29452
29452
|
}
|
|
29453
29453
|
function tlsConnect(options) {
|
|
29454
29454
|
options.path = void 0;
|
|
29455
29455
|
if (!options.servername && options.servername !== "") {
|
|
29456
|
-
options.servername =
|
|
29456
|
+
options.servername = net2.isIP(options.host) ? "" : options.host;
|
|
29457
29457
|
}
|
|
29458
29458
|
return tls.connect(options);
|
|
29459
29459
|
}
|
|
@@ -33772,7 +33772,7 @@ var init_timing = __esm({
|
|
|
33772
33772
|
"../node_modules/.pnpm/@smithy+node-http-handler@4.4.5/node_modules/@smithy/node-http-handler/dist-es/timing.js"() {
|
|
33773
33773
|
"use strict";
|
|
33774
33774
|
timing = {
|
|
33775
|
-
setTimeout: (cb,
|
|
33775
|
+
setTimeout: (cb, ms2) => setTimeout(cb, ms2),
|
|
33776
33776
|
clearTimeout: (timeoutId) => clearTimeout(timeoutId)
|
|
33777
33777
|
};
|
|
33778
33778
|
}
|
|
@@ -35660,13 +35660,13 @@ var init_schema_date_utils = __esm({
|
|
|
35660
35660
|
if (!matches) {
|
|
35661
35661
|
throw new TypeError(`Invalid RFC3339 timestamp format ${value}`);
|
|
35662
35662
|
}
|
|
35663
|
-
const [, yearStr, monthStr, dayStr, hours, minutes, seconds, ,
|
|
35663
|
+
const [, yearStr, monthStr, dayStr, hours, minutes, seconds, , ms2, offsetStr] = matches;
|
|
35664
35664
|
range(monthStr, 1, 12);
|
|
35665
35665
|
range(dayStr, 1, 31);
|
|
35666
35666
|
range(hours, 0, 23);
|
|
35667
35667
|
range(minutes, 0, 59);
|
|
35668
35668
|
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(
|
|
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
35670
|
date2.setUTCFullYear(Number(yearStr));
|
|
35671
35671
|
if (offsetStr.toUpperCase() != "Z") {
|
|
35672
35672
|
const [, sign2, offsetH, offsetM] = /([+-])(\d\d):(\d\d)/.exec(offsetStr) || [void 0, "+", 0, 0];
|
|
@@ -55680,8 +55680,8 @@ var require_datetime2 = __commonJS({
|
|
|
55680
55680
|
if (!(object instanceof Date)) {
|
|
55681
55681
|
throw new errors_1.InvalidArgumentError(`a Date instance was expected, got "${object}"`);
|
|
55682
55682
|
}
|
|
55683
|
-
const
|
|
55684
|
-
const us =
|
|
55683
|
+
const ms2 = object.getTime() - TIMESHIFT;
|
|
55684
|
+
const us = ms2 * 1e3;
|
|
55685
55685
|
buf.writeInt32(8);
|
|
55686
55686
|
buf.writeInt64(us);
|
|
55687
55687
|
}
|
|
@@ -55691,12 +55691,12 @@ var require_datetime2 = __commonJS({
|
|
|
55691
55691
|
return ctx.postDecode(this, us2 + BI_TIMESHIFT_US);
|
|
55692
55692
|
}
|
|
55693
55693
|
const us = Number(buf.readBigInt64());
|
|
55694
|
-
let
|
|
55695
|
-
if (Math.abs(us % 1e3) === 500 && Math.abs(
|
|
55696
|
-
|
|
55694
|
+
let ms2 = Math.round(us / 1e3);
|
|
55695
|
+
if (Math.abs(us % 1e3) === 500 && Math.abs(ms2) % 2 === 1) {
|
|
55696
|
+
ms2 -= 1;
|
|
55697
55697
|
}
|
|
55698
|
-
|
|
55699
|
-
return new Date(
|
|
55698
|
+
ms2 += TIMESHIFT;
|
|
55699
|
+
return new Date(ms2);
|
|
55700
55700
|
}
|
|
55701
55701
|
};
|
|
55702
55702
|
exports2.DateTimeCodec = DateTimeCodec;
|
|
@@ -55717,8 +55717,8 @@ var require_datetime2 = __commonJS({
|
|
|
55717
55717
|
if (!(object instanceof datetime_1.LocalDateTime)) {
|
|
55718
55718
|
throw new errors_1.InvalidArgumentError(`a LocalDateTime instance was expected, got "${object}"`);
|
|
55719
55719
|
}
|
|
55720
|
-
const
|
|
55721
|
-
let us =
|
|
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);
|
|
55722
55722
|
if (object.nanosecond === 500 && Math.abs(object.microsecond) % 2 === 1 || object.nanosecond > 500) {
|
|
55723
55723
|
us += 1n;
|
|
55724
55724
|
}
|
|
@@ -55732,13 +55732,13 @@ var require_datetime2 = __commonJS({
|
|
|
55732
55732
|
}
|
|
55733
55733
|
const bi_ms = bi_us / 1000n;
|
|
55734
55734
|
let us = Number(bi_us - bi_ms * 1000n);
|
|
55735
|
-
let
|
|
55735
|
+
let ms2 = Number(bi_ms);
|
|
55736
55736
|
if (us < 0) {
|
|
55737
55737
|
us += 1e3;
|
|
55738
|
-
|
|
55738
|
+
ms2 -= 1;
|
|
55739
55739
|
}
|
|
55740
|
-
|
|
55741
|
-
const date2 = new Date(
|
|
55740
|
+
ms2 += TIMESHIFT;
|
|
55741
|
+
const date2 = new Date(ms2);
|
|
55742
55742
|
return new datetime_1.LocalDateTime(date2.getUTCFullYear(), date2.getUTCMonth() + 1, date2.getUTCDate(), date2.getUTCHours(), date2.getUTCMinutes(), date2.getUTCSeconds(), date2.getUTCMilliseconds(), us);
|
|
55743
55743
|
}
|
|
55744
55744
|
};
|
|
@@ -55800,13 +55800,13 @@ var require_datetime2 = __commonJS({
|
|
|
55800
55800
|
}
|
|
55801
55801
|
let us = Number(bius);
|
|
55802
55802
|
let seconds = Math.floor(us / 1e6);
|
|
55803
|
-
const
|
|
55804
|
-
us = us % 1e6 -
|
|
55803
|
+
const ms2 = Math.floor(us % 1e6 / 1e3);
|
|
55804
|
+
us = us % 1e6 - ms2 * 1e3;
|
|
55805
55805
|
let minutes = Math.floor(seconds / 60);
|
|
55806
55806
|
seconds = Math.floor(seconds % 60);
|
|
55807
55807
|
const hours = Math.floor(minutes / 60);
|
|
55808
55808
|
minutes = Math.floor(minutes % 60);
|
|
55809
|
-
return new datetime_1.LocalTime(hours, minutes, seconds,
|
|
55809
|
+
return new datetime_1.LocalTime(hours, minutes, seconds, ms2, us);
|
|
55810
55810
|
}
|
|
55811
55811
|
};
|
|
55812
55812
|
exports2.LocalTimeCodec = LocalTimeCodec;
|
|
@@ -55883,14 +55883,14 @@ var require_datetime2 = __commonJS({
|
|
|
55883
55883
|
const biMillion = 1000000n;
|
|
55884
55884
|
const biSeconds = bius / biMillion;
|
|
55885
55885
|
let us = Number(bius - biSeconds * biMillion);
|
|
55886
|
-
const
|
|
55886
|
+
const ms2 = Math.floor(us / 1e3);
|
|
55887
55887
|
us = us % 1e3;
|
|
55888
55888
|
let seconds = Number(biSeconds);
|
|
55889
55889
|
let minutes = Math.floor(seconds / 60);
|
|
55890
55890
|
seconds = Math.floor(seconds % 60);
|
|
55891
55891
|
const hours = Math.floor(minutes / 60);
|
|
55892
55892
|
minutes = Math.floor(minutes % 60);
|
|
55893
|
-
return new datetime_1.Duration(0, 0, 0, 0, hours * sign2, minutes * sign2, seconds * sign2,
|
|
55893
|
+
return new datetime_1.Duration(0, 0, 0, 0, hours * sign2, minutes * sign2, seconds * sign2, ms2 * sign2, us * sign2);
|
|
55894
55894
|
}
|
|
55895
55895
|
};
|
|
55896
55896
|
exports2.DurationCodec = DurationCodec;
|
|
@@ -55936,7 +55936,7 @@ var require_datetime2 = __commonJS({
|
|
|
55936
55936
|
const million = BigInt(1e6);
|
|
55937
55937
|
const biSeconds = bius / million;
|
|
55938
55938
|
let us = Number(bius - biSeconds * million);
|
|
55939
|
-
const
|
|
55939
|
+
const ms2 = Math.trunc(us / 1e3);
|
|
55940
55940
|
us = us % 1e3;
|
|
55941
55941
|
let seconds = Number(biSeconds);
|
|
55942
55942
|
let minutes = Math.trunc(seconds / 60);
|
|
@@ -55947,7 +55947,7 @@ var require_datetime2 = __commonJS({
|
|
|
55947
55947
|
days = Math.trunc(days % 7);
|
|
55948
55948
|
const years = Math.trunc(months2 / 12);
|
|
55949
55949
|
months2 = Math.trunc(months2 % 12);
|
|
55950
|
-
return new datetime_1.RelativeDuration(years, months2, weeks, days, hours * sign2, minutes * sign2, seconds * sign2,
|
|
55950
|
+
return new datetime_1.RelativeDuration(years, months2, weeks, days, hours * sign2, minutes * sign2, seconds * sign2, ms2 * sign2, us * sign2);
|
|
55951
55951
|
}
|
|
55952
55952
|
};
|
|
55953
55953
|
exports2.RelativeDurationCodec = RelativeDurationCodec;
|
|
@@ -66111,41 +66111,41 @@ var require_ms = __commonJS({
|
|
|
66111
66111
|
return void 0;
|
|
66112
66112
|
}
|
|
66113
66113
|
}
|
|
66114
|
-
function fmtShort(
|
|
66115
|
-
var msAbs = Math.abs(
|
|
66114
|
+
function fmtShort(ms2) {
|
|
66115
|
+
var msAbs = Math.abs(ms2);
|
|
66116
66116
|
if (msAbs >= d6) {
|
|
66117
|
-
return Math.round(
|
|
66117
|
+
return Math.round(ms2 / d6) + "d";
|
|
66118
66118
|
}
|
|
66119
66119
|
if (msAbs >= h7) {
|
|
66120
|
-
return Math.round(
|
|
66120
|
+
return Math.round(ms2 / h7) + "h";
|
|
66121
66121
|
}
|
|
66122
66122
|
if (msAbs >= m7) {
|
|
66123
|
-
return Math.round(
|
|
66123
|
+
return Math.round(ms2 / m7) + "m";
|
|
66124
66124
|
}
|
|
66125
66125
|
if (msAbs >= s7) {
|
|
66126
|
-
return Math.round(
|
|
66126
|
+
return Math.round(ms2 / s7) + "s";
|
|
66127
66127
|
}
|
|
66128
|
-
return
|
|
66128
|
+
return ms2 + "ms";
|
|
66129
66129
|
}
|
|
66130
|
-
function fmtLong(
|
|
66131
|
-
var msAbs = Math.abs(
|
|
66130
|
+
function fmtLong(ms2) {
|
|
66131
|
+
var msAbs = Math.abs(ms2);
|
|
66132
66132
|
if (msAbs >= d6) {
|
|
66133
|
-
return plural(
|
|
66133
|
+
return plural(ms2, msAbs, d6, "day");
|
|
66134
66134
|
}
|
|
66135
66135
|
if (msAbs >= h7) {
|
|
66136
|
-
return plural(
|
|
66136
|
+
return plural(ms2, msAbs, h7, "hour");
|
|
66137
66137
|
}
|
|
66138
66138
|
if (msAbs >= m7) {
|
|
66139
|
-
return plural(
|
|
66139
|
+
return plural(ms2, msAbs, m7, "minute");
|
|
66140
66140
|
}
|
|
66141
66141
|
if (msAbs >= s7) {
|
|
66142
|
-
return plural(
|
|
66142
|
+
return plural(ms2, msAbs, s7, "second");
|
|
66143
66143
|
}
|
|
66144
|
-
return
|
|
66144
|
+
return ms2 + " ms";
|
|
66145
66145
|
}
|
|
66146
|
-
function plural(
|
|
66146
|
+
function plural(ms2, msAbs, n6, name) {
|
|
66147
66147
|
var isPlural = msAbs >= n6 * 1.5;
|
|
66148
|
-
return Math.round(
|
|
66148
|
+
return Math.round(ms2 / n6) + " " + name + (isPlural ? "s" : "");
|
|
66149
66149
|
}
|
|
66150
66150
|
}
|
|
66151
66151
|
});
|
|
@@ -66189,8 +66189,8 @@ var require_common2 = __commonJS({
|
|
|
66189
66189
|
}
|
|
66190
66190
|
const self2 = debug;
|
|
66191
66191
|
const curr = Number(/* @__PURE__ */ new Date());
|
|
66192
|
-
const
|
|
66193
|
-
self2.diff =
|
|
66192
|
+
const ms2 = curr - (prevTime || curr);
|
|
66193
|
+
self2.diff = ms2;
|
|
66194
66194
|
self2.prev = prevTime;
|
|
66195
66195
|
self2.curr = curr;
|
|
66196
66196
|
prevTime = curr;
|
|
@@ -81693,11 +81693,11 @@ var require_TokenExpiredError = __commonJS({
|
|
|
81693
81693
|
var require_timespan = __commonJS({
|
|
81694
81694
|
"../node_modules/.pnpm/jsonwebtoken@9.0.2/node_modules/jsonwebtoken/lib/timespan.js"(exports2, module2) {
|
|
81695
81695
|
"use strict";
|
|
81696
|
-
var
|
|
81696
|
+
var ms2 = require_ms();
|
|
81697
81697
|
module2.exports = function(time2, iat) {
|
|
81698
81698
|
var timestamp = iat || Math.floor(Date.now() / 1e3);
|
|
81699
81699
|
if (typeof time2 === "string") {
|
|
81700
|
-
var milliseconds =
|
|
81700
|
+
var milliseconds = ms2(time2);
|
|
81701
81701
|
if (typeof milliseconds === "undefined") {
|
|
81702
81702
|
return;
|
|
81703
81703
|
}
|
|
@@ -96235,7 +96235,7 @@ var require_dist = __commonJS({
|
|
|
96235
96235
|
};
|
|
96236
96236
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
96237
96237
|
exports2.Agent = void 0;
|
|
96238
|
-
var
|
|
96238
|
+
var net2 = __importStar2(require("net"));
|
|
96239
96239
|
var http3 = __importStar2(require("http"));
|
|
96240
96240
|
var https_1 = require("https");
|
|
96241
96241
|
__exportStar2(require_helpers2(), exports2);
|
|
@@ -96275,7 +96275,7 @@ var require_dist = __commonJS({
|
|
|
96275
96275
|
if (!this.sockets[name]) {
|
|
96276
96276
|
this.sockets[name] = [];
|
|
96277
96277
|
}
|
|
96278
|
-
const fakeSocket = new
|
|
96278
|
+
const fakeSocket = new net2.Socket({ writable: false });
|
|
96279
96279
|
this.sockets[name].push(fakeSocket);
|
|
96280
96280
|
this.totalSocketCount++;
|
|
96281
96281
|
return fakeSocket;
|
|
@@ -96487,7 +96487,7 @@ var require_dist2 = __commonJS({
|
|
|
96487
96487
|
};
|
|
96488
96488
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
96489
96489
|
exports2.HttpsProxyAgent = void 0;
|
|
96490
|
-
var
|
|
96490
|
+
var net2 = __importStar2(require("net"));
|
|
96491
96491
|
var tls = __importStar2(require("tls"));
|
|
96492
96492
|
var assert_1 = __importDefault2(require("assert"));
|
|
96493
96493
|
var debug_1 = __importDefault2(require_src2());
|
|
@@ -96496,7 +96496,7 @@ var require_dist2 = __commonJS({
|
|
|
96496
96496
|
var parse_proxy_response_1 = require_parse_proxy_response();
|
|
96497
96497
|
var debug = (0, debug_1.default)("https-proxy-agent");
|
|
96498
96498
|
var setServernameFromNonIpHost = (options) => {
|
|
96499
|
-
if (options.servername === void 0 && options.host && !
|
|
96499
|
+
if (options.servername === void 0 && options.host && !net2.isIP(options.host)) {
|
|
96500
96500
|
return {
|
|
96501
96501
|
...options,
|
|
96502
96502
|
servername: options.host
|
|
@@ -96536,10 +96536,10 @@ var require_dist2 = __commonJS({
|
|
|
96536
96536
|
socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
|
|
96537
96537
|
} else {
|
|
96538
96538
|
debug("Creating `net.Socket`: %o", this.connectOpts);
|
|
96539
|
-
socket =
|
|
96539
|
+
socket = net2.connect(this.connectOpts);
|
|
96540
96540
|
}
|
|
96541
96541
|
const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
|
|
96542
|
-
const host =
|
|
96542
|
+
const host = net2.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
|
|
96543
96543
|
let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r
|
|
96544
96544
|
`;
|
|
96545
96545
|
if (proxy.username || proxy.password) {
|
|
@@ -96572,7 +96572,7 @@ var require_dist2 = __commonJS({
|
|
|
96572
96572
|
return socket;
|
|
96573
96573
|
}
|
|
96574
96574
|
socket.destroy();
|
|
96575
|
-
const fakeSocket = new
|
|
96575
|
+
const fakeSocket = new net2.Socket({ writable: false });
|
|
96576
96576
|
fakeSocket.readable = true;
|
|
96577
96577
|
req.once("socket", (s7) => {
|
|
96578
96578
|
debug("Replaying proxy buffer for failed request");
|
|
@@ -96637,7 +96637,7 @@ var require_dist3 = __commonJS({
|
|
|
96637
96637
|
};
|
|
96638
96638
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
96639
96639
|
exports2.HttpProxyAgent = void 0;
|
|
96640
|
-
var
|
|
96640
|
+
var net2 = __importStar2(require("net"));
|
|
96641
96641
|
var tls = __importStar2(require("tls"));
|
|
96642
96642
|
var debug_1 = __importDefault2(require_src2());
|
|
96643
96643
|
var events_1 = require("events");
|
|
@@ -96710,7 +96710,7 @@ var require_dist3 = __commonJS({
|
|
|
96710
96710
|
socket = tls.connect(this.connectOpts);
|
|
96711
96711
|
} else {
|
|
96712
96712
|
debug("Creating `net.Socket`: %o", this.connectOpts);
|
|
96713
|
-
socket =
|
|
96713
|
+
socket = net2.connect(this.connectOpts);
|
|
96714
96714
|
}
|
|
96715
96715
|
await (0, events_1.once)(socket, "connect");
|
|
96716
96716
|
return socket;
|
|
@@ -135590,7 +135590,7 @@ var require_connection = __commonJS({
|
|
|
135590
135590
|
var _crypto = _interopRequireDefault(require("crypto"));
|
|
135591
135591
|
var _os = _interopRequireDefault(require("os"));
|
|
135592
135592
|
var tls = _interopRequireWildcard(require("tls"));
|
|
135593
|
-
var
|
|
135593
|
+
var net2 = _interopRequireWildcard(require("net"));
|
|
135594
135594
|
var _dns = _interopRequireDefault(require("dns"));
|
|
135595
135595
|
var _constants = _interopRequireDefault(require("constants"));
|
|
135596
135596
|
var _stream = require("stream");
|
|
@@ -136639,7 +136639,7 @@ var require_connection = __commonJS({
|
|
|
136639
136639
|
async wrapWithTls(socket, signal) {
|
|
136640
136640
|
signal.throwIfAborted();
|
|
136641
136641
|
const secureContext = tls.createSecureContext(this.secureContextOptions);
|
|
136642
|
-
const serverName = !
|
|
136642
|
+
const serverName = !net2.isIP(this.config.server) ? this.config.server : "";
|
|
136643
136643
|
const encryptOptions = {
|
|
136644
136644
|
host: this.config.server,
|
|
136645
136645
|
socket,
|
|
@@ -139561,10 +139561,11 @@ function parseMssqlUrl(url) {
|
|
|
139561
139561
|
}
|
|
139562
139562
|
};
|
|
139563
139563
|
}
|
|
139564
|
-
var normalisePGliteUrl, preparePostgresDB, prepareCockroach, prepareGelDB, parseSingleStoreCredentials, connectToSingleStore, parseMysqlCredentials, connectToMySQL, parseMssqlCredentials, connectToMsSQL, prepareSqliteParams, preparePGliteParams, connectToSQLite, connectToLibSQL;
|
|
139564
|
+
var import_net, ms, normalisePGliteUrl, preparePostgresDB, prepareCockroach, prepareGelDB, parseSingleStoreCredentials, connectToSingleStore, parseMysqlCredentials, connectToMySQL, parseMssqlCredentials, connectToMsSQL, prepareSqliteParams, preparePGliteParams, connectToSQLite, connectToLibSQL;
|
|
139565
139565
|
var init_connections = __esm({
|
|
139566
139566
|
"src/cli/connections.ts"() {
|
|
139567
139567
|
"use strict";
|
|
139568
|
+
import_net = __toESM(require("net"));
|
|
139568
139569
|
init_src();
|
|
139569
139570
|
init_wrapper();
|
|
139570
139571
|
init_utils();
|
|
@@ -139572,6 +139573,7 @@ var init_connections = __esm({
|
|
|
139572
139573
|
init_when_json_met_bigint();
|
|
139573
139574
|
init_utils3();
|
|
139574
139575
|
init_outputs();
|
|
139576
|
+
ms = (a6, b6) => Number(b6 - a6) / 1e6;
|
|
139575
139577
|
normalisePGliteUrl = (it) => {
|
|
139576
139578
|
if (it.startsWith("file:")) {
|
|
139577
139579
|
return it.substring(5);
|
|
@@ -139726,13 +139728,13 @@ var init_connections = __esm({
|
|
|
139726
139728
|
return pg.types.getTypeParser(typeId, format2);
|
|
139727
139729
|
}
|
|
139728
139730
|
};
|
|
139729
|
-
const
|
|
139730
|
-
const db = drizzle({ client });
|
|
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 });
|
|
139731
139733
|
const migrateFn = async (config) => {
|
|
139732
139734
|
return migrate(db, config);
|
|
139733
139735
|
};
|
|
139734
139736
|
const query = async (sql, params) => {
|
|
139735
|
-
const result2 = await
|
|
139737
|
+
const result2 = await pool.query({
|
|
139736
139738
|
text: sql,
|
|
139737
139739
|
values: params ?? [],
|
|
139738
139740
|
types: types3
|
|
@@ -139742,7 +139744,7 @@ var init_connections = __esm({
|
|
|
139742
139744
|
return result2.rows;
|
|
139743
139745
|
};
|
|
139744
139746
|
const proxy = async (params) => {
|
|
139745
|
-
const result2 = await
|
|
139747
|
+
const result2 = await pool.query({
|
|
139746
139748
|
text: params.sql,
|
|
139747
139749
|
values: params.params,
|
|
139748
139750
|
...params.mode === "array" && { rowMode: "array" },
|
|
@@ -139754,7 +139756,7 @@ var init_connections = __esm({
|
|
|
139754
139756
|
};
|
|
139755
139757
|
const transactionProxy = async (queries) => {
|
|
139756
139758
|
const results = [];
|
|
139757
|
-
const tx = await
|
|
139759
|
+
const tx = await pool.connect();
|
|
139758
139760
|
try {
|
|
139759
139761
|
await tx.query("BEGIN");
|
|
139760
139762
|
for (const query2 of queries) {
|
|
@@ -139773,7 +139775,117 @@ var init_connections = __esm({
|
|
|
139773
139775
|
}
|
|
139774
139776
|
return results;
|
|
139775
139777
|
};
|
|
139776
|
-
|
|
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
|
+
const rowDescriptionListener = (data) => {
|
|
139798
|
+
if (firstDataAt === 0n) {
|
|
139799
|
+
firstDataAt = process.hrtime.bigint();
|
|
139800
|
+
}
|
|
139801
|
+
bytesReceived += data.length;
|
|
139802
|
+
};
|
|
139803
|
+
const originalRowListener = client.connection.listeners("dataRow")[0];
|
|
139804
|
+
const wrappedRowListener = (data) => {
|
|
139805
|
+
rowCount += 1;
|
|
139806
|
+
const start = process.hrtime.bigint();
|
|
139807
|
+
lastDataAt = start;
|
|
139808
|
+
originalRowListener.apply(client.connection, [data]);
|
|
139809
|
+
const end2 = process.hrtime.bigint();
|
|
139810
|
+
lastRowParsedAt = end2;
|
|
139811
|
+
parseTime += ms(start, end2);
|
|
139812
|
+
bytesReceived += data.length;
|
|
139813
|
+
};
|
|
139814
|
+
client.connection.removeAllListeners("dataRow");
|
|
139815
|
+
client.connection.addListener("dataRow", wrappedRowListener);
|
|
139816
|
+
client.connection.prependListener("rowDescription", rowDescriptionListener);
|
|
139817
|
+
querySentAt = process.hrtime.bigint();
|
|
139818
|
+
await client.query({
|
|
139819
|
+
text: sql,
|
|
139820
|
+
values: params,
|
|
139821
|
+
types: types3
|
|
139822
|
+
});
|
|
139823
|
+
queryCompletedAt = process.hrtime.bigint();
|
|
139824
|
+
client.connection.removeListener("rowDescription", rowDescriptionListener);
|
|
139825
|
+
client.connection.removeAllListeners("dataRow");
|
|
139826
|
+
client.connection.addListener("dataRow", originalRowListener);
|
|
139827
|
+
let querySentTime = ms(querySentAt, firstDataAt) - executionTime - planningTime;
|
|
139828
|
+
if (querySentTime < 0) {
|
|
139829
|
+
const percent = 0.1;
|
|
139830
|
+
const overflow = -querySentTime;
|
|
139831
|
+
const keepForSent = overflow * percent;
|
|
139832
|
+
const adjustedOverflow = overflow * (1 + percent);
|
|
139833
|
+
const total2 = planningTime + executionTime;
|
|
139834
|
+
const ratioPlanning = planningTime / total2;
|
|
139835
|
+
const ratioExecution = executionTime / total2;
|
|
139836
|
+
planningTime -= adjustedOverflow * ratioPlanning;
|
|
139837
|
+
executionTime -= adjustedOverflow * ratioExecution;
|
|
139838
|
+
querySentTime = keepForSent;
|
|
139839
|
+
}
|
|
139840
|
+
const networkLatencyBefore = querySentTime / 2;
|
|
139841
|
+
const networkLatencyAfter = querySentTime / 2;
|
|
139842
|
+
const downloadTime = ms(firstDataAt, lastDataAt) - (rowCount > 1 ? parseTime - parseTime / rowCount : 0);
|
|
139843
|
+
const total = ms(querySentAt, queryCompletedAt);
|
|
139844
|
+
const calculatedTotal = networkLatencyBefore + planningTime + executionTime + networkLatencyAfter + downloadTime + parseTime + ms(lastRowParsedAt, queryCompletedAt);
|
|
139845
|
+
const errorMargin = Math.abs(total - calculatedTotal);
|
|
139846
|
+
return {
|
|
139847
|
+
networkLatencyBefore,
|
|
139848
|
+
planning: planningTime,
|
|
139849
|
+
execution: executionTime,
|
|
139850
|
+
networkLatencyAfter,
|
|
139851
|
+
dataDownload: downloadTime,
|
|
139852
|
+
dataParse: parseTime,
|
|
139853
|
+
total,
|
|
139854
|
+
errorMargin,
|
|
139855
|
+
dataSize: bytesReceived
|
|
139856
|
+
};
|
|
139857
|
+
};
|
|
139858
|
+
const benchmarkProxy = async ({ sql, params }, repeats) => {
|
|
139859
|
+
let startAt = 0n;
|
|
139860
|
+
let tcpConnectedAt = 0n;
|
|
139861
|
+
let tlsConnectedAt = null;
|
|
139862
|
+
let dbReadyAt = 0n;
|
|
139863
|
+
const client = "url" in credentials ? new pg.Client({ connectionString: credentials.url }) : new pg.Client({ ...credentials, ssl });
|
|
139864
|
+
client.connection.once("connect", () => {
|
|
139865
|
+
tcpConnectedAt = process.hrtime.bigint();
|
|
139866
|
+
});
|
|
139867
|
+
client.connection.prependOnceListener("sslconnect", () => {
|
|
139868
|
+
tlsConnectedAt = process.hrtime.bigint();
|
|
139869
|
+
});
|
|
139870
|
+
client.connection.prependOnceListener("readyForQuery", () => {
|
|
139871
|
+
dbReadyAt = process.hrtime.bigint();
|
|
139872
|
+
});
|
|
139873
|
+
startAt = process.hrtime.bigint();
|
|
139874
|
+
await client.connect();
|
|
139875
|
+
const results = [];
|
|
139876
|
+
for (let i7 = 0; i7 < repeats; i7++) {
|
|
139877
|
+
const r7 = await benchmarkQuery(client, sql, params);
|
|
139878
|
+
results.push(r7);
|
|
139879
|
+
}
|
|
139880
|
+
await client.end();
|
|
139881
|
+
return {
|
|
139882
|
+
tcpHandshake: ms(startAt, tcpConnectedAt),
|
|
139883
|
+
tlsHandshake: tlsConnectedAt ? ms(tcpConnectedAt, tlsConnectedAt) : null,
|
|
139884
|
+
dbHandshake: ms(tlsConnectedAt ?? tcpConnectedAt, dbReadyAt),
|
|
139885
|
+
queries: results
|
|
139886
|
+
};
|
|
139887
|
+
};
|
|
139888
|
+
return { packageName: "pg", query, proxy, transactionProxy, benchmarkProxy, migrate: migrateFn };
|
|
139777
139889
|
}
|
|
139778
139890
|
if (await checkPackage("postgres")) {
|
|
139779
139891
|
console.log(
|
|
@@ -140268,7 +140380,6 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
|
|
|
140268
140380
|
}
|
|
140269
140381
|
return next();
|
|
140270
140382
|
};
|
|
140271
|
-
await connection.connect();
|
|
140272
140383
|
const query = async (sql, params) => {
|
|
140273
140384
|
const res = await connection.execute({
|
|
140274
140385
|
sql,
|
|
@@ -140308,11 +140419,154 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
|
|
|
140308
140419
|
}
|
|
140309
140420
|
return results;
|
|
140310
140421
|
};
|
|
140422
|
+
const benchmarkQuery = async (newConnection, sql, params) => {
|
|
140423
|
+
const explainResult = await connection.query({
|
|
140424
|
+
sql: `EXPLAIN ANALYZE ${sql}`,
|
|
140425
|
+
values: params ?? [],
|
|
140426
|
+
typeCast
|
|
140427
|
+
});
|
|
140428
|
+
const stringifiedResult = JSON.stringify(explainResult[0]);
|
|
140429
|
+
const timeMatch = stringifiedResult.match(
|
|
140430
|
+
/actual time=([0-9.eE+-]+)\.\.([0-9.eE+-]+)/
|
|
140431
|
+
);
|
|
140432
|
+
const lastRowTime = Number(timeMatch[2]);
|
|
140433
|
+
let executionTime = lastRowTime;
|
|
140434
|
+
let querySentAt = 0n;
|
|
140435
|
+
let firstDataAt = 0n;
|
|
140436
|
+
let lastDataAt = 0n;
|
|
140437
|
+
let lastRowParsedAt = 0n;
|
|
140438
|
+
let queryCompletedAt = 0n;
|
|
140439
|
+
let bytesReceived = 0;
|
|
140440
|
+
let rowCount = 0;
|
|
140441
|
+
let parseTime = 0;
|
|
140442
|
+
querySentAt = process.hrtime.bigint();
|
|
140443
|
+
await new Promise((resolve2, reject) => {
|
|
140444
|
+
const query2 = newConnection.query({
|
|
140445
|
+
sql,
|
|
140446
|
+
values: params ?? [],
|
|
140447
|
+
typeCast
|
|
140448
|
+
});
|
|
140449
|
+
const originalRowHandler = query2.row;
|
|
140450
|
+
let packets = 0;
|
|
140451
|
+
const wrappedRowListener = (packet, connection2) => {
|
|
140452
|
+
packets += 1;
|
|
140453
|
+
if (firstDataAt === 0n) {
|
|
140454
|
+
firstDataAt = process.hrtime.bigint();
|
|
140455
|
+
bytesReceived += packet.start;
|
|
140456
|
+
}
|
|
140457
|
+
const start = process.hrtime.bigint();
|
|
140458
|
+
lastDataAt = start;
|
|
140459
|
+
const res = originalRowHandler.apply(query2, [packet, connection2]);
|
|
140460
|
+
const end2 = process.hrtime.bigint();
|
|
140461
|
+
lastRowParsedAt = end2;
|
|
140462
|
+
parseTime += ms(start, end2);
|
|
140463
|
+
bytesReceived += packet.length();
|
|
140464
|
+
if (!res || packet.isEOF()) {
|
|
140465
|
+
return res;
|
|
140466
|
+
}
|
|
140467
|
+
return wrappedRowListener;
|
|
140468
|
+
};
|
|
140469
|
+
query2.row = wrappedRowListener;
|
|
140470
|
+
query2.on("result", () => {
|
|
140471
|
+
rowCount += 1;
|
|
140472
|
+
});
|
|
140473
|
+
query2.on("error", (err2) => {
|
|
140474
|
+
reject(err2);
|
|
140475
|
+
});
|
|
140476
|
+
query2.on("end", () => {
|
|
140477
|
+
resolve2();
|
|
140478
|
+
});
|
|
140479
|
+
});
|
|
140480
|
+
queryCompletedAt = process.hrtime.bigint();
|
|
140481
|
+
let querySentTime = ms(querySentAt, firstDataAt) - executionTime;
|
|
140482
|
+
if (querySentTime < 0) {
|
|
140483
|
+
const percent = 0.1;
|
|
140484
|
+
const overflow = -querySentTime;
|
|
140485
|
+
const keepForSent = overflow * percent;
|
|
140486
|
+
const adjustedOverflow = overflow * (1 + percent);
|
|
140487
|
+
const total2 = executionTime;
|
|
140488
|
+
const ratioExecution = executionTime / total2;
|
|
140489
|
+
executionTime -= adjustedOverflow * ratioExecution;
|
|
140490
|
+
querySentTime = keepForSent;
|
|
140491
|
+
}
|
|
140492
|
+
const networkLatencyBefore = querySentTime / 2;
|
|
140493
|
+
const networkLatencyAfter = querySentTime / 2;
|
|
140494
|
+
const downloadTime = ms(firstDataAt, lastDataAt) - (rowCount > 1 ? parseTime - parseTime / rowCount : 0);
|
|
140495
|
+
const total = ms(querySentAt, queryCompletedAt);
|
|
140496
|
+
const calculatedTotal = networkLatencyBefore + executionTime + networkLatencyAfter + downloadTime + parseTime + ms(lastRowParsedAt, queryCompletedAt);
|
|
140497
|
+
const errorMargin = Math.abs(total - calculatedTotal);
|
|
140498
|
+
return {
|
|
140499
|
+
networkLatencyBefore,
|
|
140500
|
+
planning: null,
|
|
140501
|
+
execution: executionTime,
|
|
140502
|
+
networkLatencyAfter,
|
|
140503
|
+
dataDownload: downloadTime,
|
|
140504
|
+
dataParse: parseTime,
|
|
140505
|
+
total,
|
|
140506
|
+
errorMargin,
|
|
140507
|
+
dataSize: bytesReceived
|
|
140508
|
+
};
|
|
140509
|
+
};
|
|
140510
|
+
const benchmarkProxy = async ({ sql, params }, repeats) => {
|
|
140511
|
+
const { createConnection: createConnection2 } = require("mysql2");
|
|
140512
|
+
let startAt = 0n;
|
|
140513
|
+
let tcpConnectedAt = 0n;
|
|
140514
|
+
let tlsConnectedAt = null;
|
|
140515
|
+
const createStream = ({ config }) => {
|
|
140516
|
+
let stream;
|
|
140517
|
+
if (config.socketPath) {
|
|
140518
|
+
stream = import_net.default.connect(config.socketPath);
|
|
140519
|
+
} else {
|
|
140520
|
+
stream = import_net.default.connect(config.port, config.host);
|
|
140521
|
+
}
|
|
140522
|
+
if (config.enableKeepAlive) {
|
|
140523
|
+
stream.on("connect", () => {
|
|
140524
|
+
stream.setKeepAlive(true, config.keepAliveInitialDelay);
|
|
140525
|
+
});
|
|
140526
|
+
}
|
|
140527
|
+
stream.setNoDelay(true);
|
|
140528
|
+
stream.once("connect", () => {
|
|
140529
|
+
tcpConnectedAt = process.hrtime.bigint();
|
|
140530
|
+
});
|
|
140531
|
+
return stream;
|
|
140532
|
+
};
|
|
140533
|
+
startAt = process.hrtime.bigint();
|
|
140534
|
+
const connection2 = result2.url ? createConnection2({
|
|
140535
|
+
uri: result2.url,
|
|
140536
|
+
stream: createStream
|
|
140537
|
+
}) : createConnection2({
|
|
140538
|
+
...result2.credentials,
|
|
140539
|
+
stream: createStream
|
|
140540
|
+
});
|
|
140541
|
+
await new Promise((resolve2, reject) => {
|
|
140542
|
+
connection2.connect((err2) => {
|
|
140543
|
+
tlsConnectedAt = process.hrtime.bigint();
|
|
140544
|
+
if (err2) {
|
|
140545
|
+
reject(err2);
|
|
140546
|
+
} else {
|
|
140547
|
+
resolve2();
|
|
140548
|
+
}
|
|
140549
|
+
});
|
|
140550
|
+
});
|
|
140551
|
+
const results = [];
|
|
140552
|
+
for (let i7 = 0; i7 < repeats; i7++) {
|
|
140553
|
+
const r7 = await benchmarkQuery(connection2, sql, params);
|
|
140554
|
+
results.push(r7);
|
|
140555
|
+
}
|
|
140556
|
+
connection2.end();
|
|
140557
|
+
return {
|
|
140558
|
+
tcpHandshake: ms(startAt, tcpConnectedAt),
|
|
140559
|
+
tlsHandshake: tlsConnectedAt ? ms(tcpConnectedAt, tlsConnectedAt) : null,
|
|
140560
|
+
dbHandshake: null,
|
|
140561
|
+
queries: results
|
|
140562
|
+
};
|
|
140563
|
+
};
|
|
140311
140564
|
return {
|
|
140312
140565
|
db: { query },
|
|
140313
140566
|
packageName: "mysql2",
|
|
140314
140567
|
proxy,
|
|
140315
140568
|
transactionProxy,
|
|
140569
|
+
benchmarkProxy,
|
|
140316
140570
|
database: result2.database,
|
|
140317
140571
|
migrate: migrateFn
|
|
140318
140572
|
};
|
|
@@ -140955,7 +141209,7 @@ __export(studio_exports, {
|
|
|
140955
141209
|
prepareServer: () => prepareServer,
|
|
140956
141210
|
prepareSingleStoreSchema: () => prepareSingleStoreSchema
|
|
140957
141211
|
});
|
|
140958
|
-
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, defaultsSchema, schema5, jsonStringify, prepareServer;
|
|
141212
|
+
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;
|
|
140959
141213
|
var init_studio = __esm({
|
|
140960
141214
|
"src/cli/commands/studio.ts"() {
|
|
140961
141215
|
"use strict";
|
|
@@ -141179,6 +141433,7 @@ var init_studio = __esm({
|
|
|
141179
141433
|
packageName: db.packageName,
|
|
141180
141434
|
proxy: db.proxy,
|
|
141181
141435
|
transactionProxy: db.transactionProxy,
|
|
141436
|
+
benchmarkProxy: db.benchmarkProxy,
|
|
141182
141437
|
customDefaults,
|
|
141183
141438
|
schema: pgSchema2,
|
|
141184
141439
|
relations,
|
|
@@ -141188,7 +141443,7 @@ var init_studio = __esm({
|
|
|
141188
141443
|
};
|
|
141189
141444
|
drizzleForMySQL = async (credentials, mysqlSchema, relations, schemaFiles, casing2) => {
|
|
141190
141445
|
const { connectToMySQL: connectToMySQL2 } = await Promise.resolve().then(() => (init_connections(), connections_exports));
|
|
141191
|
-
const { proxy, transactionProxy, database, packageName } = await connectToMySQL2(credentials);
|
|
141446
|
+
const { proxy, transactionProxy, benchmarkProxy, database, packageName } = await connectToMySQL2(credentials);
|
|
141192
141447
|
const customDefaults = getCustomDefaults(mysqlSchema, casing2);
|
|
141193
141448
|
let dbUrl;
|
|
141194
141449
|
if ("url" in credentials) {
|
|
@@ -141204,6 +141459,7 @@ var init_studio = __esm({
|
|
|
141204
141459
|
databaseName: database,
|
|
141205
141460
|
proxy,
|
|
141206
141461
|
transactionProxy,
|
|
141462
|
+
benchmarkProxy,
|
|
141207
141463
|
customDefaults,
|
|
141208
141464
|
schema: mysqlSchema,
|
|
141209
141465
|
relations,
|
|
@@ -141373,6 +141629,23 @@ var init_studio = __esm({
|
|
|
141373
141629
|
]).optional()
|
|
141374
141630
|
}).array()
|
|
141375
141631
|
});
|
|
141632
|
+
benchmarkProxySchema = external_exports.object({
|
|
141633
|
+
type: external_exports.literal("bproxy"),
|
|
141634
|
+
data: external_exports.object({
|
|
141635
|
+
query: external_exports.object({
|
|
141636
|
+
sql: external_exports.string(),
|
|
141637
|
+
params: external_exports.array(external_exports.any()).optional(),
|
|
141638
|
+
method: external_exports.union([
|
|
141639
|
+
external_exports.literal("values"),
|
|
141640
|
+
external_exports.literal("get"),
|
|
141641
|
+
external_exports.literal("all"),
|
|
141642
|
+
external_exports.literal("run"),
|
|
141643
|
+
external_exports.literal("execute")
|
|
141644
|
+
]).optional()
|
|
141645
|
+
}),
|
|
141646
|
+
repeats: external_exports.number().min(1).optional()
|
|
141647
|
+
})
|
|
141648
|
+
});
|
|
141376
141649
|
defaultsSchema = external_exports.object({
|
|
141377
141650
|
type: external_exports.literal("defaults"),
|
|
141378
141651
|
data: external_exports.array(
|
|
@@ -141387,6 +141660,7 @@ var init_studio = __esm({
|
|
|
141387
141660
|
init2,
|
|
141388
141661
|
proxySchema,
|
|
141389
141662
|
transactionProxySchema,
|
|
141663
|
+
benchmarkProxySchema,
|
|
141390
141664
|
defaultsSchema
|
|
141391
141665
|
]);
|
|
141392
141666
|
jsonStringify = (data) => {
|
|
@@ -141409,6 +141683,7 @@ var init_studio = __esm({
|
|
|
141409
141683
|
databaseName,
|
|
141410
141684
|
proxy,
|
|
141411
141685
|
transactionProxy,
|
|
141686
|
+
benchmarkProxy,
|
|
141412
141687
|
customDefaults,
|
|
141413
141688
|
schema: drizzleSchema,
|
|
141414
141689
|
relations,
|
|
@@ -141472,7 +141747,7 @@ var init_studio = __esm({
|
|
|
141472
141747
|
console.warn("Error message:", error3.message);
|
|
141473
141748
|
}
|
|
141474
141749
|
return c6.json({
|
|
141475
|
-
version: "6.
|
|
141750
|
+
version: "6.3",
|
|
141476
141751
|
dialect: dialect6,
|
|
141477
141752
|
driver: driver2,
|
|
141478
141753
|
packageName,
|
|
@@ -141510,6 +141785,21 @@ var init_studio = __esm({
|
|
|
141510
141785
|
}
|
|
141511
141786
|
);
|
|
141512
141787
|
}
|
|
141788
|
+
if (type === "bproxy") {
|
|
141789
|
+
if (!benchmarkProxy) {
|
|
141790
|
+
throw new Error("Benchmark proxy is not configured for this database.");
|
|
141791
|
+
}
|
|
141792
|
+
const result2 = await benchmarkProxy(body.data.query, body.data.repeats || 1);
|
|
141793
|
+
const res = jsonStringify(result2);
|
|
141794
|
+
return c6.body(
|
|
141795
|
+
res,
|
|
141796
|
+
{
|
|
141797
|
+
headers: {
|
|
141798
|
+
"Content-Type": "application/json"
|
|
141799
|
+
}
|
|
141800
|
+
}
|
|
141801
|
+
);
|
|
141802
|
+
}
|
|
141513
141803
|
if (type === "defaults") {
|
|
141514
141804
|
const columns = body.data;
|
|
141515
141805
|
const result2 = columns.map((column7) => {
|