drizzle-kit 0.31.9 → 0.31.10
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.js +237 -182
- package/api.mjs +238 -187
- package/bin.cjs +3989 -5706
- package/package.json +3 -4
- package/utils.js +71 -39
- package/utils.mjs +71 -39
package/api.mjs
CHANGED
|
@@ -41,7 +41,6 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
41
41
|
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
42
42
|
mod
|
|
43
43
|
));
|
|
44
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
45
44
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
46
45
|
var __accessCheck = (obj, member, msg) => member.has(obj) || __typeError("Cannot " + msg);
|
|
47
46
|
var __privateGet = (obj, member, getter) => (__accessCheck(obj, member, "read from private field"), getter ? getter.call(obj) : member.get(obj));
|
|
@@ -2890,28 +2889,26 @@ var require_glob = __commonJS({
|
|
|
2890
2889
|
}
|
|
2891
2890
|
});
|
|
2892
2891
|
|
|
2893
|
-
// ../node_modules/.pnpm/hanji@0.0.
|
|
2892
|
+
// ../node_modules/.pnpm/hanji@0.0.8/node_modules/hanji/readline.js
|
|
2894
2893
|
var require_readline = __commonJS({
|
|
2895
|
-
"../node_modules/.pnpm/hanji@0.0.
|
|
2894
|
+
"../node_modules/.pnpm/hanji@0.0.8/node_modules/hanji/readline.js"(exports) {
|
|
2896
2895
|
"use strict";
|
|
2896
|
+
var __importDefault = exports && exports.__importDefault || function(mod) {
|
|
2897
|
+
return mod && mod.__esModule ? mod : { "default": mod };
|
|
2898
|
+
};
|
|
2897
2899
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2898
|
-
exports.
|
|
2899
|
-
var
|
|
2900
|
-
|
|
2901
|
-
|
|
2902
|
-
|
|
2903
|
-
|
|
2904
|
-
|
|
2900
|
+
exports.createClosable = exports.stdout = exports.stdin = void 0;
|
|
2901
|
+
var readline_1 = __importDefault(__require("readline"));
|
|
2902
|
+
exports.stdin = process.stdin;
|
|
2903
|
+
exports.stdout = process.stdout;
|
|
2904
|
+
readline_1.default.emitKeypressEvents(exports.stdin);
|
|
2905
|
+
var createClosable = () => {
|
|
2906
|
+
return readline_1.default.createInterface({
|
|
2907
|
+
input: exports.stdin,
|
|
2905
2908
|
escapeCodeTimeout: 50
|
|
2906
2909
|
});
|
|
2907
|
-
readline.emitKeypressEvents(stdin, rl);
|
|
2908
|
-
return {
|
|
2909
|
-
stdin,
|
|
2910
|
-
stdout,
|
|
2911
|
-
closable: rl
|
|
2912
|
-
};
|
|
2913
2910
|
};
|
|
2914
|
-
exports.
|
|
2911
|
+
exports.createClosable = createClosable;
|
|
2915
2912
|
}
|
|
2916
2913
|
});
|
|
2917
2914
|
|
|
@@ -2971,12 +2968,12 @@ var require_src = __commonJS({
|
|
|
2971
2968
|
}
|
|
2972
2969
|
});
|
|
2973
2970
|
|
|
2974
|
-
// ../node_modules/.pnpm/hanji@0.0.
|
|
2971
|
+
// ../node_modules/.pnpm/hanji@0.0.8/node_modules/hanji/utils.js
|
|
2975
2972
|
var require_utils = __commonJS({
|
|
2976
|
-
"../node_modules/.pnpm/hanji@0.0.
|
|
2973
|
+
"../node_modules/.pnpm/hanji@0.0.8/node_modules/hanji/utils.js"(exports) {
|
|
2977
2974
|
"use strict";
|
|
2978
2975
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
2979
|
-
exports.clear = void 0;
|
|
2976
|
+
exports.clear = exports.stringWidth = exports.fallbackStringWidth = exports.stripAnsi = exports.strip = void 0;
|
|
2980
2977
|
var sisteransi_1 = require_src();
|
|
2981
2978
|
var strip = (str) => {
|
|
2982
2979
|
const pattern = [
|
|
@@ -2986,14 +2983,35 @@ var require_utils = __commonJS({
|
|
|
2986
2983
|
const RGX = new RegExp(pattern, "g");
|
|
2987
2984
|
return typeof str === "string" ? str.replace(RGX, "") : str;
|
|
2988
2985
|
};
|
|
2989
|
-
|
|
2986
|
+
exports.strip = strip;
|
|
2987
|
+
var stripAnsi = (str) => {
|
|
2988
|
+
if (typeof Bun !== "undefined" && Bun.stripANSI) {
|
|
2989
|
+
return Bun.stripANSI(str);
|
|
2990
|
+
}
|
|
2991
|
+
return (0, exports.strip)(str);
|
|
2992
|
+
};
|
|
2993
|
+
exports.stripAnsi = stripAnsi;
|
|
2994
|
+
var fallbackStringWidth = (str) => {
|
|
2995
|
+
let len = 0;
|
|
2996
|
+
const stripped = (0, exports.stripAnsi)(str);
|
|
2997
|
+
for (const _3 of stripped)
|
|
2998
|
+
len++;
|
|
2999
|
+
return len;
|
|
3000
|
+
};
|
|
3001
|
+
exports.fallbackStringWidth = fallbackStringWidth;
|
|
3002
|
+
var stringWidth = (str) => {
|
|
3003
|
+
if (typeof Bun !== "undefined" && Bun.stringWidth)
|
|
3004
|
+
return Bun.stringWidth(str);
|
|
3005
|
+
return (0, exports.fallbackStringWidth)(str);
|
|
3006
|
+
};
|
|
3007
|
+
exports.stringWidth = stringWidth;
|
|
2990
3008
|
var clear = function(prompt, perLine) {
|
|
2991
3009
|
if (!perLine)
|
|
2992
3010
|
return sisteransi_1.erase.line + sisteransi_1.cursor.to(0);
|
|
2993
3011
|
let rows = 0;
|
|
2994
3012
|
const lines = prompt.split(/\r?\n/);
|
|
2995
3013
|
for (let line of lines) {
|
|
2996
|
-
rows += 1 + Math.floor(Math.max(stringWidth(line) - 1, 0) / perLine);
|
|
3014
|
+
rows += 1 + Math.floor(Math.max((0, exports.stringWidth)(line) - 1, 0) / perLine);
|
|
2997
3015
|
}
|
|
2998
3016
|
return sisteransi_1.erase.lines(rows);
|
|
2999
3017
|
};
|
|
@@ -3150,9 +3168,9 @@ var require_lodash = __commonJS({
|
|
|
3150
3168
|
}
|
|
3151
3169
|
});
|
|
3152
3170
|
|
|
3153
|
-
// ../node_modules/.pnpm/hanji@0.0.
|
|
3171
|
+
// ../node_modules/.pnpm/hanji@0.0.8/node_modules/hanji/index.js
|
|
3154
3172
|
var require_hanji = __commonJS({
|
|
3155
|
-
"../node_modules/.pnpm/hanji@0.0.
|
|
3173
|
+
"../node_modules/.pnpm/hanji@0.0.8/node_modules/hanji/index.js"(exports) {
|
|
3156
3174
|
"use strict";
|
|
3157
3175
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
3158
3176
|
function adopt(value) {
|
|
@@ -3185,7 +3203,10 @@ var require_hanji = __commonJS({
|
|
|
3185
3203
|
return mod && mod.__esModule ? mod : { "default": mod };
|
|
3186
3204
|
};
|
|
3187
3205
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3188
|
-
exports.
|
|
3206
|
+
exports.TaskTerminal = exports.TaskView = exports.Terminal = exports.deferred = exports.SelectState = exports.Prompt = void 0;
|
|
3207
|
+
exports.render = render7;
|
|
3208
|
+
exports.renderWithTask = renderWithTask5;
|
|
3209
|
+
exports.onTerminate = onTerminate;
|
|
3189
3210
|
var readline_1 = require_readline();
|
|
3190
3211
|
var sisteransi_1 = require_src();
|
|
3191
3212
|
var utils_1 = require_utils();
|
|
@@ -3383,36 +3404,46 @@ var require_hanji = __commonJS({
|
|
|
3383
3404
|
const clearPrefix = this.text ? (0, utils_1.clear)(this.text, this.stdout.columns) : "";
|
|
3384
3405
|
this.stdout.write(`${clearPrefix}${string}`);
|
|
3385
3406
|
}
|
|
3407
|
+
reject(err2) {
|
|
3408
|
+
const string = this.view.render("rejected", err2);
|
|
3409
|
+
this.view.detach(this);
|
|
3410
|
+
const clearPrefix = this.text ? (0, utils_1.clear)(this.text, this.stdout.columns) : "";
|
|
3411
|
+
this.stdout.write(`${clearPrefix}${string}`);
|
|
3412
|
+
}
|
|
3386
3413
|
};
|
|
3387
3414
|
exports.TaskTerminal = TaskTerminal;
|
|
3388
3415
|
function render7(view5) {
|
|
3389
|
-
|
|
3390
|
-
|
|
3391
|
-
const terminal = new Terminal(view5, stdin, stdout, closable);
|
|
3392
|
-
terminal.requestLayout();
|
|
3393
|
-
return terminal.result();
|
|
3394
|
-
}
|
|
3395
|
-
stdout.write(`${view5}
|
|
3416
|
+
if (typeof view5 === "string") {
|
|
3417
|
+
process.stdout.write(`${view5}
|
|
3396
3418
|
`);
|
|
3397
|
-
|
|
3398
|
-
|
|
3419
|
+
return;
|
|
3420
|
+
}
|
|
3421
|
+
if (!process.stdin.isTTY || !process.stdout.isTTY) {
|
|
3422
|
+
return Promise.reject(new Error("Interactive prompts require a TTY terminal (process.stdin.isTTY or process.stdout.isTTY is false). This can happen when running in CI, piped input, or non-interactive shells."));
|
|
3423
|
+
}
|
|
3424
|
+
const closable = (0, readline_1.createClosable)();
|
|
3425
|
+
const terminal = new Terminal(view5, readline_1.stdin, readline_1.stdout, closable);
|
|
3426
|
+
terminal.requestLayout();
|
|
3427
|
+
return terminal.result();
|
|
3399
3428
|
}
|
|
3400
|
-
exports.render = render7;
|
|
3401
3429
|
function renderWithTask5(view5, task) {
|
|
3402
3430
|
return __awaiter(this, void 0, void 0, function* () {
|
|
3403
3431
|
const terminal = new TaskTerminal(view5, process.stdout);
|
|
3404
3432
|
terminal.requestLayout();
|
|
3405
|
-
|
|
3406
|
-
|
|
3407
|
-
|
|
3433
|
+
try {
|
|
3434
|
+
const result = yield task;
|
|
3435
|
+
terminal.clear();
|
|
3436
|
+
return result;
|
|
3437
|
+
} catch (err2) {
|
|
3438
|
+
terminal.reject(err2);
|
|
3439
|
+
process.exit(1);
|
|
3440
|
+
}
|
|
3408
3441
|
});
|
|
3409
3442
|
}
|
|
3410
|
-
exports.renderWithTask = renderWithTask5;
|
|
3411
3443
|
var terminateHandler;
|
|
3412
3444
|
function onTerminate(callback) {
|
|
3413
3445
|
terminateHandler = callback;
|
|
3414
3446
|
}
|
|
3415
|
-
exports.onTerminate = onTerminate;
|
|
3416
3447
|
}
|
|
3417
3448
|
});
|
|
3418
3449
|
|
|
@@ -9574,7 +9605,7 @@ Is ${source_default.bold.blue(
|
|
|
9574
9605
|
const title = isRenamed ? `${it.from.name} \u203A ${it.to.name}`.padEnd(labelLength, " ") : it.name.padEnd(labelLength, " ");
|
|
9575
9606
|
const label = isRenamed ? `${source_default.yellow("~")} ${title} ${source_default.gray("rename column")}` : `${source_default.green("+")} ${title} ${source_default.gray("create column")}`;
|
|
9576
9607
|
text += isSelected ? `${selectedPrefix}${label}` : ` ${label}`;
|
|
9577
|
-
text += idx
|
|
9608
|
+
text += idx !== this.data.items.length - 1 ? "\n" : "";
|
|
9578
9609
|
});
|
|
9579
9610
|
return text;
|
|
9580
9611
|
}
|
|
@@ -9593,7 +9624,6 @@ Is ${source_default.bold.blue(
|
|
|
9593
9624
|
this.on("attach", (terminal) => terminal.toggleCursor("hide"));
|
|
9594
9625
|
this.state = new import_hanji.SelectState(data);
|
|
9595
9626
|
this.state.bind(this);
|
|
9596
|
-
this.base = base;
|
|
9597
9627
|
}
|
|
9598
9628
|
render(status) {
|
|
9599
9629
|
if (status === "submitted" || status === "aborted") {
|
|
@@ -9624,7 +9654,7 @@ Is ${source_default.bold.blue(key)} ${this.entityType} created or renamed from a
|
|
|
9624
9654
|
const title = isRenamed ? `${it.from.name} \u203A ${it.to.name}`.padEnd(labelLength, " ") : it.name.padEnd(labelLength, " ");
|
|
9625
9655
|
const label = isRenamed ? `${source_default.yellow("~")} ${title} ${source_default.gray(`rename ${entityType}`)}` : `${source_default.green("+")} ${title} ${source_default.gray(`create ${entityType}`)}`;
|
|
9626
9656
|
text += isSelected ? `${selectedPrefix}${label}` : ` ${label}`;
|
|
9627
|
-
text += idx
|
|
9657
|
+
text += idx !== this.state.items.length - 1 ? "\n" : "";
|
|
9628
9658
|
});
|
|
9629
9659
|
return text;
|
|
9630
9660
|
}
|
|
@@ -9671,7 +9701,7 @@ Is ${source_default.bold.blue(key)} ${this.entityType} created or renamed from a
|
|
|
9671
9701
|
const title = isRenamed ? `${tableKey(it.from)} \u203A ${tableKey(it.to)}`.padEnd(labelLength, " ") : tableKey(it).padEnd(labelLength, " ");
|
|
9672
9702
|
const label = isRenamed ? `${source_default.yellow("~")} ${title} ${source_default.gray(`rename ${entityType}`)}` : `${source_default.green("+")} ${title} ${source_default.gray(`create ${entityType}`)}`;
|
|
9673
9703
|
text += isSelected ? `${selectedPrefix}${label}` : ` ${label}`;
|
|
9674
|
-
text += idx
|
|
9704
|
+
text += idx !== this.state.items.length - 1 ? "\n" : "";
|
|
9675
9705
|
});
|
|
9676
9706
|
return text;
|
|
9677
9707
|
}
|
|
@@ -9715,7 +9745,7 @@ Is ${source_default.bold.blue(
|
|
|
9715
9745
|
const title = isRenamed ? `${it.from.name} \u203A ${it.to.name}`.padEnd(labelLength, " ") : it.name.padEnd(labelLength, " ");
|
|
9716
9746
|
const label = isRenamed ? `${source_default.yellow("~")} ${title} ${source_default.gray("rename schema")}` : `${source_default.green("+")} ${title} ${source_default.gray("create schema")}`;
|
|
9717
9747
|
text += isSelected ? `${selectedPrefix}${label}` : ` ${label}`;
|
|
9718
|
-
text += idx
|
|
9748
|
+
text += idx !== this.state.items.length - 1 ? "\n" : "";
|
|
9719
9749
|
});
|
|
9720
9750
|
return text;
|
|
9721
9751
|
}
|
|
@@ -9752,7 +9782,7 @@ Is ${source_default.bold.blue(
|
|
|
9752
9782
|
this.on("detach", () => clearInterval(this.timeout));
|
|
9753
9783
|
}
|
|
9754
9784
|
render(status) {
|
|
9755
|
-
if (status === "pending") {
|
|
9785
|
+
if (status === "pending" || status === "rejected") {
|
|
9756
9786
|
const spin = this.spinner.value();
|
|
9757
9787
|
return `[${spin}] ${this.progressText}
|
|
9758
9788
|
`;
|
|
@@ -25701,7 +25731,7 @@ var init_es5 = __esm({
|
|
|
25701
25731
|
});
|
|
25702
25732
|
|
|
25703
25733
|
// src/cli/commands/utils.ts
|
|
25704
|
-
var import_hanji7, assertES5, safeRegister, migrateConfig;
|
|
25734
|
+
var import_hanji7, assertES5, InMemoryMutex, registerMutex, tsxRegistered, ensureTsxRegistered, safeRegister, migrateConfig;
|
|
25705
25735
|
var init_utils3 = __esm({
|
|
25706
25736
|
"src/cli/commands/utils.ts"() {
|
|
25707
25737
|
"use strict";
|
|
@@ -25722,9 +25752,9 @@ var init_utils3 = __esm({
|
|
|
25722
25752
|
init_sqlite();
|
|
25723
25753
|
init_studio();
|
|
25724
25754
|
init_views();
|
|
25725
|
-
assertES5 = async (
|
|
25755
|
+
assertES5 = async () => {
|
|
25726
25756
|
try {
|
|
25727
|
-
init_es5();
|
|
25757
|
+
await Promise.resolve().then(() => (init_es5(), es5_exports));
|
|
25728
25758
|
} catch (e6) {
|
|
25729
25759
|
if ("errors" in e6 && Array.isArray(e6.errors) && e6.errors.length > 0) {
|
|
25730
25760
|
const es5Error = e6.errors.filter((it) => it.text?.includes(`("es5") is not supported yet`)).length > 0;
|
|
@@ -25741,22 +25771,46 @@ var init_utils3 = __esm({
|
|
|
25741
25771
|
process.exit(1);
|
|
25742
25772
|
}
|
|
25743
25773
|
};
|
|
25744
|
-
|
|
25745
|
-
|
|
25746
|
-
|
|
25747
|
-
|
|
25748
|
-
|
|
25749
|
-
|
|
25750
|
-
|
|
25774
|
+
InMemoryMutex = class {
|
|
25775
|
+
constructor() {
|
|
25776
|
+
this.lockPromise = null;
|
|
25777
|
+
}
|
|
25778
|
+
async withLock(fn) {
|
|
25779
|
+
while (this.lockPromise) {
|
|
25780
|
+
await this.lockPromise;
|
|
25781
|
+
}
|
|
25782
|
+
let resolveLock;
|
|
25783
|
+
this.lockPromise = new Promise((resolve) => {
|
|
25784
|
+
resolveLock = resolve;
|
|
25751
25785
|
});
|
|
25752
|
-
|
|
25753
|
-
|
|
25754
|
-
|
|
25755
|
-
|
|
25756
|
-
|
|
25786
|
+
try {
|
|
25787
|
+
return await fn();
|
|
25788
|
+
} finally {
|
|
25789
|
+
this.lockPromise = null;
|
|
25790
|
+
resolveLock();
|
|
25791
|
+
}
|
|
25757
25792
|
}
|
|
25758
|
-
|
|
25759
|
-
|
|
25793
|
+
};
|
|
25794
|
+
registerMutex = new InMemoryMutex();
|
|
25795
|
+
tsxRegistered = false;
|
|
25796
|
+
ensureTsxRegistered = () => {
|
|
25797
|
+
if (tsxRegistered) return;
|
|
25798
|
+
const isBun = typeof globalThis.Bun !== "undefined";
|
|
25799
|
+
const isDeno = typeof globalThis.Deno !== "undefined";
|
|
25800
|
+
if (isBun || isDeno) {
|
|
25801
|
+
tsxRegistered = true;
|
|
25802
|
+
return;
|
|
25803
|
+
}
|
|
25804
|
+
const tsx = __require("tsx/cjs/api");
|
|
25805
|
+
tsx.register();
|
|
25806
|
+
tsxRegistered = true;
|
|
25807
|
+
};
|
|
25808
|
+
safeRegister = async (fn) => {
|
|
25809
|
+
return registerMutex.withLock(async () => {
|
|
25810
|
+
ensureTsxRegistered();
|
|
25811
|
+
await assertES5();
|
|
25812
|
+
return fn();
|
|
25813
|
+
});
|
|
25760
25814
|
};
|
|
25761
25815
|
migrateConfig = objectType({
|
|
25762
25816
|
dialect: dialect4,
|
|
@@ -35246,9 +35300,9 @@ var init_src = __esm({
|
|
|
35246
35300
|
}
|
|
35247
35301
|
});
|
|
35248
35302
|
|
|
35249
|
-
// ../node_modules/.pnpm/ws@8.18.
|
|
35303
|
+
// ../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/constants.js
|
|
35250
35304
|
var require_constants = __commonJS({
|
|
35251
|
-
"../node_modules/.pnpm/ws@8.18.
|
|
35305
|
+
"../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/constants.js"(exports, module) {
|
|
35252
35306
|
"use strict";
|
|
35253
35307
|
var BINARY_TYPES = ["nodebuffer", "arraybuffer", "fragments"];
|
|
35254
35308
|
var hasBlob = typeof Blob !== "undefined";
|
|
@@ -35482,9 +35536,9 @@ var require_bufferutil = __commonJS({
|
|
|
35482
35536
|
}
|
|
35483
35537
|
});
|
|
35484
35538
|
|
|
35485
|
-
// ../node_modules/.pnpm/ws@8.18.
|
|
35539
|
+
// ../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/buffer-util.js
|
|
35486
35540
|
var require_buffer_util = __commonJS({
|
|
35487
|
-
"../node_modules/.pnpm/ws@8.18.
|
|
35541
|
+
"../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/buffer-util.js"(exports, module) {
|
|
35488
35542
|
"use strict";
|
|
35489
35543
|
var { EMPTY_BUFFER } = require_constants();
|
|
35490
35544
|
var FastBuffer = Buffer[Symbol.species];
|
|
@@ -35557,9 +35611,9 @@ var require_buffer_util = __commonJS({
|
|
|
35557
35611
|
}
|
|
35558
35612
|
});
|
|
35559
35613
|
|
|
35560
|
-
// ../node_modules/.pnpm/ws@8.18.
|
|
35614
|
+
// ../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/limiter.js
|
|
35561
35615
|
var require_limiter = __commonJS({
|
|
35562
|
-
"../node_modules/.pnpm/ws@8.18.
|
|
35616
|
+
"../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/limiter.js"(exports, module) {
|
|
35563
35617
|
"use strict";
|
|
35564
35618
|
var kDone = Symbol("kDone");
|
|
35565
35619
|
var kRun = Symbol("kRun");
|
|
@@ -35607,9 +35661,9 @@ var require_limiter = __commonJS({
|
|
|
35607
35661
|
}
|
|
35608
35662
|
});
|
|
35609
35663
|
|
|
35610
|
-
// ../node_modules/.pnpm/ws@8.18.
|
|
35664
|
+
// ../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/permessage-deflate.js
|
|
35611
35665
|
var require_permessage_deflate = __commonJS({
|
|
35612
|
-
"../node_modules/.pnpm/ws@8.18.
|
|
35666
|
+
"../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/permessage-deflate.js"(exports, module) {
|
|
35613
35667
|
"use strict";
|
|
35614
35668
|
var zlib2 = __require("zlib");
|
|
35615
35669
|
var bufferUtil = require_buffer_util();
|
|
@@ -36039,9 +36093,9 @@ var require_utf_8_validate = __commonJS({
|
|
|
36039
36093
|
}
|
|
36040
36094
|
});
|
|
36041
36095
|
|
|
36042
|
-
// ../node_modules/.pnpm/ws@8.18.
|
|
36096
|
+
// ../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/validation.js
|
|
36043
36097
|
var require_validation = __commonJS({
|
|
36044
|
-
"../node_modules/.pnpm/ws@8.18.
|
|
36098
|
+
"../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/validation.js"(exports, module) {
|
|
36045
36099
|
"use strict";
|
|
36046
36100
|
var { isUtf8 } = __require("buffer");
|
|
36047
36101
|
var { hasBlob } = require_constants();
|
|
@@ -36240,9 +36294,9 @@ var require_validation = __commonJS({
|
|
|
36240
36294
|
}
|
|
36241
36295
|
});
|
|
36242
36296
|
|
|
36243
|
-
// ../node_modules/.pnpm/ws@8.18.
|
|
36297
|
+
// ../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/receiver.js
|
|
36244
36298
|
var require_receiver = __commonJS({
|
|
36245
|
-
"../node_modules/.pnpm/ws@8.18.
|
|
36299
|
+
"../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/receiver.js"(exports, module) {
|
|
36246
36300
|
"use strict";
|
|
36247
36301
|
var { Writable: Writable2 } = __require("stream");
|
|
36248
36302
|
var PerMessageDeflate = require_permessage_deflate();
|
|
@@ -36832,9 +36886,9 @@ var require_receiver = __commonJS({
|
|
|
36832
36886
|
}
|
|
36833
36887
|
});
|
|
36834
36888
|
|
|
36835
|
-
// ../node_modules/.pnpm/ws@8.18.
|
|
36889
|
+
// ../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/sender.js
|
|
36836
36890
|
var require_sender = __commonJS({
|
|
36837
|
-
"../node_modules/.pnpm/ws@8.18.
|
|
36891
|
+
"../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/sender.js"(exports, module) {
|
|
36838
36892
|
"use strict";
|
|
36839
36893
|
var { Duplex } = __require("stream");
|
|
36840
36894
|
var { randomFillSync } = __require("crypto");
|
|
@@ -37320,9 +37374,9 @@ var require_sender = __commonJS({
|
|
|
37320
37374
|
}
|
|
37321
37375
|
});
|
|
37322
37376
|
|
|
37323
|
-
// ../node_modules/.pnpm/ws@8.18.
|
|
37377
|
+
// ../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/event-target.js
|
|
37324
37378
|
var require_event_target = __commonJS({
|
|
37325
|
-
"../node_modules/.pnpm/ws@8.18.
|
|
37379
|
+
"../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/event-target.js"(exports, module) {
|
|
37326
37380
|
"use strict";
|
|
37327
37381
|
var { kForOnEventAttribute, kListener } = require_constants();
|
|
37328
37382
|
var kCode = Symbol("kCode");
|
|
@@ -37549,9 +37603,9 @@ var require_event_target = __commonJS({
|
|
|
37549
37603
|
}
|
|
37550
37604
|
});
|
|
37551
37605
|
|
|
37552
|
-
// ../node_modules/.pnpm/ws@8.18.
|
|
37606
|
+
// ../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/extension.js
|
|
37553
37607
|
var require_extension = __commonJS({
|
|
37554
|
-
"../node_modules/.pnpm/ws@8.18.
|
|
37608
|
+
"../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/extension.js"(exports, module) {
|
|
37555
37609
|
"use strict";
|
|
37556
37610
|
var { tokenChars } = require_validation();
|
|
37557
37611
|
function push(dest, name, elem) {
|
|
@@ -37702,9 +37756,9 @@ var require_extension = __commonJS({
|
|
|
37702
37756
|
}
|
|
37703
37757
|
});
|
|
37704
37758
|
|
|
37705
|
-
// ../node_modules/.pnpm/ws@8.18.
|
|
37759
|
+
// ../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/websocket.js
|
|
37706
37760
|
var require_websocket = __commonJS({
|
|
37707
|
-
"../node_modules/.pnpm/ws@8.18.
|
|
37761
|
+
"../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/websocket.js"(exports, module) {
|
|
37708
37762
|
"use strict";
|
|
37709
37763
|
var EventEmitter = __require("events");
|
|
37710
37764
|
var https2 = __require("https");
|
|
@@ -38585,9 +38639,9 @@ var require_websocket = __commonJS({
|
|
|
38585
38639
|
}
|
|
38586
38640
|
});
|
|
38587
38641
|
|
|
38588
|
-
// ../node_modules/.pnpm/ws@8.18.
|
|
38642
|
+
// ../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/stream.js
|
|
38589
38643
|
var require_stream = __commonJS({
|
|
38590
|
-
"../node_modules/.pnpm/ws@8.18.
|
|
38644
|
+
"../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/stream.js"(exports, module) {
|
|
38591
38645
|
"use strict";
|
|
38592
38646
|
var WebSocket2 = require_websocket();
|
|
38593
38647
|
var { Duplex } = __require("stream");
|
|
@@ -38683,9 +38737,9 @@ var require_stream = __commonJS({
|
|
|
38683
38737
|
}
|
|
38684
38738
|
});
|
|
38685
38739
|
|
|
38686
|
-
// ../node_modules/.pnpm/ws@8.18.
|
|
38740
|
+
// ../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/subprotocol.js
|
|
38687
38741
|
var require_subprotocol = __commonJS({
|
|
38688
|
-
"../node_modules/.pnpm/ws@8.18.
|
|
38742
|
+
"../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/subprotocol.js"(exports, module) {
|
|
38689
38743
|
"use strict";
|
|
38690
38744
|
var { tokenChars } = require_validation();
|
|
38691
38745
|
function parse4(header) {
|
|
@@ -38728,9 +38782,9 @@ var require_subprotocol = __commonJS({
|
|
|
38728
38782
|
}
|
|
38729
38783
|
});
|
|
38730
38784
|
|
|
38731
|
-
// ../node_modules/.pnpm/ws@8.18.
|
|
38785
|
+
// ../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/websocket-server.js
|
|
38732
38786
|
var require_websocket_server = __commonJS({
|
|
38733
|
-
"../node_modules/.pnpm/ws@8.18.
|
|
38787
|
+
"../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/lib/websocket-server.js"(exports, module) {
|
|
38734
38788
|
"use strict";
|
|
38735
38789
|
var EventEmitter = __require("events");
|
|
38736
38790
|
var http3 = __require("http");
|
|
@@ -39115,10 +39169,10 @@ var require_websocket_server = __commonJS({
|
|
|
39115
39169
|
}
|
|
39116
39170
|
});
|
|
39117
39171
|
|
|
39118
|
-
// ../node_modules/.pnpm/ws@8.18.
|
|
39172
|
+
// ../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/wrapper.mjs
|
|
39119
39173
|
var import_stream2, import_receiver, import_sender, import_websocket, import_websocket_server, wrapper_default;
|
|
39120
39174
|
var init_wrapper = __esm({
|
|
39121
|
-
"../node_modules/.pnpm/ws@8.18.
|
|
39175
|
+
"../node_modules/.pnpm/ws@8.18.2_bufferutil@4.0.8_utf-8-validate@6.0.3/node_modules/ws/wrapper.mjs"() {
|
|
39122
39176
|
"use strict";
|
|
39123
39177
|
import_stream2 = __toESM(require_stream(), 1);
|
|
39124
39178
|
import_receiver = __toESM(require_receiver(), 1);
|
|
@@ -73251,10 +73305,7 @@ import {
|
|
|
73251
73305
|
One,
|
|
73252
73306
|
Relations as Relations2
|
|
73253
73307
|
} from "drizzle-orm/relations";
|
|
73254
|
-
import {
|
|
73255
|
-
getTableConfig as singlestoreTableConfig,
|
|
73256
|
-
SingleStoreTable
|
|
73257
|
-
} from "drizzle-orm/singlestore-core";
|
|
73308
|
+
import { getTableConfig as singlestoreTableConfig, SingleStoreTable } from "drizzle-orm/singlestore-core";
|
|
73258
73309
|
import { getTableConfig as sqliteTableConfig, SQLiteTable } from "drizzle-orm/sqlite-core";
|
|
73259
73310
|
import fs4 from "fs";
|
|
73260
73311
|
import { createServer } from "https";
|
|
@@ -73281,23 +73332,23 @@ var init_studio2 = __esm({
|
|
|
73281
73332
|
name: it.split("/").pop() || `schema${index6}.ts`,
|
|
73282
73333
|
content: fs4.readFileSync(it, "utf-8")
|
|
73283
73334
|
}));
|
|
73284
|
-
|
|
73285
|
-
|
|
73286
|
-
|
|
73287
|
-
|
|
73288
|
-
|
|
73289
|
-
|
|
73290
|
-
|
|
73291
|
-
|
|
73292
|
-
|
|
73293
|
-
|
|
73294
|
-
|
|
73295
|
-
|
|
73296
|
-
|
|
73297
|
-
|
|
73298
|
-
|
|
73299
|
-
|
|
73300
|
-
|
|
73335
|
+
await safeRegister(async () => {
|
|
73336
|
+
for (let i6 = 0; i6 < imports.length; i6++) {
|
|
73337
|
+
const it = imports[i6];
|
|
73338
|
+
const i0 = __require(`${it}`);
|
|
73339
|
+
const i0values = Object.entries(i0);
|
|
73340
|
+
i0values.forEach(([k5, t6]) => {
|
|
73341
|
+
if (is6(t6, PgTable2)) {
|
|
73342
|
+
const schema6 = pgTableConfig(t6).schema || "public";
|
|
73343
|
+
pgSchema2[schema6] = pgSchema2[schema6] || {};
|
|
73344
|
+
pgSchema2[schema6][k5] = t6;
|
|
73345
|
+
}
|
|
73346
|
+
if (is6(t6, Relations2)) {
|
|
73347
|
+
relations[k5] = t6;
|
|
73348
|
+
}
|
|
73349
|
+
});
|
|
73350
|
+
}
|
|
73351
|
+
});
|
|
73301
73352
|
return { schema: pgSchema2, relations, files };
|
|
73302
73353
|
};
|
|
73303
73354
|
prepareMySqlSchema = async (path3) => {
|
|
@@ -73311,22 +73362,22 @@ var init_studio2 = __esm({
|
|
|
73311
73362
|
name: it.split("/").pop() || `schema${index6}.ts`,
|
|
73312
73363
|
content: fs4.readFileSync(it, "utf-8")
|
|
73313
73364
|
}));
|
|
73314
|
-
|
|
73315
|
-
|
|
73316
|
-
|
|
73317
|
-
|
|
73318
|
-
|
|
73319
|
-
|
|
73320
|
-
|
|
73321
|
-
|
|
73322
|
-
|
|
73323
|
-
|
|
73324
|
-
|
|
73325
|
-
|
|
73326
|
-
|
|
73327
|
-
|
|
73328
|
-
|
|
73329
|
-
|
|
73365
|
+
await safeRegister(async () => {
|
|
73366
|
+
for (let i6 = 0; i6 < imports.length; i6++) {
|
|
73367
|
+
const it = imports[i6];
|
|
73368
|
+
const i0 = __require(`${it}`);
|
|
73369
|
+
const i0values = Object.entries(i0);
|
|
73370
|
+
i0values.forEach(([k5, t6]) => {
|
|
73371
|
+
if (is6(t6, MySqlTable)) {
|
|
73372
|
+
const schema6 = mysqlTableConfig(t6).schema || "public";
|
|
73373
|
+
mysqlSchema3[schema6][k5] = t6;
|
|
73374
|
+
}
|
|
73375
|
+
if (is6(t6, Relations2)) {
|
|
73376
|
+
relations[k5] = t6;
|
|
73377
|
+
}
|
|
73378
|
+
});
|
|
73379
|
+
}
|
|
73380
|
+
});
|
|
73330
73381
|
return { schema: mysqlSchema3, relations, files };
|
|
73331
73382
|
};
|
|
73332
73383
|
prepareSQLiteSchema = async (path3) => {
|
|
@@ -73340,22 +73391,22 @@ var init_studio2 = __esm({
|
|
|
73340
73391
|
name: it.split("/").pop() || `schema${index6}.ts`,
|
|
73341
73392
|
content: fs4.readFileSync(it, "utf-8")
|
|
73342
73393
|
}));
|
|
73343
|
-
|
|
73344
|
-
|
|
73345
|
-
|
|
73346
|
-
|
|
73347
|
-
|
|
73348
|
-
|
|
73349
|
-
|
|
73350
|
-
|
|
73351
|
-
|
|
73352
|
-
|
|
73353
|
-
|
|
73354
|
-
|
|
73355
|
-
|
|
73356
|
-
|
|
73357
|
-
|
|
73358
|
-
|
|
73394
|
+
await safeRegister(async () => {
|
|
73395
|
+
for (let i6 = 0; i6 < imports.length; i6++) {
|
|
73396
|
+
const it = imports[i6];
|
|
73397
|
+
const i0 = __require(`${it}`);
|
|
73398
|
+
const i0values = Object.entries(i0);
|
|
73399
|
+
i0values.forEach(([k5, t6]) => {
|
|
73400
|
+
if (is6(t6, SQLiteTable)) {
|
|
73401
|
+
const schema6 = "public";
|
|
73402
|
+
sqliteSchema2[schema6][k5] = t6;
|
|
73403
|
+
}
|
|
73404
|
+
if (is6(t6, Relations2)) {
|
|
73405
|
+
relations[k5] = t6;
|
|
73406
|
+
}
|
|
73407
|
+
});
|
|
73408
|
+
}
|
|
73409
|
+
});
|
|
73359
73410
|
return { schema: sqliteSchema2, relations, files };
|
|
73360
73411
|
};
|
|
73361
73412
|
prepareSingleStoreSchema = async (path3) => {
|
|
@@ -73369,22 +73420,22 @@ var init_studio2 = __esm({
|
|
|
73369
73420
|
name: it.split("/").pop() || `schema${index6}.ts`,
|
|
73370
73421
|
content: fs4.readFileSync(it, "utf-8")
|
|
73371
73422
|
}));
|
|
73372
|
-
|
|
73373
|
-
|
|
73374
|
-
|
|
73375
|
-
|
|
73376
|
-
|
|
73377
|
-
|
|
73378
|
-
|
|
73379
|
-
|
|
73380
|
-
|
|
73381
|
-
|
|
73382
|
-
|
|
73383
|
-
|
|
73384
|
-
|
|
73385
|
-
|
|
73386
|
-
|
|
73387
|
-
|
|
73423
|
+
await safeRegister(async () => {
|
|
73424
|
+
for (let i6 = 0; i6 < imports.length; i6++) {
|
|
73425
|
+
const it = imports[i6];
|
|
73426
|
+
const i0 = __require(`${it}`);
|
|
73427
|
+
const i0values = Object.entries(i0);
|
|
73428
|
+
i0values.forEach(([k5, t6]) => {
|
|
73429
|
+
if (is6(t6, SingleStoreTable)) {
|
|
73430
|
+
const schema6 = singlestoreTableConfig(t6).schema || "public";
|
|
73431
|
+
singlestoreSchema2[schema6][k5] = t6;
|
|
73432
|
+
}
|
|
73433
|
+
if (is6(t6, Relations2)) {
|
|
73434
|
+
relations[k5] = t6;
|
|
73435
|
+
}
|
|
73436
|
+
});
|
|
73437
|
+
}
|
|
73438
|
+
});
|
|
73388
73439
|
return { schema: singlestoreSchema2, relations, files };
|
|
73389
73440
|
};
|
|
73390
73441
|
getCustomDefaults = (schema6, casing2) => {
|
|
@@ -73612,7 +73663,7 @@ var init_studio2 = __esm({
|
|
|
73612
73663
|
refSchema: refSchema || "public",
|
|
73613
73664
|
refColumns
|
|
73614
73665
|
};
|
|
73615
|
-
} catch
|
|
73666
|
+
} catch {
|
|
73616
73667
|
throw new Error(
|
|
73617
73668
|
`Invalid relation "${relation.fieldName}" for table "${it.schema ? `${it.schema}.${it.dbName}` : it.dbName}"`
|
|
73618
73669
|
);
|
|
@@ -73849,15 +73900,15 @@ var init_sqliteImports = __esm({
|
|
|
73849
73900
|
prepareFromSqliteImports = async (imports) => {
|
|
73850
73901
|
const tables = [];
|
|
73851
73902
|
const views = [];
|
|
73852
|
-
|
|
73853
|
-
|
|
73854
|
-
|
|
73855
|
-
|
|
73856
|
-
|
|
73857
|
-
|
|
73858
|
-
|
|
73859
|
-
|
|
73860
|
-
|
|
73903
|
+
await safeRegister(async () => {
|
|
73904
|
+
for (let i6 = 0; i6 < imports.length; i6++) {
|
|
73905
|
+
const it = imports[i6];
|
|
73906
|
+
const i0 = __require(`${it}`);
|
|
73907
|
+
const prepared = prepareFromExports2(i0);
|
|
73908
|
+
tables.push(...prepared.tables);
|
|
73909
|
+
views.push(...prepared.views);
|
|
73910
|
+
}
|
|
73911
|
+
});
|
|
73861
73912
|
return { tables: Array.from(new Set(tables)), views };
|
|
73862
73913
|
};
|
|
73863
73914
|
}
|
|
@@ -73893,15 +73944,15 @@ var init_mysqlImports = __esm({
|
|
|
73893
73944
|
prepareFromMySqlImports = async (imports) => {
|
|
73894
73945
|
const tables = [];
|
|
73895
73946
|
const views = [];
|
|
73896
|
-
|
|
73897
|
-
|
|
73898
|
-
|
|
73899
|
-
|
|
73900
|
-
|
|
73901
|
-
|
|
73902
|
-
|
|
73903
|
-
|
|
73904
|
-
|
|
73947
|
+
await safeRegister(async () => {
|
|
73948
|
+
for (let i6 = 0; i6 < imports.length; i6++) {
|
|
73949
|
+
const it = imports[i6];
|
|
73950
|
+
const i0 = __require(`${it}`);
|
|
73951
|
+
const prepared = prepareFromExports3(i0);
|
|
73952
|
+
tables.push(...prepared.tables);
|
|
73953
|
+
views.push(...prepared.views);
|
|
73954
|
+
}
|
|
73955
|
+
});
|
|
73905
73956
|
return { tables: Array.from(new Set(tables)), views };
|
|
73906
73957
|
};
|
|
73907
73958
|
}
|
|
@@ -74238,14 +74289,14 @@ var init_singlestoreImports = __esm({
|
|
|
74238
74289
|
};
|
|
74239
74290
|
prepareFromSingleStoreImports = async (imports) => {
|
|
74240
74291
|
const tables = [];
|
|
74241
|
-
|
|
74242
|
-
|
|
74243
|
-
|
|
74244
|
-
|
|
74245
|
-
|
|
74246
|
-
|
|
74247
|
-
|
|
74248
|
-
|
|
74292
|
+
await safeRegister(async () => {
|
|
74293
|
+
for (let i6 = 0; i6 < imports.length; i6++) {
|
|
74294
|
+
const it = imports[i6];
|
|
74295
|
+
const i0 = __require(`${it}`);
|
|
74296
|
+
const prepared = prepareFromExports4(i0);
|
|
74297
|
+
tables.push(...prepared.tables);
|
|
74298
|
+
}
|
|
74299
|
+
});
|
|
74249
74300
|
return {
|
|
74250
74301
|
tables: Array.from(new Set(tables))
|
|
74251
74302
|
/* , views */
|