@deaquinodev/querky 0.4.9 → 0.4.11

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.
Files changed (2) hide show
  1. package/dist/index.js +21 -22
  2. 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.9" : process.env.npm_package_version ?? "unknown";
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",
@@ -2028,23 +2028,6 @@ function fmtErd(data) {
2028
2028
  return { nameW, typeW, keyW, totalW };
2029
2029
  }
2030
2030
  const allMetrics = data.tables.map(metrics);
2031
- const rows = [];
2032
- let row = [], usedW = 0;
2033
- for (let i = 0; i < allMetrics.length; i++) {
2034
- const w = allMetrics[i].totalW;
2035
- if (row.length === 0) {
2036
- row.push(i);
2037
- usedW = w;
2038
- } else if (usedW + GAP + w <= termW) {
2039
- row.push(i);
2040
- usedW += GAP + w;
2041
- } else {
2042
- rows.push(row);
2043
- row = [i];
2044
- usedW = w;
2045
- }
2046
- }
2047
- if (row.length > 0) rows.push(row);
2048
2031
  function renderTable(t, m, color) {
2049
2032
  const { nameW, typeW, keyW, totalW } = m;
2050
2033
  const sp = " ".repeat(PAD);
@@ -2074,12 +2057,28 @@ function fmtErd(data) {
2074
2057
  out.push(bot);
2075
2058
  return out;
2076
2059
  }
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
2077
  const output = [];
2078
2078
  for (const tableRow of rows) {
2079
- const blocks = tableRow.map((ti) => {
2080
- const t = data.tables[ti];
2081
- return renderTable(t, allMetrics[ti], colorMap.get(t.name) ?? ERD_PALETTE[0]);
2082
- });
2079
+ const blocks = tableRow.map(
2080
+ (ti) => renderTable(data.tables[ti], allMetrics[ti], colorMap.get(data.tables[ti].name) ?? ERD_PALETTE[0])
2081
+ );
2083
2082
  const height = Math.max(...blocks.map((b) => b.length));
2084
2083
  for (let line = 0; line < height; line++) {
2085
2084
  const parts = blocks.map((b, j) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deaquinodev/querky",
3
- "version": "0.4.9",
3
+ "version": "0.4.11",
4
4
  "description": "A quirky terminal SQL client with vim mode, AI features, and schema-aware autocomplete",
5
5
  "main": "dist/index.js",
6
6
  "files": [