postgresai 0.14.0-beta.14 → 0.14.0-beta.15
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/postgres-ai.ts +12 -6
- package/dist/bin/postgres-ai.js +686 -33
- package/lib/checkup-dictionary.ts +114 -0
- package/lib/checkup.ts +130 -14
- package/package.json +9 -7
- package/scripts/embed-checkup-dictionary.ts +106 -0
- package/test/checkup.test.ts +17 -18
- package/lib/metrics-embedded.ts +0 -79
package/bin/postgres-ai.ts
CHANGED
|
@@ -20,6 +20,7 @@ import { maskSecret } from "../lib/util";
|
|
|
20
20
|
import { createInterface } from "readline";
|
|
21
21
|
import * as childProcess from "child_process";
|
|
22
22
|
import { REPORT_GENERATORS, CHECK_INFO, generateAllReports } from "../lib/checkup";
|
|
23
|
+
import { getCheckupEntry } from "../lib/checkup-dictionary";
|
|
23
24
|
import { createCheckupReport, uploadCheckupReportJson, RpcError, formatRpcErrorForDisplay, withRetry } from "../lib/checkup-api";
|
|
24
25
|
|
|
25
26
|
// Singleton readline interface for stdin prompts
|
|
@@ -1644,7 +1645,7 @@ program
|
|
|
1644
1645
|
program
|
|
1645
1646
|
.command("checkup [conn]")
|
|
1646
1647
|
.description("generate health check reports directly from PostgreSQL (express mode)")
|
|
1647
|
-
.option("--check-id <id>", `specific check to run
|
|
1648
|
+
.option("--check-id <id>", `specific check to run (see list below), or ALL`, "ALL")
|
|
1648
1649
|
.option("--node-name <name>", "node name for reports", "node-01")
|
|
1649
1650
|
.option("--output <path>", "output directory for JSON files")
|
|
1650
1651
|
.option("--[no-]upload", "upload JSON results to PostgresAI (default: enabled; requires API key)", undefined)
|
|
@@ -1662,11 +1663,9 @@ program
|
|
|
1662
1663
|
"",
|
|
1663
1664
|
"Examples:",
|
|
1664
1665
|
" postgresai checkup postgresql://user:pass@host:5432/db",
|
|
1665
|
-
" postgresai checkup postgresql://user:pass@host:5432/db --check-id
|
|
1666
|
+
" postgresai checkup postgresql://user:pass@host:5432/db --check-id D001",
|
|
1666
1667
|
" postgresai checkup postgresql://user:pass@host:5432/db --output ./reports",
|
|
1667
1668
|
" postgresai checkup postgresql://user:pass@host:5432/db --project my_project",
|
|
1668
|
-
" postgresai set-default-project my_project",
|
|
1669
|
-
" postgresai checkup postgresql://user:pass@host:5432/db",
|
|
1670
1669
|
" postgresai checkup postgresql://user:pass@host:5432/db --no-upload --json",
|
|
1671
1670
|
].join("\n")
|
|
1672
1671
|
)
|
|
@@ -1725,8 +1724,15 @@ program
|
|
|
1725
1724
|
const generator = REPORT_GENERATORS[checkId];
|
|
1726
1725
|
if (!generator) {
|
|
1727
1726
|
spinner.stop();
|
|
1728
|
-
|
|
1729
|
-
|
|
1727
|
+
// Check if it's a valid check ID from the dictionary (just not implemented in express mode)
|
|
1728
|
+
const dictEntry = getCheckupEntry(checkId);
|
|
1729
|
+
if (dictEntry) {
|
|
1730
|
+
console.error(`Check ${checkId} (${dictEntry.title}) is not yet available in express mode.`);
|
|
1731
|
+
console.error(`Express-mode checks: ${Object.keys(CHECK_INFO).join(", ")}`);
|
|
1732
|
+
} else {
|
|
1733
|
+
console.error(`Unknown check ID: ${opts.checkId}`);
|
|
1734
|
+
console.error(`See 'postgresai checkup --help' for available checks.`);
|
|
1735
|
+
}
|
|
1730
1736
|
process.exitCode = 1;
|
|
1731
1737
|
return;
|
|
1732
1738
|
}
|