drizzle-kit 0.22.0-3b0ba5f → 0.22.0-3c62a84
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin.cjs +17380 -10471
- package/index.d.mts +10 -7
- package/index.d.ts +10 -7
- package/package.json +4 -3
- package/payload.d.mts +100 -18
- package/payload.d.ts +100 -18
- package/payload.js +1884 -1245
- package/payload.mjs +1910 -1262
- package/utils-studio.js +714 -21
- package/utils-studio.mjs +714 -21
- package/utils.js +52 -3
- package/utils.mjs +51 -3
package/utils-studio.mjs
CHANGED
|
@@ -34,6 +34,516 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
34
34
|
mod
|
|
35
35
|
));
|
|
36
36
|
|
|
37
|
+
// node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/ansi-styles/index.js
|
|
38
|
+
function assembleStyles() {
|
|
39
|
+
const codes = /* @__PURE__ */ new Map();
|
|
40
|
+
for (const [groupName, group] of Object.entries(styles)) {
|
|
41
|
+
for (const [styleName, style] of Object.entries(group)) {
|
|
42
|
+
styles[styleName] = {
|
|
43
|
+
open: `\x1B[${style[0]}m`,
|
|
44
|
+
close: `\x1B[${style[1]}m`
|
|
45
|
+
};
|
|
46
|
+
group[styleName] = styles[styleName];
|
|
47
|
+
codes.set(style[0], style[1]);
|
|
48
|
+
}
|
|
49
|
+
Object.defineProperty(styles, groupName, {
|
|
50
|
+
value: group,
|
|
51
|
+
enumerable: false
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
Object.defineProperty(styles, "codes", {
|
|
55
|
+
value: codes,
|
|
56
|
+
enumerable: false
|
|
57
|
+
});
|
|
58
|
+
styles.color.close = "\x1B[39m";
|
|
59
|
+
styles.bgColor.close = "\x1B[49m";
|
|
60
|
+
styles.color.ansi = wrapAnsi16();
|
|
61
|
+
styles.color.ansi256 = wrapAnsi256();
|
|
62
|
+
styles.color.ansi16m = wrapAnsi16m();
|
|
63
|
+
styles.bgColor.ansi = wrapAnsi16(ANSI_BACKGROUND_OFFSET);
|
|
64
|
+
styles.bgColor.ansi256 = wrapAnsi256(ANSI_BACKGROUND_OFFSET);
|
|
65
|
+
styles.bgColor.ansi16m = wrapAnsi16m(ANSI_BACKGROUND_OFFSET);
|
|
66
|
+
Object.defineProperties(styles, {
|
|
67
|
+
rgbToAnsi256: {
|
|
68
|
+
value(red, green, blue) {
|
|
69
|
+
if (red === green && green === blue) {
|
|
70
|
+
if (red < 8) {
|
|
71
|
+
return 16;
|
|
72
|
+
}
|
|
73
|
+
if (red > 248) {
|
|
74
|
+
return 231;
|
|
75
|
+
}
|
|
76
|
+
return Math.round((red - 8) / 247 * 24) + 232;
|
|
77
|
+
}
|
|
78
|
+
return 16 + 36 * Math.round(red / 255 * 5) + 6 * Math.round(green / 255 * 5) + Math.round(blue / 255 * 5);
|
|
79
|
+
},
|
|
80
|
+
enumerable: false
|
|
81
|
+
},
|
|
82
|
+
hexToRgb: {
|
|
83
|
+
value(hex) {
|
|
84
|
+
const matches = /[a-f\d]{6}|[a-f\d]{3}/i.exec(hex.toString(16));
|
|
85
|
+
if (!matches) {
|
|
86
|
+
return [0, 0, 0];
|
|
87
|
+
}
|
|
88
|
+
let [colorString] = matches;
|
|
89
|
+
if (colorString.length === 3) {
|
|
90
|
+
colorString = [...colorString].map((character) => character + character).join("");
|
|
91
|
+
}
|
|
92
|
+
const integer = Number.parseInt(colorString, 16);
|
|
93
|
+
return [
|
|
94
|
+
/* eslint-disable no-bitwise */
|
|
95
|
+
integer >> 16 & 255,
|
|
96
|
+
integer >> 8 & 255,
|
|
97
|
+
integer & 255
|
|
98
|
+
/* eslint-enable no-bitwise */
|
|
99
|
+
];
|
|
100
|
+
},
|
|
101
|
+
enumerable: false
|
|
102
|
+
},
|
|
103
|
+
hexToAnsi256: {
|
|
104
|
+
value: (hex) => styles.rgbToAnsi256(...styles.hexToRgb(hex)),
|
|
105
|
+
enumerable: false
|
|
106
|
+
},
|
|
107
|
+
ansi256ToAnsi: {
|
|
108
|
+
value(code) {
|
|
109
|
+
if (code < 8) {
|
|
110
|
+
return 30 + code;
|
|
111
|
+
}
|
|
112
|
+
if (code < 16) {
|
|
113
|
+
return 90 + (code - 8);
|
|
114
|
+
}
|
|
115
|
+
let red;
|
|
116
|
+
let green;
|
|
117
|
+
let blue;
|
|
118
|
+
if (code >= 232) {
|
|
119
|
+
red = ((code - 232) * 10 + 8) / 255;
|
|
120
|
+
green = red;
|
|
121
|
+
blue = red;
|
|
122
|
+
} else {
|
|
123
|
+
code -= 16;
|
|
124
|
+
const remainder = code % 36;
|
|
125
|
+
red = Math.floor(code / 36) / 5;
|
|
126
|
+
green = Math.floor(remainder / 6) / 5;
|
|
127
|
+
blue = remainder % 6 / 5;
|
|
128
|
+
}
|
|
129
|
+
const value = Math.max(red, green, blue) * 2;
|
|
130
|
+
if (value === 0) {
|
|
131
|
+
return 30;
|
|
132
|
+
}
|
|
133
|
+
let result = 30 + (Math.round(blue) << 2 | Math.round(green) << 1 | Math.round(red));
|
|
134
|
+
if (value === 2) {
|
|
135
|
+
result += 60;
|
|
136
|
+
}
|
|
137
|
+
return result;
|
|
138
|
+
},
|
|
139
|
+
enumerable: false
|
|
140
|
+
},
|
|
141
|
+
rgbToAnsi: {
|
|
142
|
+
value: (red, green, blue) => styles.ansi256ToAnsi(styles.rgbToAnsi256(red, green, blue)),
|
|
143
|
+
enumerable: false
|
|
144
|
+
},
|
|
145
|
+
hexToAnsi: {
|
|
146
|
+
value: (hex) => styles.ansi256ToAnsi(styles.hexToAnsi256(hex)),
|
|
147
|
+
enumerable: false
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
return styles;
|
|
151
|
+
}
|
|
152
|
+
var ANSI_BACKGROUND_OFFSET, wrapAnsi16, wrapAnsi256, wrapAnsi16m, styles, modifierNames, foregroundColorNames, backgroundColorNames, colorNames, ansiStyles, ansi_styles_default;
|
|
153
|
+
var init_ansi_styles = __esm({
|
|
154
|
+
"node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/ansi-styles/index.js"() {
|
|
155
|
+
ANSI_BACKGROUND_OFFSET = 10;
|
|
156
|
+
wrapAnsi16 = (offset = 0) => (code) => `\x1B[${code + offset}m`;
|
|
157
|
+
wrapAnsi256 = (offset = 0) => (code) => `\x1B[${38 + offset};5;${code}m`;
|
|
158
|
+
wrapAnsi16m = (offset = 0) => (red, green, blue) => `\x1B[${38 + offset};2;${red};${green};${blue}m`;
|
|
159
|
+
styles = {
|
|
160
|
+
modifier: {
|
|
161
|
+
reset: [0, 0],
|
|
162
|
+
// 21 isn't widely supported and 22 does the same thing
|
|
163
|
+
bold: [1, 22],
|
|
164
|
+
dim: [2, 22],
|
|
165
|
+
italic: [3, 23],
|
|
166
|
+
underline: [4, 24],
|
|
167
|
+
overline: [53, 55],
|
|
168
|
+
inverse: [7, 27],
|
|
169
|
+
hidden: [8, 28],
|
|
170
|
+
strikethrough: [9, 29]
|
|
171
|
+
},
|
|
172
|
+
color: {
|
|
173
|
+
black: [30, 39],
|
|
174
|
+
red: [31, 39],
|
|
175
|
+
green: [32, 39],
|
|
176
|
+
yellow: [33, 39],
|
|
177
|
+
blue: [34, 39],
|
|
178
|
+
magenta: [35, 39],
|
|
179
|
+
cyan: [36, 39],
|
|
180
|
+
white: [37, 39],
|
|
181
|
+
// Bright color
|
|
182
|
+
blackBright: [90, 39],
|
|
183
|
+
gray: [90, 39],
|
|
184
|
+
// Alias of `blackBright`
|
|
185
|
+
grey: [90, 39],
|
|
186
|
+
// Alias of `blackBright`
|
|
187
|
+
redBright: [91, 39],
|
|
188
|
+
greenBright: [92, 39],
|
|
189
|
+
yellowBright: [93, 39],
|
|
190
|
+
blueBright: [94, 39],
|
|
191
|
+
magentaBright: [95, 39],
|
|
192
|
+
cyanBright: [96, 39],
|
|
193
|
+
whiteBright: [97, 39]
|
|
194
|
+
},
|
|
195
|
+
bgColor: {
|
|
196
|
+
bgBlack: [40, 49],
|
|
197
|
+
bgRed: [41, 49],
|
|
198
|
+
bgGreen: [42, 49],
|
|
199
|
+
bgYellow: [43, 49],
|
|
200
|
+
bgBlue: [44, 49],
|
|
201
|
+
bgMagenta: [45, 49],
|
|
202
|
+
bgCyan: [46, 49],
|
|
203
|
+
bgWhite: [47, 49],
|
|
204
|
+
// Bright color
|
|
205
|
+
bgBlackBright: [100, 49],
|
|
206
|
+
bgGray: [100, 49],
|
|
207
|
+
// Alias of `bgBlackBright`
|
|
208
|
+
bgGrey: [100, 49],
|
|
209
|
+
// Alias of `bgBlackBright`
|
|
210
|
+
bgRedBright: [101, 49],
|
|
211
|
+
bgGreenBright: [102, 49],
|
|
212
|
+
bgYellowBright: [103, 49],
|
|
213
|
+
bgBlueBright: [104, 49],
|
|
214
|
+
bgMagentaBright: [105, 49],
|
|
215
|
+
bgCyanBright: [106, 49],
|
|
216
|
+
bgWhiteBright: [107, 49]
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
modifierNames = Object.keys(styles.modifier);
|
|
220
|
+
foregroundColorNames = Object.keys(styles.color);
|
|
221
|
+
backgroundColorNames = Object.keys(styles.bgColor);
|
|
222
|
+
colorNames = [...foregroundColorNames, ...backgroundColorNames];
|
|
223
|
+
ansiStyles = assembleStyles();
|
|
224
|
+
ansi_styles_default = ansiStyles;
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
// node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/supports-color/index.js
|
|
229
|
+
import process2 from "node:process";
|
|
230
|
+
import os from "node:os";
|
|
231
|
+
import tty from "node:tty";
|
|
232
|
+
function hasFlag(flag, argv = globalThis.Deno ? globalThis.Deno.args : process2.argv) {
|
|
233
|
+
const prefix = flag.startsWith("-") ? "" : flag.length === 1 ? "-" : "--";
|
|
234
|
+
const position = argv.indexOf(prefix + flag);
|
|
235
|
+
const terminatorPosition = argv.indexOf("--");
|
|
236
|
+
return position !== -1 && (terminatorPosition === -1 || position < terminatorPosition);
|
|
237
|
+
}
|
|
238
|
+
function envForceColor() {
|
|
239
|
+
if ("FORCE_COLOR" in env) {
|
|
240
|
+
if (env.FORCE_COLOR === "true") {
|
|
241
|
+
return 1;
|
|
242
|
+
}
|
|
243
|
+
if (env.FORCE_COLOR === "false") {
|
|
244
|
+
return 0;
|
|
245
|
+
}
|
|
246
|
+
return env.FORCE_COLOR.length === 0 ? 1 : Math.min(Number.parseInt(env.FORCE_COLOR, 10), 3);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
function translateLevel(level) {
|
|
250
|
+
if (level === 0) {
|
|
251
|
+
return false;
|
|
252
|
+
}
|
|
253
|
+
return {
|
|
254
|
+
level,
|
|
255
|
+
hasBasic: true,
|
|
256
|
+
has256: level >= 2,
|
|
257
|
+
has16m: level >= 3
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
function _supportsColor(haveStream, { streamIsTTY, sniffFlags = true } = {}) {
|
|
261
|
+
const noFlagForceColor = envForceColor();
|
|
262
|
+
if (noFlagForceColor !== void 0) {
|
|
263
|
+
flagForceColor = noFlagForceColor;
|
|
264
|
+
}
|
|
265
|
+
const forceColor = sniffFlags ? flagForceColor : noFlagForceColor;
|
|
266
|
+
if (forceColor === 0) {
|
|
267
|
+
return 0;
|
|
268
|
+
}
|
|
269
|
+
if (sniffFlags) {
|
|
270
|
+
if (hasFlag("color=16m") || hasFlag("color=full") || hasFlag("color=truecolor")) {
|
|
271
|
+
return 3;
|
|
272
|
+
}
|
|
273
|
+
if (hasFlag("color=256")) {
|
|
274
|
+
return 2;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
if ("TF_BUILD" in env && "AGENT_NAME" in env) {
|
|
278
|
+
return 1;
|
|
279
|
+
}
|
|
280
|
+
if (haveStream && !streamIsTTY && forceColor === void 0) {
|
|
281
|
+
return 0;
|
|
282
|
+
}
|
|
283
|
+
const min = forceColor || 0;
|
|
284
|
+
if (env.TERM === "dumb") {
|
|
285
|
+
return min;
|
|
286
|
+
}
|
|
287
|
+
if (process2.platform === "win32") {
|
|
288
|
+
const osRelease = os.release().split(".");
|
|
289
|
+
if (Number(osRelease[0]) >= 10 && Number(osRelease[2]) >= 10586) {
|
|
290
|
+
return Number(osRelease[2]) >= 14931 ? 3 : 2;
|
|
291
|
+
}
|
|
292
|
+
return 1;
|
|
293
|
+
}
|
|
294
|
+
if ("CI" in env) {
|
|
295
|
+
if ("GITHUB_ACTIONS" in env || "GITEA_ACTIONS" in env) {
|
|
296
|
+
return 3;
|
|
297
|
+
}
|
|
298
|
+
if (["TRAVIS", "CIRCLECI", "APPVEYOR", "GITLAB_CI", "BUILDKITE", "DRONE"].some((sign) => sign in env) || env.CI_NAME === "codeship") {
|
|
299
|
+
return 1;
|
|
300
|
+
}
|
|
301
|
+
return min;
|
|
302
|
+
}
|
|
303
|
+
if ("TEAMCITY_VERSION" in env) {
|
|
304
|
+
return /^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(env.TEAMCITY_VERSION) ? 1 : 0;
|
|
305
|
+
}
|
|
306
|
+
if (env.COLORTERM === "truecolor") {
|
|
307
|
+
return 3;
|
|
308
|
+
}
|
|
309
|
+
if (env.TERM === "xterm-kitty") {
|
|
310
|
+
return 3;
|
|
311
|
+
}
|
|
312
|
+
if ("TERM_PROGRAM" in env) {
|
|
313
|
+
const version = Number.parseInt((env.TERM_PROGRAM_VERSION || "").split(".")[0], 10);
|
|
314
|
+
switch (env.TERM_PROGRAM) {
|
|
315
|
+
case "iTerm.app": {
|
|
316
|
+
return version >= 3 ? 3 : 2;
|
|
317
|
+
}
|
|
318
|
+
case "Apple_Terminal": {
|
|
319
|
+
return 2;
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
if (/-256(color)?$/i.test(env.TERM)) {
|
|
324
|
+
return 2;
|
|
325
|
+
}
|
|
326
|
+
if (/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(env.TERM)) {
|
|
327
|
+
return 1;
|
|
328
|
+
}
|
|
329
|
+
if ("COLORTERM" in env) {
|
|
330
|
+
return 1;
|
|
331
|
+
}
|
|
332
|
+
return min;
|
|
333
|
+
}
|
|
334
|
+
function createSupportsColor(stream, options = {}) {
|
|
335
|
+
const level = _supportsColor(stream, {
|
|
336
|
+
streamIsTTY: stream && stream.isTTY,
|
|
337
|
+
...options
|
|
338
|
+
});
|
|
339
|
+
return translateLevel(level);
|
|
340
|
+
}
|
|
341
|
+
var env, flagForceColor, supportsColor, supports_color_default;
|
|
342
|
+
var init_supports_color = __esm({
|
|
343
|
+
"node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/vendor/supports-color/index.js"() {
|
|
344
|
+
({ env } = process2);
|
|
345
|
+
if (hasFlag("no-color") || hasFlag("no-colors") || hasFlag("color=false") || hasFlag("color=never")) {
|
|
346
|
+
flagForceColor = 0;
|
|
347
|
+
} else if (hasFlag("color") || hasFlag("colors") || hasFlag("color=true") || hasFlag("color=always")) {
|
|
348
|
+
flagForceColor = 1;
|
|
349
|
+
}
|
|
350
|
+
supportsColor = {
|
|
351
|
+
stdout: createSupportsColor({ isTTY: tty.isatty(1) }),
|
|
352
|
+
stderr: createSupportsColor({ isTTY: tty.isatty(2) })
|
|
353
|
+
};
|
|
354
|
+
supports_color_default = supportsColor;
|
|
355
|
+
}
|
|
356
|
+
});
|
|
357
|
+
|
|
358
|
+
// node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/utilities.js
|
|
359
|
+
function stringReplaceAll(string, substring, replacer) {
|
|
360
|
+
let index4 = string.indexOf(substring);
|
|
361
|
+
if (index4 === -1) {
|
|
362
|
+
return string;
|
|
363
|
+
}
|
|
364
|
+
const substringLength = substring.length;
|
|
365
|
+
let endIndex = 0;
|
|
366
|
+
let returnValue = "";
|
|
367
|
+
do {
|
|
368
|
+
returnValue += string.slice(endIndex, index4) + substring + replacer;
|
|
369
|
+
endIndex = index4 + substringLength;
|
|
370
|
+
index4 = string.indexOf(substring, endIndex);
|
|
371
|
+
} while (index4 !== -1);
|
|
372
|
+
returnValue += string.slice(endIndex);
|
|
373
|
+
return returnValue;
|
|
374
|
+
}
|
|
375
|
+
function stringEncaseCRLFWithFirstIndex(string, prefix, postfix, index4) {
|
|
376
|
+
let endIndex = 0;
|
|
377
|
+
let returnValue = "";
|
|
378
|
+
do {
|
|
379
|
+
const gotCR = string[index4 - 1] === "\r";
|
|
380
|
+
returnValue += string.slice(endIndex, gotCR ? index4 - 1 : index4) + prefix + (gotCR ? "\r\n" : "\n") + postfix;
|
|
381
|
+
endIndex = index4 + 1;
|
|
382
|
+
index4 = string.indexOf("\n", endIndex);
|
|
383
|
+
} while (index4 !== -1);
|
|
384
|
+
returnValue += string.slice(endIndex);
|
|
385
|
+
return returnValue;
|
|
386
|
+
}
|
|
387
|
+
var init_utilities = __esm({
|
|
388
|
+
"node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/utilities.js"() {
|
|
389
|
+
}
|
|
390
|
+
});
|
|
391
|
+
|
|
392
|
+
// node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/index.js
|
|
393
|
+
function createChalk(options) {
|
|
394
|
+
return chalkFactory(options);
|
|
395
|
+
}
|
|
396
|
+
var stdoutColor, stderrColor, GENERATOR, STYLER, IS_EMPTY, levelMapping, styles2, applyOptions, chalkFactory, getModelAnsi, usedModels, proto, createStyler, createBuilder, applyStyle, chalk, chalkStderr, source_default;
|
|
397
|
+
var init_source = __esm({
|
|
398
|
+
"node_modules/.pnpm/chalk@5.3.0/node_modules/chalk/source/index.js"() {
|
|
399
|
+
init_ansi_styles();
|
|
400
|
+
init_supports_color();
|
|
401
|
+
init_utilities();
|
|
402
|
+
({ stdout: stdoutColor, stderr: stderrColor } = supports_color_default);
|
|
403
|
+
GENERATOR = Symbol("GENERATOR");
|
|
404
|
+
STYLER = Symbol("STYLER");
|
|
405
|
+
IS_EMPTY = Symbol("IS_EMPTY");
|
|
406
|
+
levelMapping = [
|
|
407
|
+
"ansi",
|
|
408
|
+
"ansi",
|
|
409
|
+
"ansi256",
|
|
410
|
+
"ansi16m"
|
|
411
|
+
];
|
|
412
|
+
styles2 = /* @__PURE__ */ Object.create(null);
|
|
413
|
+
applyOptions = (object, options = {}) => {
|
|
414
|
+
if (options.level && !(Number.isInteger(options.level) && options.level >= 0 && options.level <= 3)) {
|
|
415
|
+
throw new Error("The `level` option should be an integer from 0 to 3");
|
|
416
|
+
}
|
|
417
|
+
const colorLevel = stdoutColor ? stdoutColor.level : 0;
|
|
418
|
+
object.level = options.level === void 0 ? colorLevel : options.level;
|
|
419
|
+
};
|
|
420
|
+
chalkFactory = (options) => {
|
|
421
|
+
const chalk2 = (...strings) => strings.join(" ");
|
|
422
|
+
applyOptions(chalk2, options);
|
|
423
|
+
Object.setPrototypeOf(chalk2, createChalk.prototype);
|
|
424
|
+
return chalk2;
|
|
425
|
+
};
|
|
426
|
+
Object.setPrototypeOf(createChalk.prototype, Function.prototype);
|
|
427
|
+
for (const [styleName, style] of Object.entries(ansi_styles_default)) {
|
|
428
|
+
styles2[styleName] = {
|
|
429
|
+
get() {
|
|
430
|
+
const builder = createBuilder(this, createStyler(style.open, style.close, this[STYLER]), this[IS_EMPTY]);
|
|
431
|
+
Object.defineProperty(this, styleName, { value: builder });
|
|
432
|
+
return builder;
|
|
433
|
+
}
|
|
434
|
+
};
|
|
435
|
+
}
|
|
436
|
+
styles2.visible = {
|
|
437
|
+
get() {
|
|
438
|
+
const builder = createBuilder(this, this[STYLER], true);
|
|
439
|
+
Object.defineProperty(this, "visible", { value: builder });
|
|
440
|
+
return builder;
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
getModelAnsi = (model, level, type, ...arguments_) => {
|
|
444
|
+
if (model === "rgb") {
|
|
445
|
+
if (level === "ansi16m") {
|
|
446
|
+
return ansi_styles_default[type].ansi16m(...arguments_);
|
|
447
|
+
}
|
|
448
|
+
if (level === "ansi256") {
|
|
449
|
+
return ansi_styles_default[type].ansi256(ansi_styles_default.rgbToAnsi256(...arguments_));
|
|
450
|
+
}
|
|
451
|
+
return ansi_styles_default[type].ansi(ansi_styles_default.rgbToAnsi(...arguments_));
|
|
452
|
+
}
|
|
453
|
+
if (model === "hex") {
|
|
454
|
+
return getModelAnsi("rgb", level, type, ...ansi_styles_default.hexToRgb(...arguments_));
|
|
455
|
+
}
|
|
456
|
+
return ansi_styles_default[type][model](...arguments_);
|
|
457
|
+
};
|
|
458
|
+
usedModels = ["rgb", "hex", "ansi256"];
|
|
459
|
+
for (const model of usedModels) {
|
|
460
|
+
styles2[model] = {
|
|
461
|
+
get() {
|
|
462
|
+
const { level } = this;
|
|
463
|
+
return function(...arguments_) {
|
|
464
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "color", ...arguments_), ansi_styles_default.color.close, this[STYLER]);
|
|
465
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
466
|
+
};
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
const bgModel = "bg" + model[0].toUpperCase() + model.slice(1);
|
|
470
|
+
styles2[bgModel] = {
|
|
471
|
+
get() {
|
|
472
|
+
const { level } = this;
|
|
473
|
+
return function(...arguments_) {
|
|
474
|
+
const styler = createStyler(getModelAnsi(model, levelMapping[level], "bgColor", ...arguments_), ansi_styles_default.bgColor.close, this[STYLER]);
|
|
475
|
+
return createBuilder(this, styler, this[IS_EMPTY]);
|
|
476
|
+
};
|
|
477
|
+
}
|
|
478
|
+
};
|
|
479
|
+
}
|
|
480
|
+
proto = Object.defineProperties(() => {
|
|
481
|
+
}, {
|
|
482
|
+
...styles2,
|
|
483
|
+
level: {
|
|
484
|
+
enumerable: true,
|
|
485
|
+
get() {
|
|
486
|
+
return this[GENERATOR].level;
|
|
487
|
+
},
|
|
488
|
+
set(level) {
|
|
489
|
+
this[GENERATOR].level = level;
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
});
|
|
493
|
+
createStyler = (open, close, parent) => {
|
|
494
|
+
let openAll;
|
|
495
|
+
let closeAll;
|
|
496
|
+
if (parent === void 0) {
|
|
497
|
+
openAll = open;
|
|
498
|
+
closeAll = close;
|
|
499
|
+
} else {
|
|
500
|
+
openAll = parent.openAll + open;
|
|
501
|
+
closeAll = close + parent.closeAll;
|
|
502
|
+
}
|
|
503
|
+
return {
|
|
504
|
+
open,
|
|
505
|
+
close,
|
|
506
|
+
openAll,
|
|
507
|
+
closeAll,
|
|
508
|
+
parent
|
|
509
|
+
};
|
|
510
|
+
};
|
|
511
|
+
createBuilder = (self2, _styler, _isEmpty) => {
|
|
512
|
+
const builder = (...arguments_) => applyStyle(builder, arguments_.length === 1 ? "" + arguments_[0] : arguments_.join(" "));
|
|
513
|
+
Object.setPrototypeOf(builder, proto);
|
|
514
|
+
builder[GENERATOR] = self2;
|
|
515
|
+
builder[STYLER] = _styler;
|
|
516
|
+
builder[IS_EMPTY] = _isEmpty;
|
|
517
|
+
return builder;
|
|
518
|
+
};
|
|
519
|
+
applyStyle = (self2, string) => {
|
|
520
|
+
if (self2.level <= 0 || !string) {
|
|
521
|
+
return self2[IS_EMPTY] ? "" : string;
|
|
522
|
+
}
|
|
523
|
+
let styler = self2[STYLER];
|
|
524
|
+
if (styler === void 0) {
|
|
525
|
+
return string;
|
|
526
|
+
}
|
|
527
|
+
const { openAll, closeAll } = styler;
|
|
528
|
+
if (string.includes("\x1B")) {
|
|
529
|
+
while (styler !== void 0) {
|
|
530
|
+
string = stringReplaceAll(string, styler.close, styler.open);
|
|
531
|
+
styler = styler.parent;
|
|
532
|
+
}
|
|
533
|
+
}
|
|
534
|
+
const lfIndex = string.indexOf("\n");
|
|
535
|
+
if (lfIndex !== -1) {
|
|
536
|
+
string = stringEncaseCRLFWithFirstIndex(string, closeAll, openAll, lfIndex);
|
|
537
|
+
}
|
|
538
|
+
return openAll + string + closeAll;
|
|
539
|
+
};
|
|
540
|
+
Object.defineProperties(createChalk.prototype, styles2);
|
|
541
|
+
chalk = createChalk();
|
|
542
|
+
chalkStderr = createChalk({ level: stderrColor ? stderrColor.level : 0 });
|
|
543
|
+
source_default = chalk;
|
|
544
|
+
}
|
|
545
|
+
});
|
|
546
|
+
|
|
37
547
|
// node_modules/.pnpm/hanji@0.0.5/node_modules/hanji/readline.js
|
|
38
548
|
var require_readline = __commonJS({
|
|
39
549
|
"node_modules/.pnpm/hanji@0.0.5/node_modules/hanji/readline.js"(exports) {
|
|
@@ -546,7 +1056,7 @@ var require_hanji = __commonJS({
|
|
|
546
1056
|
return;
|
|
547
1057
|
}
|
|
548
1058
|
exports.render = render2;
|
|
549
|
-
function
|
|
1059
|
+
function renderWithTask3(view, task) {
|
|
550
1060
|
return __awaiter(this, void 0, void 0, function* () {
|
|
551
1061
|
const terminal = new TaskTerminal(view, process.stdout);
|
|
552
1062
|
terminal.requestLayout();
|
|
@@ -555,7 +1065,7 @@ var require_hanji = __commonJS({
|
|
|
555
1065
|
return result;
|
|
556
1066
|
});
|
|
557
1067
|
}
|
|
558
|
-
exports.renderWithTask =
|
|
1068
|
+
exports.renderWithTask = renderWithTask3;
|
|
559
1069
|
var terminateHandler;
|
|
560
1070
|
function onTerminate(callback) {
|
|
561
1071
|
terminateHandler = callback;
|
|
@@ -4339,7 +4849,7 @@ var init_lib = __esm({
|
|
|
4339
4849
|
});
|
|
4340
4850
|
|
|
4341
4851
|
// src/serializer/mysqlSchema.ts
|
|
4342
|
-
var index, fk, column, tableV3, compositePK, uniqueConstraint, tableV4, table, kitInternals, dialect, schemaHash, schemaInternalV3, schemaInternalV4, schemaInternalV5, schemaInternal, schemaV3, schemaV4, schemaV5, schema, tableSquashedV4, tableSquashed, schemaSquashed, schemaSquashedV4, mysqlSchema, mysqlSchemaV5, backwardCompatibleMysqlSchema, dryMySql;
|
|
4852
|
+
var index, fk, column, tableV3, compositePK, uniqueConstraint, tableV4, table, kitInternals, dialect, schemaHash, schemaInternalV3, schemaInternalV4, schemaInternalV5, schemaInternal, schemaV3, schemaV4, schemaV5, schema, tableSquashedV4, tableSquashed, schemaSquashed, schemaSquashedV4, mysqlSchema, mysqlSchemaV5, mysqlSchemaSquashed, backwardCompatibleMysqlSchema, dryMySql;
|
|
4343
4853
|
var init_mysqlSchema = __esm({
|
|
4344
4854
|
"src/serializer/mysqlSchema.ts"() {
|
|
4345
4855
|
"use strict";
|
|
@@ -4409,7 +4919,16 @@ var init_mysqlSchema = __esm({
|
|
|
4409
4919
|
objectType({ isDefaultAnExpression: booleanType().optional() }).optional()
|
|
4410
4920
|
)
|
|
4411
4921
|
}).optional()
|
|
4412
|
-
)
|
|
4922
|
+
).optional(),
|
|
4923
|
+
indexes: recordType(
|
|
4924
|
+
stringType(),
|
|
4925
|
+
objectType({
|
|
4926
|
+
columns: recordType(
|
|
4927
|
+
stringType(),
|
|
4928
|
+
objectType({ isExpression: booleanType().optional() }).optional()
|
|
4929
|
+
)
|
|
4930
|
+
}).optional()
|
|
4931
|
+
).optional()
|
|
4413
4932
|
}).optional();
|
|
4414
4933
|
dialect = literalType("mysql");
|
|
4415
4934
|
schemaHash = objectType({
|
|
@@ -4481,6 +5000,7 @@ var init_mysqlSchema = __esm({
|
|
|
4481
5000
|
}).strict();
|
|
4482
5001
|
mysqlSchema = schema;
|
|
4483
5002
|
mysqlSchemaV5 = schemaV5;
|
|
5003
|
+
mysqlSchemaSquashed = schemaSquashed;
|
|
4484
5004
|
backwardCompatibleMysqlSchema = unionType([mysqlSchemaV5, schema]);
|
|
4485
5005
|
dryMySql = mysqlSchema.parse({
|
|
4486
5006
|
version: "5",
|
|
@@ -4828,7 +5348,7 @@ var init_pgSchema = __esm({
|
|
|
4828
5348
|
});
|
|
4829
5349
|
|
|
4830
5350
|
// src/serializer/sqliteSchema.ts
|
|
4831
|
-
var index3, fk3, compositePK3, column3, tableV33, uniqueConstraint3, table3, dialect2, schemaHash3, schemaInternalV32, schemaInternalV42, schemaInternalV52, latestVersion, schemaInternal2, schemaV32, schemaV42, schemaV52, schema2, tableSquashed3, schemaSquashed2, drySQLite, sqliteSchemaV5, backwardCompatibleSqliteSchema;
|
|
5351
|
+
var index3, fk3, compositePK3, column3, tableV33, uniqueConstraint3, table3, dialect2, schemaHash3, schemaInternalV32, schemaInternalV42, schemaInternalV52, kitInternals3, latestVersion, schemaInternal2, schemaV32, schemaV42, schemaV52, schema2, tableSquashed3, schemaSquashed2, drySQLite, sqliteSchemaV5, sqliteSchema, SQLiteSchemaSquashed, backwardCompatibleSqliteSchema;
|
|
4832
5352
|
var init_sqliteSchema = __esm({
|
|
4833
5353
|
"src/serializer/sqliteSchema.ts"() {
|
|
4834
5354
|
"use strict";
|
|
@@ -4906,6 +5426,17 @@ var init_sqliteSchema = __esm({
|
|
|
4906
5426
|
columns: recordType(stringType(), stringType())
|
|
4907
5427
|
})
|
|
4908
5428
|
}).strict();
|
|
5429
|
+
kitInternals3 = objectType({
|
|
5430
|
+
indexes: recordType(
|
|
5431
|
+
stringType(),
|
|
5432
|
+
objectType({
|
|
5433
|
+
columns: recordType(
|
|
5434
|
+
stringType(),
|
|
5435
|
+
objectType({ isExpression: booleanType().optional() }).optional()
|
|
5436
|
+
)
|
|
5437
|
+
}).optional()
|
|
5438
|
+
).optional()
|
|
5439
|
+
}).optional();
|
|
4909
5440
|
latestVersion = literalType("6");
|
|
4910
5441
|
schemaInternal2 = objectType({
|
|
4911
5442
|
version: latestVersion,
|
|
@@ -4915,7 +5446,8 @@ var init_sqliteSchema = __esm({
|
|
|
4915
5446
|
_meta: objectType({
|
|
4916
5447
|
tables: recordType(stringType(), stringType()),
|
|
4917
5448
|
columns: recordType(stringType(), stringType())
|
|
4918
|
-
})
|
|
5449
|
+
}),
|
|
5450
|
+
internal: kitInternals3
|
|
4919
5451
|
}).strict();
|
|
4920
5452
|
schemaV32 = schemaInternalV32.merge(schemaHash3).strict();
|
|
4921
5453
|
schemaV42 = schemaInternalV42.merge(schemaHash3).strict();
|
|
@@ -4948,6 +5480,8 @@ var init_sqliteSchema = __esm({
|
|
|
4948
5480
|
}
|
|
4949
5481
|
});
|
|
4950
5482
|
sqliteSchemaV5 = schemaV52;
|
|
5483
|
+
sqliteSchema = schema2;
|
|
5484
|
+
SQLiteSchemaSquashed = schemaSquashed2;
|
|
4951
5485
|
backwardCompatibleSqliteSchema = unionType([sqliteSchemaV5, schema2]);
|
|
4952
5486
|
}
|
|
4953
5487
|
});
|
|
@@ -4965,12 +5499,49 @@ var init_utils = __esm({
|
|
|
4965
5499
|
});
|
|
4966
5500
|
|
|
4967
5501
|
// src/cli/views.ts
|
|
4968
|
-
var import_hanji;
|
|
5502
|
+
var import_hanji, Spinner, ProgressView;
|
|
4969
5503
|
var init_views = __esm({
|
|
4970
5504
|
"src/cli/views.ts"() {
|
|
4971
5505
|
"use strict";
|
|
5506
|
+
init_source();
|
|
4972
5507
|
import_hanji = __toESM(require_hanji());
|
|
4973
5508
|
init_utils();
|
|
5509
|
+
Spinner = class {
|
|
5510
|
+
constructor(frames) {
|
|
5511
|
+
this.frames = frames;
|
|
5512
|
+
this.offset = 0;
|
|
5513
|
+
this.tick = () => {
|
|
5514
|
+
this.iterator();
|
|
5515
|
+
};
|
|
5516
|
+
this.value = () => {
|
|
5517
|
+
return this.frames[this.offset];
|
|
5518
|
+
};
|
|
5519
|
+
this.iterator = () => {
|
|
5520
|
+
this.offset += 1;
|
|
5521
|
+
this.offset %= frames.length - 1;
|
|
5522
|
+
};
|
|
5523
|
+
}
|
|
5524
|
+
};
|
|
5525
|
+
ProgressView = class extends import_hanji.TaskView {
|
|
5526
|
+
constructor(progressText, successText) {
|
|
5527
|
+
super();
|
|
5528
|
+
this.progressText = progressText;
|
|
5529
|
+
this.successText = successText;
|
|
5530
|
+
this.spinner = new Spinner("\u28F7\u28EF\u28DF\u287F\u28BF\u28FB\u28FD\u28FE".split(""));
|
|
5531
|
+
this.timeout = setInterval(() => {
|
|
5532
|
+
this.spinner.tick();
|
|
5533
|
+
this.requestLayout();
|
|
5534
|
+
}, 128);
|
|
5535
|
+
this.on("detach", () => clearInterval(this.timeout));
|
|
5536
|
+
}
|
|
5537
|
+
render(status) {
|
|
5538
|
+
if (status === "pending") {
|
|
5539
|
+
const spin = this.spinner.value();
|
|
5540
|
+
return `[${spin}] ${this.progressText}`;
|
|
5541
|
+
}
|
|
5542
|
+
return `[${source_default.green("\u2713")}] ${this.successText}`;
|
|
5543
|
+
}
|
|
5544
|
+
};
|
|
4974
5545
|
}
|
|
4975
5546
|
});
|
|
4976
5547
|
|
|
@@ -4983,10 +5554,100 @@ var init_serializer = __esm({
|
|
|
4983
5554
|
}
|
|
4984
5555
|
});
|
|
4985
5556
|
|
|
5557
|
+
// src/schemaValidator.ts
|
|
5558
|
+
var dialect3, commonSquashedSchema, commonSchema;
|
|
5559
|
+
var init_schemaValidator = __esm({
|
|
5560
|
+
"src/schemaValidator.ts"() {
|
|
5561
|
+
"use strict";
|
|
5562
|
+
init_lib();
|
|
5563
|
+
init_mysqlSchema();
|
|
5564
|
+
init_pgSchema();
|
|
5565
|
+
init_sqliteSchema();
|
|
5566
|
+
dialect3 = enumType(["postgresql", "mysql", "sqlite"]);
|
|
5567
|
+
commonSquashedSchema = unionType([
|
|
5568
|
+
pgSchemaSquashed,
|
|
5569
|
+
mysqlSchemaSquashed,
|
|
5570
|
+
SQLiteSchemaSquashed
|
|
5571
|
+
]);
|
|
5572
|
+
commonSchema = unionType([
|
|
5573
|
+
pgSchema2,
|
|
5574
|
+
mysqlSchema,
|
|
5575
|
+
sqliteSchema
|
|
5576
|
+
]);
|
|
5577
|
+
}
|
|
5578
|
+
});
|
|
5579
|
+
|
|
5580
|
+
// src/cli/validations/common.ts
|
|
5581
|
+
var sqliteDriversLiterals, sqliteDriver, postgresDriver, mysqlDriver, driver, configCommonSchema, casing, introspectParams, configIntrospectCliSchema, configGenerateSchema, configPushSchema;
|
|
5582
|
+
var init_common = __esm({
|
|
5583
|
+
"src/cli/validations/common.ts"() {
|
|
5584
|
+
"use strict";
|
|
5585
|
+
init_outputs();
|
|
5586
|
+
init_lib();
|
|
5587
|
+
init_schemaValidator();
|
|
5588
|
+
sqliteDriversLiterals = [
|
|
5589
|
+
literalType("turso"),
|
|
5590
|
+
literalType("d1-http"),
|
|
5591
|
+
literalType("expo")
|
|
5592
|
+
];
|
|
5593
|
+
sqliteDriver = unionType(sqliteDriversLiterals);
|
|
5594
|
+
postgresDriver = literalType("aws-data-api");
|
|
5595
|
+
mysqlDriver = literalType("mysql2");
|
|
5596
|
+
driver = unionType([sqliteDriver, postgresDriver, mysqlDriver]);
|
|
5597
|
+
configCommonSchema = objectType({
|
|
5598
|
+
dialect: dialect3,
|
|
5599
|
+
schema: unionType([stringType(), stringType().array()]).optional(),
|
|
5600
|
+
out: stringType().optional(),
|
|
5601
|
+
breakpoints: booleanType().optional().default(true),
|
|
5602
|
+
driver: driver.optional(),
|
|
5603
|
+
tablesFilter: unionType([stringType(), stringType().array()]).optional(),
|
|
5604
|
+
schemaFilter: unionType([stringType(), stringType().array()]).default(["public"])
|
|
5605
|
+
});
|
|
5606
|
+
casing = unionType([literalType("camel"), literalType("preserve")]).default(
|
|
5607
|
+
"preserve"
|
|
5608
|
+
);
|
|
5609
|
+
introspectParams = objectType({
|
|
5610
|
+
schema: unionType([stringType(), stringType().array()]).optional(),
|
|
5611
|
+
out: stringType().optional().default("./drizzle"),
|
|
5612
|
+
breakpoints: booleanType().default(true),
|
|
5613
|
+
tablesFilter: unionType([stringType(), stringType().array()]).optional(),
|
|
5614
|
+
schemaFilter: unionType([stringType(), stringType().array()]).default(["public"]),
|
|
5615
|
+
introspect: objectType({
|
|
5616
|
+
casing
|
|
5617
|
+
}).default({ casing: "camel" })
|
|
5618
|
+
});
|
|
5619
|
+
configIntrospectCliSchema = objectType({
|
|
5620
|
+
schema: unionType([stringType(), stringType().array()]).optional(),
|
|
5621
|
+
out: stringType().optional().default("./drizzle"),
|
|
5622
|
+
breakpoints: booleanType().default(true),
|
|
5623
|
+
tablesFilter: unionType([stringType(), stringType().array()]).optional(),
|
|
5624
|
+
schemaFilter: unionType([stringType(), stringType().array()]).default(["public"]),
|
|
5625
|
+
introspectCasing: unionType([literalType("camel"), literalType("preserve")]).default(
|
|
5626
|
+
"camel"
|
|
5627
|
+
)
|
|
5628
|
+
});
|
|
5629
|
+
configGenerateSchema = objectType({
|
|
5630
|
+
schema: unionType([stringType(), stringType().array()]),
|
|
5631
|
+
out: stringType().optional().default("./drizzle"),
|
|
5632
|
+
breakpoints: booleanType().default(true)
|
|
5633
|
+
});
|
|
5634
|
+
configPushSchema = objectType({
|
|
5635
|
+
dialect: dialect3,
|
|
5636
|
+
schema: unionType([stringType(), stringType().array()]),
|
|
5637
|
+
tablesFilter: unionType([stringType(), stringType().array()]).optional(),
|
|
5638
|
+
schemaFilter: unionType([stringType(), stringType().array()]).default(["public"]),
|
|
5639
|
+
verbose: booleanType().default(false),
|
|
5640
|
+
strict: booleanType().default(false),
|
|
5641
|
+
out: stringType().optional()
|
|
5642
|
+
});
|
|
5643
|
+
}
|
|
5644
|
+
});
|
|
5645
|
+
|
|
4986
5646
|
// src/cli/validations/outputs.ts
|
|
4987
5647
|
var init_outputs = __esm({
|
|
4988
5648
|
"src/cli/validations/outputs.ts"() {
|
|
4989
5649
|
"use strict";
|
|
5650
|
+
init_common();
|
|
4990
5651
|
}
|
|
4991
5652
|
});
|
|
4992
5653
|
|
|
@@ -5039,25 +5700,37 @@ function mapSqlToSqliteType(sqlType) {
|
|
|
5039
5700
|
return "numeric";
|
|
5040
5701
|
}
|
|
5041
5702
|
}
|
|
5042
|
-
var
|
|
5703
|
+
var dialect4, fromDatabase;
|
|
5043
5704
|
var init_sqliteSerializer = __esm({
|
|
5044
5705
|
"src/serializer/sqliteSerializer.ts"() {
|
|
5045
5706
|
"use strict";
|
|
5046
5707
|
init_serializer();
|
|
5047
5708
|
init_outputs();
|
|
5048
|
-
|
|
5709
|
+
dialect4 = new SQLiteSyncDialect();
|
|
5049
5710
|
fromDatabase = async (db, tablesFilter = (table4) => true, progressCallback) => {
|
|
5050
5711
|
const result = {};
|
|
5051
5712
|
const columns = await db.query(
|
|
5052
5713
|
`SELECT
|
|
5053
5714
|
m.name as "tableName", p.name as "columnName", p.type as "columnType", p."notnull" as "notNull", p.dflt_value as "defaultValue", p.pk as pk
|
|
5054
5715
|
FROM sqlite_master AS m JOIN pragma_table_info(m.name) AS p
|
|
5055
|
-
WHERE m.type = 'table'
|
|
5716
|
+
WHERE m.type = 'table'
|
|
5717
|
+
and m.tbl_name != 'sqlite_sequence'
|
|
5718
|
+
and m.tbl_name != 'sqlite_stat1'
|
|
5719
|
+
and m.tbl_name != '_litestream_seq'
|
|
5720
|
+
and m.tbl_name != '_litestream_lock'
|
|
5721
|
+
and m.tbl_name != 'libsql_wasm_func_table'
|
|
5722
|
+
and m.tbl_name != '__drizzle_migrations'
|
|
5723
|
+
and m.tbl_name != '_cf_KV';
|
|
5056
5724
|
`
|
|
5057
5725
|
);
|
|
5058
5726
|
const tablesWithSeq = [];
|
|
5059
5727
|
const seq = await db.query(
|
|
5060
|
-
`SELECT * FROM sqlite_master WHERE name != 'sqlite_sequence'
|
|
5728
|
+
`SELECT * FROM sqlite_master WHERE name != 'sqlite_sequence'
|
|
5729
|
+
and name != 'sqlite_stat1'
|
|
5730
|
+
and name != '_litestream_seq'
|
|
5731
|
+
and name != '_litestream_lock'
|
|
5732
|
+
and tbl_name != '_cf_KV'
|
|
5733
|
+
and sql GLOB '*[ *' || CHAR(9) || CHAR(10) || CHAR(13) || ']AUTOINCREMENT[^'']*';`
|
|
5061
5734
|
);
|
|
5062
5735
|
for (const s of seq) {
|
|
5063
5736
|
tablesWithSeq.push(s.name);
|
|
@@ -5142,7 +5815,8 @@ var init_sqliteSerializer = __esm({
|
|
|
5142
5815
|
try {
|
|
5143
5816
|
const fks = await db.query(
|
|
5144
5817
|
`SELECT m.name as "tableFrom", f.id as "id", f."table" as "tableTo", f."from", f."to", f."on_update" as "onUpdate", f."on_delete" as "onDelete", f.seq as "seq"
|
|
5145
|
-
FROM sqlite_master m, pragma_foreign_key_list(m.name) as f
|
|
5818
|
+
FROM sqlite_master m, pragma_foreign_key_list(m.name) as f
|
|
5819
|
+
where m.tbl_name != '_cf_KV';`
|
|
5146
5820
|
);
|
|
5147
5821
|
const fkByTableName = {};
|
|
5148
5822
|
for (const fkRow of fks) {
|
|
@@ -5201,7 +5875,9 @@ FROM sqlite_master AS m,
|
|
|
5201
5875
|
pragma_index_list(m.name) AS il,
|
|
5202
5876
|
pragma_index_info(il.name) AS ii
|
|
5203
5877
|
WHERE
|
|
5204
|
-
m.type = 'table'
|
|
5878
|
+
m.type = 'table'
|
|
5879
|
+
and il.name NOT LIKE 'sqlite_autoindex_%'
|
|
5880
|
+
and m.tbl_name != '_cf_KV';`
|
|
5205
5881
|
);
|
|
5206
5882
|
for (const idxRow of idxs) {
|
|
5207
5883
|
const tableName = idxRow.tableName;
|
|
@@ -5469,14 +6145,14 @@ import {
|
|
|
5469
6145
|
} from "drizzle-orm/pg-core";
|
|
5470
6146
|
import { getTableConfig as getTableConfig2 } from "drizzle-orm/pg-core";
|
|
5471
6147
|
import { is as is2, SQL as SQL2, getTableName as getTableName2 } from "drizzle-orm";
|
|
5472
|
-
var
|
|
6148
|
+
var dialect5, trimChar, fromDatabase2, columnToDefault, defaultForColumn;
|
|
5473
6149
|
var init_pgSerializer = __esm({
|
|
5474
6150
|
"src/serializer/pgSerializer.ts"() {
|
|
5475
6151
|
"use strict";
|
|
5476
6152
|
init_serializer();
|
|
5477
6153
|
init_outputs();
|
|
5478
6154
|
init_vector();
|
|
5479
|
-
|
|
6155
|
+
dialect5 = new PgDialect();
|
|
5480
6156
|
trimChar = (str, char) => {
|
|
5481
6157
|
let start = 0;
|
|
5482
6158
|
let end = str.length;
|
|
@@ -5739,7 +6415,7 @@ var init_pgSerializer = __esm({
|
|
|
5739
6415
|
name: columnName,
|
|
5740
6416
|
type: (
|
|
5741
6417
|
// filter vectors, but in future we should filter any extension that was installed by user
|
|
5742
|
-
columnAdditionalDT === "USER-DEFINED" &&
|
|
6418
|
+
columnAdditionalDT === "USER-DEFINED" && !["vector", "geometry"].includes(enumType3) ? enumType3 : columnTypeMapped
|
|
5743
6419
|
),
|
|
5744
6420
|
typeSchema: enumsToReturn[`${tableSchema}.${enumType3}`] !== void 0 ? enumsToReturn[`${tableSchema}.${enumType3}`].schema : void 0,
|
|
5745
6421
|
primaryKey: primaryKey.length === 1 && cprimaryKey.length < 2,
|
|
@@ -5905,6 +6581,7 @@ var init_pgSerializer = __esm({
|
|
|
5905
6581
|
"time without time zone": "::time without time zone",
|
|
5906
6582
|
// "timestamp with time zone": "::timestamp with time zone",
|
|
5907
6583
|
"timestamp without time zone": "::timestamp without time zone",
|
|
6584
|
+
"timestamp(": "::timestamp without time zone",
|
|
5908
6585
|
// date: "::date",
|
|
5909
6586
|
// interval: "::interval",
|
|
5910
6587
|
// character: "::bpchar",
|
|
@@ -5917,15 +6594,15 @@ var init_pgSerializer = __esm({
|
|
|
5917
6594
|
"character(": "::bpchar"
|
|
5918
6595
|
};
|
|
5919
6596
|
defaultForColumn = (column4) => {
|
|
6597
|
+
if (column4.column_default === null) {
|
|
6598
|
+
return void 0;
|
|
6599
|
+
}
|
|
5920
6600
|
if (column4.data_type === "serial" || column4.data_type === "smallserial" || column4.data_type === "bigserial") {
|
|
5921
6601
|
return void 0;
|
|
5922
6602
|
}
|
|
5923
6603
|
const hasDifferentDefaultCast = Object.keys(columnToDefault).find(
|
|
5924
6604
|
(it) => column4.data_type.startsWith(it)
|
|
5925
6605
|
);
|
|
5926
|
-
if (column4.column_default === null) {
|
|
5927
|
-
return void 0;
|
|
5928
|
-
}
|
|
5929
6606
|
const columnDefaultAsString = column4.column_default.toString();
|
|
5930
6607
|
if (columnDefaultAsString.endsWith(
|
|
5931
6608
|
hasDifferentDefaultCast ? columnToDefault[hasDifferentDefaultCast] : column4.data_type
|
|
@@ -7317,7 +7994,14 @@ var sqlitePushIntrospect = async (db, filters) => {
|
|
|
7317
7994
|
}
|
|
7318
7995
|
return false;
|
|
7319
7996
|
};
|
|
7320
|
-
const
|
|
7997
|
+
const progress = new ProgressView(
|
|
7998
|
+
"Pulling schema from database...",
|
|
7999
|
+
"Pulling schema from database..."
|
|
8000
|
+
);
|
|
8001
|
+
const res = await (0, import_hanji2.renderWithTask)(
|
|
8002
|
+
progress,
|
|
8003
|
+
fromDatabase(db, filter2)
|
|
8004
|
+
);
|
|
7321
8005
|
const schema3 = { id: originUUID, prevId: "", ...res };
|
|
7322
8006
|
return { schema: schema3 };
|
|
7323
8007
|
};
|
|
@@ -7325,6 +8009,8 @@ var sqlitePushIntrospect = async (db, filters) => {
|
|
|
7325
8009
|
// src/cli/commands/pgIntrospect.ts
|
|
7326
8010
|
init_pgSerializer();
|
|
7327
8011
|
init_global();
|
|
8012
|
+
init_views();
|
|
8013
|
+
var import_hanji3 = __toESM(require_hanji());
|
|
7328
8014
|
var pgPushIntrospect = async (db, filters, schemaFilters) => {
|
|
7329
8015
|
const matchers = filters.map((it) => {
|
|
7330
8016
|
return new Minimatch(it);
|
|
@@ -7339,7 +8025,14 @@ var pgPushIntrospect = async (db, filters, schemaFilters) => {
|
|
|
7339
8025
|
}
|
|
7340
8026
|
return false;
|
|
7341
8027
|
};
|
|
7342
|
-
const
|
|
8028
|
+
const progress = new ProgressView(
|
|
8029
|
+
"Pulling schema from database...",
|
|
8030
|
+
"Pulling schema from database..."
|
|
8031
|
+
);
|
|
8032
|
+
const res = await (0, import_hanji3.renderWithTask)(
|
|
8033
|
+
progress,
|
|
8034
|
+
fromDatabase2(db, filter2, schemaFilters)
|
|
8035
|
+
);
|
|
7343
8036
|
const schema3 = { id: originUUID, prevId: "", ...res };
|
|
7344
8037
|
const { internal, ...schemaWithoutInternals } = schema3;
|
|
7345
8038
|
return { schema: schemaWithoutInternals };
|