@deaquinodev/querky 0.4.11 → 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.
Files changed (2) hide show
  1. package/dist/index.js +4 -32
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -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
- for (const tableRow of rows) {
2079
- const blocks = tableRow.map(
2080
- (ti) => renderTable(data.tables[ti], allMetrics[ti], colorMap.get(data.tables[ti].name) ?? ERD_PALETTE[0])
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deaquinodev/querky",
3
- "version": "0.4.11",
3
+ "version": "0.4.12",
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": [