drizzle-kit 1.0.0-beta.2-7745ed5 → 1.0.0-beta.2-0f52822
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 +362 -68
- package/api-mysql.mjs +362 -68
- package/api-postgres.js +364 -70
- package/api-postgres.mjs +364 -70
- package/api-sqlite.js +362 -68
- package/api-sqlite.mjs +362 -68
- package/bin.cjs +364 -70
- package/package.json +1 -1
package/api-postgres.js
CHANGED
|
@@ -34395,7 +34395,7 @@ var require_websocket = __commonJS({
|
|
|
34395
34395
|
var EventEmitter = require("events");
|
|
34396
34396
|
var https2 = require("https");
|
|
34397
34397
|
var http3 = require("http");
|
|
34398
|
-
var
|
|
34398
|
+
var net2 = require("net");
|
|
34399
34399
|
var tls = require("tls");
|
|
34400
34400
|
var { randomBytes, createHash: createHash5 } = require("crypto");
|
|
34401
34401
|
var { Duplex, Readable: Readable6 } = require("stream");
|
|
@@ -35126,12 +35126,12 @@ var require_websocket = __commonJS({
|
|
|
35126
35126
|
}
|
|
35127
35127
|
function netConnect(options) {
|
|
35128
35128
|
options.path = options.socketPath;
|
|
35129
|
-
return
|
|
35129
|
+
return net2.connect(options);
|
|
35130
35130
|
}
|
|
35131
35131
|
function tlsConnect(options) {
|
|
35132
35132
|
options.path = void 0;
|
|
35133
35133
|
if (!options.servername && options.servername !== "") {
|
|
35134
|
-
options.servername =
|
|
35134
|
+
options.servername = net2.isIP(options.host) ? "" : options.host;
|
|
35135
35135
|
}
|
|
35136
35136
|
return tls.connect(options);
|
|
35137
35137
|
}
|
|
@@ -39450,7 +39450,7 @@ var init_timing = __esm({
|
|
|
39450
39450
|
"../node_modules/.pnpm/@smithy+node-http-handler@4.4.5/node_modules/@smithy/node-http-handler/dist-es/timing.js"() {
|
|
39451
39451
|
"use strict";
|
|
39452
39452
|
timing = {
|
|
39453
|
-
setTimeout: (cb,
|
|
39453
|
+
setTimeout: (cb, ms2) => setTimeout(cb, ms2),
|
|
39454
39454
|
clearTimeout: (timeoutId) => clearTimeout(timeoutId)
|
|
39455
39455
|
};
|
|
39456
39456
|
}
|
|
@@ -41338,13 +41338,13 @@ var init_schema_date_utils = __esm({
|
|
|
41338
41338
|
if (!matches) {
|
|
41339
41339
|
throw new TypeError(`Invalid RFC3339 timestamp format ${value}`);
|
|
41340
41340
|
}
|
|
41341
|
-
const [, yearStr, monthStr, dayStr, hours, minutes, seconds, ,
|
|
41341
|
+
const [, yearStr, monthStr, dayStr, hours, minutes, seconds, , ms2, offsetStr] = matches;
|
|
41342
41342
|
range(monthStr, 1, 12);
|
|
41343
41343
|
range(dayStr, 1, 31);
|
|
41344
41344
|
range(hours, 0, 23);
|
|
41345
41345
|
range(minutes, 0, 59);
|
|
41346
41346
|
range(seconds, 0, 60);
|
|
41347
|
-
const date2 = new Date(Date.UTC(Number(yearStr), Number(monthStr) - 1, Number(dayStr), Number(hours), Number(minutes), Number(seconds), Number(
|
|
41347
|
+
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));
|
|
41348
41348
|
date2.setUTCFullYear(Number(yearStr));
|
|
41349
41349
|
if (offsetStr.toUpperCase() != "Z") {
|
|
41350
41350
|
const [, sign2, offsetH, offsetM] = /([+-])(\d\d):(\d\d)/.exec(offsetStr) || [void 0, "+", 0, 0];
|
|
@@ -61358,8 +61358,8 @@ var require_datetime2 = __commonJS({
|
|
|
61358
61358
|
if (!(object instanceof Date)) {
|
|
61359
61359
|
throw new errors_1.InvalidArgumentError(`a Date instance was expected, got "${object}"`);
|
|
61360
61360
|
}
|
|
61361
|
-
const
|
|
61362
|
-
const us =
|
|
61361
|
+
const ms2 = object.getTime() - TIMESHIFT;
|
|
61362
|
+
const us = ms2 * 1e3;
|
|
61363
61363
|
buf.writeInt32(8);
|
|
61364
61364
|
buf.writeInt64(us);
|
|
61365
61365
|
}
|
|
@@ -61369,12 +61369,12 @@ var require_datetime2 = __commonJS({
|
|
|
61369
61369
|
return ctx.postDecode(this, us2 + BI_TIMESHIFT_US);
|
|
61370
61370
|
}
|
|
61371
61371
|
const us = Number(buf.readBigInt64());
|
|
61372
|
-
let
|
|
61373
|
-
if (Math.abs(us % 1e3) === 500 && Math.abs(
|
|
61374
|
-
|
|
61372
|
+
let ms2 = Math.round(us / 1e3);
|
|
61373
|
+
if (Math.abs(us % 1e3) === 500 && Math.abs(ms2) % 2 === 1) {
|
|
61374
|
+
ms2 -= 1;
|
|
61375
61375
|
}
|
|
61376
|
-
|
|
61377
|
-
return new Date(
|
|
61376
|
+
ms2 += TIMESHIFT;
|
|
61377
|
+
return new Date(ms2);
|
|
61378
61378
|
}
|
|
61379
61379
|
};
|
|
61380
61380
|
exports2.DateTimeCodec = DateTimeCodec;
|
|
@@ -61395,8 +61395,8 @@ var require_datetime2 = __commonJS({
|
|
|
61395
61395
|
if (!(object instanceof datetime_1.LocalDateTime)) {
|
|
61396
61396
|
throw new errors_1.InvalidArgumentError(`a LocalDateTime instance was expected, got "${object}"`);
|
|
61397
61397
|
}
|
|
61398
|
-
const
|
|
61399
|
-
let us =
|
|
61398
|
+
const ms2 = BigInt(datetime_1.localDateInstances.get(object).getTime() - TIMESHIFT);
|
|
61399
|
+
let us = ms2 * 1000n + BigInt(object.hour * 36e8 + object.minute * 6e7 + object.second * 1e6 + object.millisecond * 1e3 + object.microsecond);
|
|
61400
61400
|
if (object.nanosecond === 500 && Math.abs(object.microsecond) % 2 === 1 || object.nanosecond > 500) {
|
|
61401
61401
|
us += 1n;
|
|
61402
61402
|
}
|
|
@@ -61410,13 +61410,13 @@ var require_datetime2 = __commonJS({
|
|
|
61410
61410
|
}
|
|
61411
61411
|
const bi_ms = bi_us / 1000n;
|
|
61412
61412
|
let us = Number(bi_us - bi_ms * 1000n);
|
|
61413
|
-
let
|
|
61413
|
+
let ms2 = Number(bi_ms);
|
|
61414
61414
|
if (us < 0) {
|
|
61415
61415
|
us += 1e3;
|
|
61416
|
-
|
|
61416
|
+
ms2 -= 1;
|
|
61417
61417
|
}
|
|
61418
|
-
|
|
61419
|
-
const date2 = new Date(
|
|
61418
|
+
ms2 += TIMESHIFT;
|
|
61419
|
+
const date2 = new Date(ms2);
|
|
61420
61420
|
return new datetime_1.LocalDateTime(date2.getUTCFullYear(), date2.getUTCMonth() + 1, date2.getUTCDate(), date2.getUTCHours(), date2.getUTCMinutes(), date2.getUTCSeconds(), date2.getUTCMilliseconds(), us);
|
|
61421
61421
|
}
|
|
61422
61422
|
};
|
|
@@ -61478,13 +61478,13 @@ var require_datetime2 = __commonJS({
|
|
|
61478
61478
|
}
|
|
61479
61479
|
let us = Number(bius);
|
|
61480
61480
|
let seconds = Math.floor(us / 1e6);
|
|
61481
|
-
const
|
|
61482
|
-
us = us % 1e6 -
|
|
61481
|
+
const ms2 = Math.floor(us % 1e6 / 1e3);
|
|
61482
|
+
us = us % 1e6 - ms2 * 1e3;
|
|
61483
61483
|
let minutes = Math.floor(seconds / 60);
|
|
61484
61484
|
seconds = Math.floor(seconds % 60);
|
|
61485
61485
|
const hours = Math.floor(minutes / 60);
|
|
61486
61486
|
minutes = Math.floor(minutes % 60);
|
|
61487
|
-
return new datetime_1.LocalTime(hours, minutes, seconds,
|
|
61487
|
+
return new datetime_1.LocalTime(hours, minutes, seconds, ms2, us);
|
|
61488
61488
|
}
|
|
61489
61489
|
};
|
|
61490
61490
|
exports2.LocalTimeCodec = LocalTimeCodec;
|
|
@@ -61561,14 +61561,14 @@ var require_datetime2 = __commonJS({
|
|
|
61561
61561
|
const biMillion = 1000000n;
|
|
61562
61562
|
const biSeconds = bius / biMillion;
|
|
61563
61563
|
let us = Number(bius - biSeconds * biMillion);
|
|
61564
|
-
const
|
|
61564
|
+
const ms2 = Math.floor(us / 1e3);
|
|
61565
61565
|
us = us % 1e3;
|
|
61566
61566
|
let seconds = Number(biSeconds);
|
|
61567
61567
|
let minutes = Math.floor(seconds / 60);
|
|
61568
61568
|
seconds = Math.floor(seconds % 60);
|
|
61569
61569
|
const hours = Math.floor(minutes / 60);
|
|
61570
61570
|
minutes = Math.floor(minutes % 60);
|
|
61571
|
-
return new datetime_1.Duration(0, 0, 0, 0, hours * sign2, minutes * sign2, seconds * sign2,
|
|
61571
|
+
return new datetime_1.Duration(0, 0, 0, 0, hours * sign2, minutes * sign2, seconds * sign2, ms2 * sign2, us * sign2);
|
|
61572
61572
|
}
|
|
61573
61573
|
};
|
|
61574
61574
|
exports2.DurationCodec = DurationCodec;
|
|
@@ -61614,7 +61614,7 @@ var require_datetime2 = __commonJS({
|
|
|
61614
61614
|
const million = BigInt(1e6);
|
|
61615
61615
|
const biSeconds = bius / million;
|
|
61616
61616
|
let us = Number(bius - biSeconds * million);
|
|
61617
|
-
const
|
|
61617
|
+
const ms2 = Math.trunc(us / 1e3);
|
|
61618
61618
|
us = us % 1e3;
|
|
61619
61619
|
let seconds = Number(biSeconds);
|
|
61620
61620
|
let minutes = Math.trunc(seconds / 60);
|
|
@@ -61625,7 +61625,7 @@ var require_datetime2 = __commonJS({
|
|
|
61625
61625
|
days = Math.trunc(days % 7);
|
|
61626
61626
|
const years = Math.trunc(months2 / 12);
|
|
61627
61627
|
months2 = Math.trunc(months2 % 12);
|
|
61628
|
-
return new datetime_1.RelativeDuration(years, months2, weeks, days, hours * sign2, minutes * sign2, seconds * sign2,
|
|
61628
|
+
return new datetime_1.RelativeDuration(years, months2, weeks, days, hours * sign2, minutes * sign2, seconds * sign2, ms2 * sign2, us * sign2);
|
|
61629
61629
|
}
|
|
61630
61630
|
};
|
|
61631
61631
|
exports2.RelativeDurationCodec = RelativeDurationCodec;
|
|
@@ -71789,41 +71789,41 @@ var require_ms = __commonJS({
|
|
|
71789
71789
|
return void 0;
|
|
71790
71790
|
}
|
|
71791
71791
|
}
|
|
71792
|
-
function fmtShort(
|
|
71793
|
-
var msAbs = Math.abs(
|
|
71792
|
+
function fmtShort(ms2) {
|
|
71793
|
+
var msAbs = Math.abs(ms2);
|
|
71794
71794
|
if (msAbs >= d6) {
|
|
71795
|
-
return Math.round(
|
|
71795
|
+
return Math.round(ms2 / d6) + "d";
|
|
71796
71796
|
}
|
|
71797
71797
|
if (msAbs >= h7) {
|
|
71798
|
-
return Math.round(
|
|
71798
|
+
return Math.round(ms2 / h7) + "h";
|
|
71799
71799
|
}
|
|
71800
71800
|
if (msAbs >= m7) {
|
|
71801
|
-
return Math.round(
|
|
71801
|
+
return Math.round(ms2 / m7) + "m";
|
|
71802
71802
|
}
|
|
71803
71803
|
if (msAbs >= s7) {
|
|
71804
|
-
return Math.round(
|
|
71804
|
+
return Math.round(ms2 / s7) + "s";
|
|
71805
71805
|
}
|
|
71806
|
-
return
|
|
71806
|
+
return ms2 + "ms";
|
|
71807
71807
|
}
|
|
71808
|
-
function fmtLong(
|
|
71809
|
-
var msAbs = Math.abs(
|
|
71808
|
+
function fmtLong(ms2) {
|
|
71809
|
+
var msAbs = Math.abs(ms2);
|
|
71810
71810
|
if (msAbs >= d6) {
|
|
71811
|
-
return plural2(
|
|
71811
|
+
return plural2(ms2, msAbs, d6, "day");
|
|
71812
71812
|
}
|
|
71813
71813
|
if (msAbs >= h7) {
|
|
71814
|
-
return plural2(
|
|
71814
|
+
return plural2(ms2, msAbs, h7, "hour");
|
|
71815
71815
|
}
|
|
71816
71816
|
if (msAbs >= m7) {
|
|
71817
|
-
return plural2(
|
|
71817
|
+
return plural2(ms2, msAbs, m7, "minute");
|
|
71818
71818
|
}
|
|
71819
71819
|
if (msAbs >= s7) {
|
|
71820
|
-
return plural2(
|
|
71820
|
+
return plural2(ms2, msAbs, s7, "second");
|
|
71821
71821
|
}
|
|
71822
|
-
return
|
|
71822
|
+
return ms2 + " ms";
|
|
71823
71823
|
}
|
|
71824
|
-
function plural2(
|
|
71824
|
+
function plural2(ms2, msAbs, n6, name) {
|
|
71825
71825
|
var isPlural = msAbs >= n6 * 1.5;
|
|
71826
|
-
return Math.round(
|
|
71826
|
+
return Math.round(ms2 / n6) + " " + name + (isPlural ? "s" : "");
|
|
71827
71827
|
}
|
|
71828
71828
|
}
|
|
71829
71829
|
});
|
|
@@ -71867,8 +71867,8 @@ var require_common2 = __commonJS({
|
|
|
71867
71867
|
}
|
|
71868
71868
|
const self2 = debug;
|
|
71869
71869
|
const curr = Number(/* @__PURE__ */ new Date());
|
|
71870
|
-
const
|
|
71871
|
-
self2.diff =
|
|
71870
|
+
const ms2 = curr - (prevTime || curr);
|
|
71871
|
+
self2.diff = ms2;
|
|
71872
71872
|
self2.prev = prevTime;
|
|
71873
71873
|
self2.curr = curr;
|
|
71874
71874
|
prevTime = curr;
|
|
@@ -87371,11 +87371,11 @@ var require_TokenExpiredError = __commonJS({
|
|
|
87371
87371
|
var require_timespan = __commonJS({
|
|
87372
87372
|
"../node_modules/.pnpm/jsonwebtoken@9.0.2/node_modules/jsonwebtoken/lib/timespan.js"(exports2, module2) {
|
|
87373
87373
|
"use strict";
|
|
87374
|
-
var
|
|
87374
|
+
var ms2 = require_ms();
|
|
87375
87375
|
module2.exports = function(time2, iat) {
|
|
87376
87376
|
var timestamp = iat || Math.floor(Date.now() / 1e3);
|
|
87377
87377
|
if (typeof time2 === "string") {
|
|
87378
|
-
var milliseconds =
|
|
87378
|
+
var milliseconds = ms2(time2);
|
|
87379
87379
|
if (typeof milliseconds === "undefined") {
|
|
87380
87380
|
return;
|
|
87381
87381
|
}
|
|
@@ -101913,7 +101913,7 @@ var require_dist = __commonJS({
|
|
|
101913
101913
|
};
|
|
101914
101914
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
101915
101915
|
exports2.Agent = void 0;
|
|
101916
|
-
var
|
|
101916
|
+
var net2 = __importStar2(require("net"));
|
|
101917
101917
|
var http3 = __importStar2(require("http"));
|
|
101918
101918
|
var https_1 = require("https");
|
|
101919
101919
|
__exportStar2(require_helpers2(), exports2);
|
|
@@ -101953,7 +101953,7 @@ var require_dist = __commonJS({
|
|
|
101953
101953
|
if (!this.sockets[name]) {
|
|
101954
101954
|
this.sockets[name] = [];
|
|
101955
101955
|
}
|
|
101956
|
-
const fakeSocket = new
|
|
101956
|
+
const fakeSocket = new net2.Socket({ writable: false });
|
|
101957
101957
|
this.sockets[name].push(fakeSocket);
|
|
101958
101958
|
this.totalSocketCount++;
|
|
101959
101959
|
return fakeSocket;
|
|
@@ -102165,7 +102165,7 @@ var require_dist2 = __commonJS({
|
|
|
102165
102165
|
};
|
|
102166
102166
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
102167
102167
|
exports2.HttpsProxyAgent = void 0;
|
|
102168
|
-
var
|
|
102168
|
+
var net2 = __importStar2(require("net"));
|
|
102169
102169
|
var tls = __importStar2(require("tls"));
|
|
102170
102170
|
var assert_1 = __importDefault2(require("assert"));
|
|
102171
102171
|
var debug_1 = __importDefault2(require_src2());
|
|
@@ -102174,7 +102174,7 @@ var require_dist2 = __commonJS({
|
|
|
102174
102174
|
var parse_proxy_response_1 = require_parse_proxy_response();
|
|
102175
102175
|
var debug = (0, debug_1.default)("https-proxy-agent");
|
|
102176
102176
|
var setServernameFromNonIpHost = (options) => {
|
|
102177
|
-
if (options.servername === void 0 && options.host && !
|
|
102177
|
+
if (options.servername === void 0 && options.host && !net2.isIP(options.host)) {
|
|
102178
102178
|
return {
|
|
102179
102179
|
...options,
|
|
102180
102180
|
servername: options.host
|
|
@@ -102214,10 +102214,10 @@ var require_dist2 = __commonJS({
|
|
|
102214
102214
|
socket = tls.connect(setServernameFromNonIpHost(this.connectOpts));
|
|
102215
102215
|
} else {
|
|
102216
102216
|
debug("Creating `net.Socket`: %o", this.connectOpts);
|
|
102217
|
-
socket =
|
|
102217
|
+
socket = net2.connect(this.connectOpts);
|
|
102218
102218
|
}
|
|
102219
102219
|
const headers = typeof this.proxyHeaders === "function" ? this.proxyHeaders() : { ...this.proxyHeaders };
|
|
102220
|
-
const host =
|
|
102220
|
+
const host = net2.isIPv6(opts.host) ? `[${opts.host}]` : opts.host;
|
|
102221
102221
|
let payload = `CONNECT ${host}:${opts.port} HTTP/1.1\r
|
|
102222
102222
|
`;
|
|
102223
102223
|
if (proxy.username || proxy.password) {
|
|
@@ -102250,7 +102250,7 @@ var require_dist2 = __commonJS({
|
|
|
102250
102250
|
return socket;
|
|
102251
102251
|
}
|
|
102252
102252
|
socket.destroy();
|
|
102253
|
-
const fakeSocket = new
|
|
102253
|
+
const fakeSocket = new net2.Socket({ writable: false });
|
|
102254
102254
|
fakeSocket.readable = true;
|
|
102255
102255
|
req.once("socket", (s7) => {
|
|
102256
102256
|
debug("Replaying proxy buffer for failed request");
|
|
@@ -102315,7 +102315,7 @@ var require_dist3 = __commonJS({
|
|
|
102315
102315
|
};
|
|
102316
102316
|
Object.defineProperty(exports2, "__esModule", { value: true });
|
|
102317
102317
|
exports2.HttpProxyAgent = void 0;
|
|
102318
|
-
var
|
|
102318
|
+
var net2 = __importStar2(require("net"));
|
|
102319
102319
|
var tls = __importStar2(require("tls"));
|
|
102320
102320
|
var debug_1 = __importDefault2(require_src2());
|
|
102321
102321
|
var events_1 = require("events");
|
|
@@ -102388,7 +102388,7 @@ var require_dist3 = __commonJS({
|
|
|
102388
102388
|
socket = tls.connect(this.connectOpts);
|
|
102389
102389
|
} else {
|
|
102390
102390
|
debug("Creating `net.Socket`: %o", this.connectOpts);
|
|
102391
|
-
socket =
|
|
102391
|
+
socket = net2.connect(this.connectOpts);
|
|
102392
102392
|
}
|
|
102393
102393
|
await (0, events_1.once)(socket, "connect");
|
|
102394
102394
|
return socket;
|
|
@@ -141268,7 +141268,7 @@ var require_connection = __commonJS({
|
|
|
141268
141268
|
var _crypto = _interopRequireDefault(require("crypto"));
|
|
141269
141269
|
var _os = _interopRequireDefault(require("os"));
|
|
141270
141270
|
var tls = _interopRequireWildcard(require("tls"));
|
|
141271
|
-
var
|
|
141271
|
+
var net2 = _interopRequireWildcard(require("net"));
|
|
141272
141272
|
var _dns = _interopRequireDefault(require("dns"));
|
|
141273
141273
|
var _constants = _interopRequireDefault(require("constants"));
|
|
141274
141274
|
var _stream = require("stream");
|
|
@@ -142317,7 +142317,7 @@ var require_connection = __commonJS({
|
|
|
142317
142317
|
async wrapWithTls(socket, signal) {
|
|
142318
142318
|
signal.throwIfAborted();
|
|
142319
142319
|
const secureContext = tls.createSecureContext(this.secureContextOptions);
|
|
142320
|
-
const serverName = !
|
|
142320
|
+
const serverName = !net2.isIP(this.config.server) ? this.config.server : "";
|
|
142321
142321
|
const encryptOptions = {
|
|
142322
142322
|
host: this.config.server,
|
|
142323
142323
|
socket,
|
|
@@ -145239,10 +145239,11 @@ function parseMssqlUrl(url) {
|
|
|
145239
145239
|
}
|
|
145240
145240
|
};
|
|
145241
145241
|
}
|
|
145242
|
-
var normalisePGliteUrl, preparePostgresDB, prepareCockroach, prepareGelDB, parseSingleStoreCredentials, connectToSingleStore, parseMysqlCredentials, connectToMySQL, parseMssqlCredentials, connectToMsSQL, prepareSqliteParams, preparePGliteParams, connectToSQLite, connectToLibSQL;
|
|
145242
|
+
var import_net, ms, normalisePGliteUrl, preparePostgresDB, prepareCockroach, prepareGelDB, parseSingleStoreCredentials, connectToSingleStore, parseMysqlCredentials, connectToMySQL, parseMssqlCredentials, connectToMsSQL, prepareSqliteParams, preparePGliteParams, connectToSQLite, connectToLibSQL;
|
|
145243
145243
|
var init_connections = __esm({
|
|
145244
145244
|
"src/cli/connections.ts"() {
|
|
145245
145245
|
"use strict";
|
|
145246
|
+
import_net = __toESM(require("net"));
|
|
145246
145247
|
init_src();
|
|
145247
145248
|
init_wrapper();
|
|
145248
145249
|
init_utils();
|
|
@@ -145250,6 +145251,7 @@ var init_connections = __esm({
|
|
|
145250
145251
|
init_when_json_met_bigint();
|
|
145251
145252
|
init_utils3();
|
|
145252
145253
|
init_outputs();
|
|
145254
|
+
ms = (a6, b6) => Number(b6 - a6) / 1e6;
|
|
145253
145255
|
normalisePGliteUrl = (it) => {
|
|
145254
145256
|
if (it.startsWith("file:")) {
|
|
145255
145257
|
return it.substring(5);
|
|
@@ -145404,13 +145406,13 @@ var init_connections = __esm({
|
|
|
145404
145406
|
return pg.types.getTypeParser(typeId, format2);
|
|
145405
145407
|
}
|
|
145406
145408
|
};
|
|
145407
|
-
const
|
|
145408
|
-
const db = drizzle({ client });
|
|
145409
|
+
const pool = "url" in credentials ? new pg.Pool({ connectionString: credentials.url, max: 1 }) : new pg.Pool({ ...credentials, ssl, max: 1 });
|
|
145410
|
+
const db = drizzle({ client: pool });
|
|
145409
145411
|
const migrateFn = async (config) => {
|
|
145410
145412
|
return migrate(db, config);
|
|
145411
145413
|
};
|
|
145412
145414
|
const query = async (sql, params) => {
|
|
145413
|
-
const result2 = await
|
|
145415
|
+
const result2 = await pool.query({
|
|
145414
145416
|
text: sql,
|
|
145415
145417
|
values: params ?? [],
|
|
145416
145418
|
types: types3
|
|
@@ -145420,7 +145422,7 @@ var init_connections = __esm({
|
|
|
145420
145422
|
return result2.rows;
|
|
145421
145423
|
};
|
|
145422
145424
|
const proxy = async (params) => {
|
|
145423
|
-
const result2 = await
|
|
145425
|
+
const result2 = await pool.query({
|
|
145424
145426
|
text: params.sql,
|
|
145425
145427
|
values: params.params,
|
|
145426
145428
|
...params.mode === "array" && { rowMode: "array" },
|
|
@@ -145432,7 +145434,7 @@ var init_connections = __esm({
|
|
|
145432
145434
|
};
|
|
145433
145435
|
const transactionProxy = async (queries) => {
|
|
145434
145436
|
const results = [];
|
|
145435
|
-
const tx = await
|
|
145437
|
+
const tx = await pool.connect();
|
|
145436
145438
|
try {
|
|
145437
145439
|
await tx.query("BEGIN");
|
|
145438
145440
|
for (const query2 of queries) {
|
|
@@ -145451,7 +145453,119 @@ var init_connections = __esm({
|
|
|
145451
145453
|
}
|
|
145452
145454
|
return results;
|
|
145453
145455
|
};
|
|
145454
|
-
|
|
145456
|
+
const benchmarkQuery = async (client, sql, params) => {
|
|
145457
|
+
const explainResult = await pool.query({
|
|
145458
|
+
text: `EXPLAIN ANALYZE ${sql}`,
|
|
145459
|
+
values: params ?? [],
|
|
145460
|
+
types: types3
|
|
145461
|
+
});
|
|
145462
|
+
const stringifiedResult = JSON.stringify(explainResult.rows);
|
|
145463
|
+
const planningMatch = stringifiedResult.match(/Planning Time:\s*([\d.]+)\s*ms/i);
|
|
145464
|
+
const executionMatch = stringifiedResult.match(/Execution Time:\s*([\d.]+)\s*ms/i);
|
|
145465
|
+
let planningTime = Number(planningMatch[1]);
|
|
145466
|
+
let executionTime = Number(executionMatch[1]);
|
|
145467
|
+
let querySentAt = 0n;
|
|
145468
|
+
let firstDataAt = 0n;
|
|
145469
|
+
let lastDataAt = 0n;
|
|
145470
|
+
let lastRowParsedAt = 0n;
|
|
145471
|
+
let queryCompletedAt = 0n;
|
|
145472
|
+
let bytesReceived = 0;
|
|
145473
|
+
let rowCount = 0;
|
|
145474
|
+
let parseTime = 0;
|
|
145475
|
+
let lastParseTime = 0;
|
|
145476
|
+
const rowDescriptionListener = (data) => {
|
|
145477
|
+
if (firstDataAt === 0n) {
|
|
145478
|
+
firstDataAt = process.hrtime.bigint();
|
|
145479
|
+
}
|
|
145480
|
+
bytesReceived += data.length;
|
|
145481
|
+
};
|
|
145482
|
+
const originalRowListener = client.connection.listeners("dataRow")[0];
|
|
145483
|
+
const wrappedRowListener = (data) => {
|
|
145484
|
+
rowCount += 1;
|
|
145485
|
+
const start = process.hrtime.bigint();
|
|
145486
|
+
lastDataAt = start;
|
|
145487
|
+
originalRowListener.apply(client.connection, [data]);
|
|
145488
|
+
const end2 = process.hrtime.bigint();
|
|
145489
|
+
lastRowParsedAt = end2;
|
|
145490
|
+
lastParseTime = ms(start, end2);
|
|
145491
|
+
parseTime += lastParseTime;
|
|
145492
|
+
bytesReceived += data.length;
|
|
145493
|
+
};
|
|
145494
|
+
client.connection.removeAllListeners("dataRow");
|
|
145495
|
+
client.connection.addListener("dataRow", wrappedRowListener);
|
|
145496
|
+
client.connection.prependListener("rowDescription", rowDescriptionListener);
|
|
145497
|
+
querySentAt = process.hrtime.bigint();
|
|
145498
|
+
await client.query({
|
|
145499
|
+
text: sql,
|
|
145500
|
+
values: params,
|
|
145501
|
+
types: types3
|
|
145502
|
+
});
|
|
145503
|
+
queryCompletedAt = process.hrtime.bigint();
|
|
145504
|
+
client.connection.removeListener("rowDescription", rowDescriptionListener);
|
|
145505
|
+
client.connection.removeAllListeners("dataRow");
|
|
145506
|
+
client.connection.addListener("dataRow", originalRowListener);
|
|
145507
|
+
let querySentTime = ms(querySentAt, firstDataAt) - executionTime - planningTime;
|
|
145508
|
+
if (querySentTime < 0) {
|
|
145509
|
+
const percent = 0.1;
|
|
145510
|
+
const overflow = -querySentTime;
|
|
145511
|
+
const keepForSent = overflow * percent;
|
|
145512
|
+
const adjustedOverflow = overflow * (1 + percent);
|
|
145513
|
+
const total2 = planningTime + executionTime;
|
|
145514
|
+
const ratioPlanning = planningTime / total2;
|
|
145515
|
+
const ratioExecution = executionTime / total2;
|
|
145516
|
+
planningTime -= adjustedOverflow * ratioPlanning;
|
|
145517
|
+
executionTime -= adjustedOverflow * ratioExecution;
|
|
145518
|
+
querySentTime = keepForSent;
|
|
145519
|
+
}
|
|
145520
|
+
const networkLatencyBefore = querySentTime / 2;
|
|
145521
|
+
const networkLatencyAfter = querySentTime / 2;
|
|
145522
|
+
const downloadTime = ms(firstDataAt, lastDataAt) - (rowCount > 1 ? parseTime - lastParseTime : 0);
|
|
145523
|
+
const total = ms(querySentAt, queryCompletedAt);
|
|
145524
|
+
const calculatedTotal = networkLatencyBefore + planningTime + executionTime + networkLatencyAfter + downloadTime + parseTime + ms(lastRowParsedAt, queryCompletedAt);
|
|
145525
|
+
const errorMargin = Math.abs(total - calculatedTotal);
|
|
145526
|
+
return {
|
|
145527
|
+
networkLatencyBefore,
|
|
145528
|
+
planning: planningTime,
|
|
145529
|
+
execution: executionTime,
|
|
145530
|
+
networkLatencyAfter,
|
|
145531
|
+
dataDownload: downloadTime,
|
|
145532
|
+
dataParse: parseTime,
|
|
145533
|
+
total,
|
|
145534
|
+
errorMargin,
|
|
145535
|
+
dataSize: bytesReceived
|
|
145536
|
+
};
|
|
145537
|
+
};
|
|
145538
|
+
const benchmarkProxy = async ({ sql, params }, repeats) => {
|
|
145539
|
+
let startAt = 0n;
|
|
145540
|
+
let tcpConnectedAt = 0n;
|
|
145541
|
+
let tlsConnectedAt = null;
|
|
145542
|
+
let dbReadyAt = 0n;
|
|
145543
|
+
const client = "url" in credentials ? new pg.Client({ connectionString: credentials.url }) : new pg.Client({ ...credentials, ssl });
|
|
145544
|
+
client.connection.once("connect", () => {
|
|
145545
|
+
tcpConnectedAt = process.hrtime.bigint();
|
|
145546
|
+
});
|
|
145547
|
+
client.connection.prependOnceListener("sslconnect", () => {
|
|
145548
|
+
tlsConnectedAt = process.hrtime.bigint();
|
|
145549
|
+
});
|
|
145550
|
+
client.connection.prependOnceListener("readyForQuery", () => {
|
|
145551
|
+
dbReadyAt = process.hrtime.bigint();
|
|
145552
|
+
});
|
|
145553
|
+
startAt = process.hrtime.bigint();
|
|
145554
|
+
await client.connect();
|
|
145555
|
+
const results = [];
|
|
145556
|
+
for (let i7 = 0; i7 < repeats; i7++) {
|
|
145557
|
+
const r7 = await benchmarkQuery(client, sql, params);
|
|
145558
|
+
results.push(r7);
|
|
145559
|
+
}
|
|
145560
|
+
await client.end();
|
|
145561
|
+
return {
|
|
145562
|
+
tcpHandshake: ms(startAt, tcpConnectedAt),
|
|
145563
|
+
tlsHandshake: tlsConnectedAt ? ms(tcpConnectedAt, tlsConnectedAt) : null,
|
|
145564
|
+
dbHandshake: ms(tlsConnectedAt ?? tcpConnectedAt, dbReadyAt),
|
|
145565
|
+
queries: results
|
|
145566
|
+
};
|
|
145567
|
+
};
|
|
145568
|
+
return { packageName: "pg", query, proxy, transactionProxy, benchmarkProxy, migrate: migrateFn };
|
|
145455
145569
|
}
|
|
145456
145570
|
if (await checkPackage("postgres")) {
|
|
145457
145571
|
console.log(
|
|
@@ -145946,7 +146060,6 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
|
|
|
145946
146060
|
}
|
|
145947
146061
|
return next();
|
|
145948
146062
|
};
|
|
145949
|
-
await connection.connect();
|
|
145950
146063
|
const query = async (sql, params) => {
|
|
145951
146064
|
const res = await connection.execute({
|
|
145952
146065
|
sql,
|
|
@@ -145986,11 +146099,156 @@ To link your project, please refer https://docs.geldata.com/reference/cli/gel_in
|
|
|
145986
146099
|
}
|
|
145987
146100
|
return results;
|
|
145988
146101
|
};
|
|
146102
|
+
const benchmarkQuery = async (newConnection, sql, params) => {
|
|
146103
|
+
const explainResult = await connection.query({
|
|
146104
|
+
sql: `EXPLAIN ANALYZE ${sql}`,
|
|
146105
|
+
values: params ?? [],
|
|
146106
|
+
typeCast
|
|
146107
|
+
});
|
|
146108
|
+
const stringifiedResult = JSON.stringify(explainResult[0]);
|
|
146109
|
+
const timeMatch = stringifiedResult.match(
|
|
146110
|
+
/actual time=([0-9.eE+-]+)\.\.([0-9.eE+-]+)/
|
|
146111
|
+
);
|
|
146112
|
+
const lastRowTime = Number(timeMatch[2]);
|
|
146113
|
+
let executionTime = lastRowTime;
|
|
146114
|
+
let querySentAt = 0n;
|
|
146115
|
+
let firstDataAt = 0n;
|
|
146116
|
+
let lastDataAt = 0n;
|
|
146117
|
+
let lastRowParsedAt = 0n;
|
|
146118
|
+
let queryCompletedAt = 0n;
|
|
146119
|
+
let bytesReceived = 0;
|
|
146120
|
+
let rowCount = 0;
|
|
146121
|
+
let parseTime = 0;
|
|
146122
|
+
let lastParseTime = 0;
|
|
146123
|
+
querySentAt = process.hrtime.bigint();
|
|
146124
|
+
await new Promise((resolve2, reject) => {
|
|
146125
|
+
const query2 = newConnection.query({
|
|
146126
|
+
sql,
|
|
146127
|
+
values: params ?? [],
|
|
146128
|
+
typeCast
|
|
146129
|
+
});
|
|
146130
|
+
const originalRowHandler = query2.row;
|
|
146131
|
+
let packets = 0;
|
|
146132
|
+
const wrappedRowListener = (packet, connection2) => {
|
|
146133
|
+
packets += 1;
|
|
146134
|
+
if (firstDataAt === 0n) {
|
|
146135
|
+
firstDataAt = process.hrtime.bigint();
|
|
146136
|
+
bytesReceived += packet.start;
|
|
146137
|
+
}
|
|
146138
|
+
const start = process.hrtime.bigint();
|
|
146139
|
+
lastDataAt = start;
|
|
146140
|
+
const res = originalRowHandler.apply(query2, [packet, connection2]);
|
|
146141
|
+
const end2 = process.hrtime.bigint();
|
|
146142
|
+
lastRowParsedAt = end2;
|
|
146143
|
+
lastParseTime = ms(start, end2);
|
|
146144
|
+
parseTime += lastParseTime;
|
|
146145
|
+
bytesReceived += packet.length();
|
|
146146
|
+
if (!res || packet.isEOF()) {
|
|
146147
|
+
return res;
|
|
146148
|
+
}
|
|
146149
|
+
return wrappedRowListener;
|
|
146150
|
+
};
|
|
146151
|
+
query2.row = wrappedRowListener;
|
|
146152
|
+
query2.on("result", () => {
|
|
146153
|
+
rowCount += 1;
|
|
146154
|
+
});
|
|
146155
|
+
query2.on("error", (err2) => {
|
|
146156
|
+
reject(err2);
|
|
146157
|
+
});
|
|
146158
|
+
query2.on("end", () => {
|
|
146159
|
+
resolve2();
|
|
146160
|
+
});
|
|
146161
|
+
});
|
|
146162
|
+
queryCompletedAt = process.hrtime.bigint();
|
|
146163
|
+
let querySentTime = ms(querySentAt, firstDataAt) - executionTime;
|
|
146164
|
+
if (querySentTime < 0) {
|
|
146165
|
+
const percent = 0.1;
|
|
146166
|
+
const overflow = -querySentTime;
|
|
146167
|
+
const keepForSent = overflow * percent;
|
|
146168
|
+
const adjustedOverflow = overflow * (1 + percent);
|
|
146169
|
+
const total2 = executionTime;
|
|
146170
|
+
const ratioExecution = executionTime / total2;
|
|
146171
|
+
executionTime -= adjustedOverflow * ratioExecution;
|
|
146172
|
+
querySentTime = keepForSent;
|
|
146173
|
+
}
|
|
146174
|
+
const networkLatencyBefore = querySentTime / 2;
|
|
146175
|
+
const networkLatencyAfter = querySentTime / 2;
|
|
146176
|
+
const downloadTime = ms(firstDataAt, lastDataAt) - (rowCount > 1 ? parseTime - lastParseTime : 0);
|
|
146177
|
+
const total = ms(querySentAt, queryCompletedAt);
|
|
146178
|
+
const calculatedTotal = networkLatencyBefore + executionTime + networkLatencyAfter + downloadTime + parseTime + ms(lastRowParsedAt, queryCompletedAt);
|
|
146179
|
+
const errorMargin = Math.abs(total - calculatedTotal);
|
|
146180
|
+
return {
|
|
146181
|
+
networkLatencyBefore,
|
|
146182
|
+
planning: null,
|
|
146183
|
+
execution: executionTime,
|
|
146184
|
+
networkLatencyAfter,
|
|
146185
|
+
dataDownload: downloadTime,
|
|
146186
|
+
dataParse: parseTime,
|
|
146187
|
+
total,
|
|
146188
|
+
errorMargin,
|
|
146189
|
+
dataSize: bytesReceived
|
|
146190
|
+
};
|
|
146191
|
+
};
|
|
146192
|
+
const benchmarkProxy = async ({ sql, params }, repeats) => {
|
|
146193
|
+
const { createConnection: createConnection2 } = require("mysql2");
|
|
146194
|
+
let startAt = 0n;
|
|
146195
|
+
let tcpConnectedAt = 0n;
|
|
146196
|
+
let tlsConnectedAt = null;
|
|
146197
|
+
const createStream = ({ config }) => {
|
|
146198
|
+
let stream;
|
|
146199
|
+
if (config.socketPath) {
|
|
146200
|
+
stream = import_net.default.connect(config.socketPath);
|
|
146201
|
+
} else {
|
|
146202
|
+
stream = import_net.default.connect(config.port, config.host);
|
|
146203
|
+
}
|
|
146204
|
+
if (config.enableKeepAlive) {
|
|
146205
|
+
stream.on("connect", () => {
|
|
146206
|
+
stream.setKeepAlive(true, config.keepAliveInitialDelay);
|
|
146207
|
+
});
|
|
146208
|
+
}
|
|
146209
|
+
stream.setNoDelay(true);
|
|
146210
|
+
stream.once("connect", () => {
|
|
146211
|
+
tcpConnectedAt = process.hrtime.bigint();
|
|
146212
|
+
});
|
|
146213
|
+
return stream;
|
|
146214
|
+
};
|
|
146215
|
+
startAt = process.hrtime.bigint();
|
|
146216
|
+
const connection2 = result2.url ? createConnection2({
|
|
146217
|
+
uri: result2.url,
|
|
146218
|
+
stream: createStream
|
|
146219
|
+
}) : createConnection2({
|
|
146220
|
+
...result2.credentials,
|
|
146221
|
+
stream: createStream
|
|
146222
|
+
});
|
|
146223
|
+
await new Promise((resolve2, reject) => {
|
|
146224
|
+
connection2.connect((err2) => {
|
|
146225
|
+
tlsConnectedAt = process.hrtime.bigint();
|
|
146226
|
+
if (err2) {
|
|
146227
|
+
reject(err2);
|
|
146228
|
+
} else {
|
|
146229
|
+
resolve2();
|
|
146230
|
+
}
|
|
146231
|
+
});
|
|
146232
|
+
});
|
|
146233
|
+
const results = [];
|
|
146234
|
+
for (let i7 = 0; i7 < repeats; i7++) {
|
|
146235
|
+
const r7 = await benchmarkQuery(connection2, sql, params);
|
|
146236
|
+
results.push(r7);
|
|
146237
|
+
}
|
|
146238
|
+
connection2.end();
|
|
146239
|
+
return {
|
|
146240
|
+
tcpHandshake: ms(startAt, tcpConnectedAt),
|
|
146241
|
+
tlsHandshake: tlsConnectedAt ? ms(tcpConnectedAt, tlsConnectedAt) : null,
|
|
146242
|
+
dbHandshake: null,
|
|
146243
|
+
queries: results
|
|
146244
|
+
};
|
|
146245
|
+
};
|
|
145989
146246
|
return {
|
|
145990
146247
|
db: { query },
|
|
145991
146248
|
packageName: "mysql2",
|
|
145992
146249
|
proxy,
|
|
145993
146250
|
transactionProxy,
|
|
146251
|
+
benchmarkProxy,
|
|
145994
146252
|
database: result2.database,
|
|
145995
146253
|
migrate: migrateFn
|
|
145996
146254
|
};
|
|
@@ -148544,8 +148802,8 @@ ${sql}
|
|
|
148544
148802
|
`;
|
|
148545
148803
|
return content;
|
|
148546
148804
|
};
|
|
148547
|
-
prepareSnapshotFolderName = (
|
|
148548
|
-
const now =
|
|
148805
|
+
prepareSnapshotFolderName = (ms2) => {
|
|
148806
|
+
const now = ms2 ? new Date(ms2) : /* @__PURE__ */ new Date();
|
|
148549
148807
|
return `${now.getFullYear()}${two(now.getUTCMonth() + 1)}${two(
|
|
148550
148808
|
now.getUTCDate()
|
|
148551
148809
|
)}${two(now.getUTCHours())}${two(now.getUTCMinutes())}${two(
|
|
@@ -152043,7 +152301,7 @@ __export(studio_exports, {
|
|
|
152043
152301
|
prepareServer: () => prepareServer,
|
|
152044
152302
|
prepareSingleStoreSchema: () => prepareSingleStoreSchema
|
|
152045
152303
|
});
|
|
152046
|
-
var import_crypto10, import_drizzle_orm3, import_relations3, import_mssql_core2, import_mysql_core2, import_pg_core3, import_singlestore_core, import_sqlite_core2, import_fs6, import_node_https2, preparePgSchema, prepareMySqlSchema, prepareMsSqlSchema, prepareSQLiteSchema, prepareSingleStoreSchema, getCustomDefaults, drizzleForPostgres, drizzleForMySQL, drizzleForSQLite, drizzleForLibSQL, drizzleForSingleStore, extractRelations, init2, proxySchema, transactionProxySchema, defaultsSchema, schema5, jsonStringify, prepareServer;
|
|
152304
|
+
var import_crypto10, import_drizzle_orm3, import_relations3, import_mssql_core2, import_mysql_core2, import_pg_core3, import_singlestore_core, import_sqlite_core2, import_fs6, import_node_https2, preparePgSchema, prepareMySqlSchema, prepareMsSqlSchema, prepareSQLiteSchema, prepareSingleStoreSchema, getCustomDefaults, drizzleForPostgres, drizzleForMySQL, drizzleForSQLite, drizzleForLibSQL, drizzleForSingleStore, extractRelations, init2, proxySchema, transactionProxySchema, benchmarkProxySchema, defaultsSchema, schema5, jsonStringify, prepareServer;
|
|
152047
152305
|
var init_studio = __esm({
|
|
152048
152306
|
"src/cli/commands/studio.ts"() {
|
|
152049
152307
|
"use strict";
|
|
@@ -152267,6 +152525,7 @@ var init_studio = __esm({
|
|
|
152267
152525
|
packageName: db.packageName,
|
|
152268
152526
|
proxy: db.proxy,
|
|
152269
152527
|
transactionProxy: db.transactionProxy,
|
|
152528
|
+
benchmarkProxy: db.benchmarkProxy,
|
|
152270
152529
|
customDefaults,
|
|
152271
152530
|
schema: pgSchema2,
|
|
152272
152531
|
relations: relations2,
|
|
@@ -152276,7 +152535,7 @@ var init_studio = __esm({
|
|
|
152276
152535
|
};
|
|
152277
152536
|
drizzleForMySQL = async (credentials, mysqlSchema, relations2, schemaFiles, casing2) => {
|
|
152278
152537
|
const { connectToMySQL: connectToMySQL2 } = await Promise.resolve().then(() => (init_connections(), connections_exports));
|
|
152279
|
-
const { proxy, transactionProxy, database, packageName } = await connectToMySQL2(credentials);
|
|
152538
|
+
const { proxy, transactionProxy, benchmarkProxy, database, packageName } = await connectToMySQL2(credentials);
|
|
152280
152539
|
const customDefaults = getCustomDefaults(mysqlSchema, casing2);
|
|
152281
152540
|
let dbUrl;
|
|
152282
152541
|
if ("url" in credentials) {
|
|
@@ -152292,6 +152551,7 @@ var init_studio = __esm({
|
|
|
152292
152551
|
databaseName: database,
|
|
152293
152552
|
proxy,
|
|
152294
152553
|
transactionProxy,
|
|
152554
|
+
benchmarkProxy,
|
|
152295
152555
|
customDefaults,
|
|
152296
152556
|
schema: mysqlSchema,
|
|
152297
152557
|
relations: relations2,
|
|
@@ -152461,6 +152721,23 @@ var init_studio = __esm({
|
|
|
152461
152721
|
]).optional()
|
|
152462
152722
|
}).array()
|
|
152463
152723
|
});
|
|
152724
|
+
benchmarkProxySchema = external_exports.object({
|
|
152725
|
+
type: external_exports.literal("bproxy"),
|
|
152726
|
+
data: external_exports.object({
|
|
152727
|
+
query: external_exports.object({
|
|
152728
|
+
sql: external_exports.string(),
|
|
152729
|
+
params: external_exports.array(external_exports.any()).optional(),
|
|
152730
|
+
method: external_exports.union([
|
|
152731
|
+
external_exports.literal("values"),
|
|
152732
|
+
external_exports.literal("get"),
|
|
152733
|
+
external_exports.literal("all"),
|
|
152734
|
+
external_exports.literal("run"),
|
|
152735
|
+
external_exports.literal("execute")
|
|
152736
|
+
]).optional()
|
|
152737
|
+
}),
|
|
152738
|
+
repeats: external_exports.number().min(1).optional()
|
|
152739
|
+
})
|
|
152740
|
+
});
|
|
152464
152741
|
defaultsSchema = external_exports.object({
|
|
152465
152742
|
type: external_exports.literal("defaults"),
|
|
152466
152743
|
data: external_exports.array(
|
|
@@ -152475,6 +152752,7 @@ var init_studio = __esm({
|
|
|
152475
152752
|
init2,
|
|
152476
152753
|
proxySchema,
|
|
152477
152754
|
transactionProxySchema,
|
|
152755
|
+
benchmarkProxySchema,
|
|
152478
152756
|
defaultsSchema
|
|
152479
152757
|
]);
|
|
152480
152758
|
jsonStringify = (data) => {
|
|
@@ -152497,6 +152775,7 @@ var init_studio = __esm({
|
|
|
152497
152775
|
databaseName,
|
|
152498
152776
|
proxy,
|
|
152499
152777
|
transactionProxy,
|
|
152778
|
+
benchmarkProxy,
|
|
152500
152779
|
customDefaults,
|
|
152501
152780
|
schema: drizzleSchema,
|
|
152502
152781
|
relations: relations2,
|
|
@@ -152560,7 +152839,7 @@ var init_studio = __esm({
|
|
|
152560
152839
|
console.warn("Error message:", error3.message);
|
|
152561
152840
|
}
|
|
152562
152841
|
return c6.json({
|
|
152563
|
-
version: "6.
|
|
152842
|
+
version: "6.3",
|
|
152564
152843
|
dialect: dialect6,
|
|
152565
152844
|
driver: driver2,
|
|
152566
152845
|
packageName,
|
|
@@ -152598,6 +152877,21 @@ var init_studio = __esm({
|
|
|
152598
152877
|
}
|
|
152599
152878
|
);
|
|
152600
152879
|
}
|
|
152880
|
+
if (type === "bproxy") {
|
|
152881
|
+
if (!benchmarkProxy) {
|
|
152882
|
+
throw new Error("Benchmark proxy is not configured for this database.");
|
|
152883
|
+
}
|
|
152884
|
+
const result2 = await benchmarkProxy(body.data.query, body.data.repeats || 1);
|
|
152885
|
+
const res = jsonStringify(result2);
|
|
152886
|
+
return c6.body(
|
|
152887
|
+
res,
|
|
152888
|
+
{
|
|
152889
|
+
headers: {
|
|
152890
|
+
"Content-Type": "application/json"
|
|
152891
|
+
}
|
|
152892
|
+
}
|
|
152893
|
+
);
|
|
152894
|
+
}
|
|
152601
152895
|
if (type === "defaults") {
|
|
152602
152896
|
const columns = body.data;
|
|
152603
152897
|
const result2 = columns.map((column8) => {
|