@deaquinodev/querky 0.4.10 → 0.4.12
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/dist/index.js +5 -33
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1767,7 +1767,7 @@ function ErrorBox({ message }) {
|
|
|
1767
1767
|
// src/ui/components/Banner.tsx
|
|
1768
1768
|
import { Box as Box4, Text as Text4 } from "ink";
|
|
1769
1769
|
import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
|
|
1770
|
-
var version = true ? "0.4.
|
|
1770
|
+
var version = true ? "0.4.11" : process.env.npm_package_version ?? "unknown";
|
|
1771
1771
|
var LOGO = [
|
|
1772
1772
|
" \u2597\u2584\u2584\u2584\u2584\u2584\u2596",
|
|
1773
1773
|
"\u2590\u2591 \u25CF \u25CF \u2591\u258C",
|
|
@@ -2011,10 +2011,8 @@ function fmtHelp(data) {
|
|
|
2011
2011
|
}
|
|
2012
2012
|
function fmtErd(data) {
|
|
2013
2013
|
if (data.tables.length === 0) return dim("No tables found in the current schema.");
|
|
2014
|
-
const termW = process.stdout.columns ?? 80;
|
|
2015
2014
|
const FK_PREFIX = "FK \u2192 ";
|
|
2016
2015
|
const PAD = 1;
|
|
2017
|
-
const GAP = 2;
|
|
2018
2016
|
const colorMap = new Map(
|
|
2019
2017
|
data.tables.map((t, i) => [t.name, ERD_PALETTE[i % ERD_PALETTE.length]])
|
|
2020
2018
|
);
|
|
@@ -2057,38 +2055,12 @@ function fmtErd(data) {
|
|
|
2057
2055
|
out.push(bot);
|
|
2058
2056
|
return out;
|
|
2059
2057
|
}
|
|
2060
|
-
const rows = [];
|
|
2061
|
-
let row = [], usedW = 0;
|
|
2062
|
-
for (let i = 0; i < allMetrics.length; i++) {
|
|
2063
|
-
const w = allMetrics[i].totalW;
|
|
2064
|
-
if (row.length === 0) {
|
|
2065
|
-
row.push(i);
|
|
2066
|
-
usedW = w;
|
|
2067
|
-
} else if (usedW + GAP + w <= termW) {
|
|
2068
|
-
row.push(i);
|
|
2069
|
-
usedW += GAP + w;
|
|
2070
|
-
} else {
|
|
2071
|
-
rows.push(row);
|
|
2072
|
-
row = [i];
|
|
2073
|
-
usedW = w;
|
|
2074
|
-
}
|
|
2075
|
-
}
|
|
2076
|
-
if (row.length > 0) rows.push(row);
|
|
2077
2058
|
const output = [];
|
|
2078
|
-
|
|
2079
|
-
const
|
|
2080
|
-
|
|
2081
|
-
);
|
|
2082
|
-
const height = Math.max(...blocks.map((b) => b.length));
|
|
2083
|
-
for (let line = 0; line < height; line++) {
|
|
2084
|
-
const parts = blocks.map((b, j) => {
|
|
2085
|
-
const l = b[line] ?? " ".repeat(allMetrics[tableRow[j]].totalW);
|
|
2086
|
-
return j < blocks.length - 1 ? l + " ".repeat(GAP) : l;
|
|
2087
|
-
});
|
|
2088
|
-
output.push(parts.join(""));
|
|
2089
|
-
}
|
|
2059
|
+
data.tables.forEach((t, ti) => {
|
|
2060
|
+
const block = renderTable(t, allMetrics[ti], colorMap.get(t.name) ?? ERD_PALETTE[0]);
|
|
2061
|
+
output.push(...block);
|
|
2090
2062
|
output.push("");
|
|
2091
|
-
}
|
|
2063
|
+
});
|
|
2092
2064
|
return output.join("\n").trimEnd();
|
|
2093
2065
|
}
|
|
2094
2066
|
function fmtAi(text, error) {
|