@indiekitai/pg-dash 0.4.2 → 0.4.3

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/README.md CHANGED
@@ -4,6 +4,8 @@
4
4
 
5
5
  **The AI-native PostgreSQL health checker.** One command to audit your database, 23 MCP tools for AI-assisted optimization, CI integration for automated checks.
6
6
 
7
+ 📖 **[Read the full writeup on Dev.to](https://dev.to/fan_yang_670d82db29664c9e/i-built-a-free-postgresql-health-checker-with-23-mcp-tools-and-ci-integration-2abc)**
8
+
7
9
  Not another monitoring dashboard — pg-dash is built to fit into your **AI coding workflow**:
8
10
 
9
11
  ```
@@ -165,6 +167,13 @@ pg-dash --host localhost --user postgres --db mydb --port 3480
165
167
 
166
168
  Opens your browser at `http://localhost:3480` with the full dashboard.
167
169
 
170
+ ## Documentation
171
+
172
+ - [Real-world example](docs/real-world-example.md) — pg-dash running against a production database
173
+ - [Migration safety guide](docs/migration-safety.md) — catching lock risks before they hit production
174
+ - [MCP setup guide](docs/mcp-setup.md) — connecting to Claude Desktop and Cursor
175
+ - [CI integration guide](docs/ci-integration.md) — automated checks in GitHub Actions
176
+
168
177
  ## CLI Options
169
178
 
170
179
  ```
package/README.zh-CN.md CHANGED
@@ -4,6 +4,8 @@
4
4
 
5
5
  **AI 原生的 PostgreSQL 健康检查工具。** 一条命令审计数据库,23 个 MCP 工具让 AI 帮你优化,CI 集成自动检查。
6
6
 
7
+ 📖 **[在 Dev.to 阅读完整介绍](https://dev.to/fan_yang_670d82db29664c9e/i-built-a-free-postgresql-health-checker-with-23-mcp-tools-and-ci-integration-2abc)**
8
+
7
9
  不是又一个监控面板 —— pg-dash 是为 **AI 编程工作流** 设计的:
8
10
 
9
11
  ```
package/dist/cli.js CHANGED
@@ -4120,7 +4120,12 @@ Environment variables:
4120
4120
  `);
4121
4121
  process.exit(0);
4122
4122
  }
4123
+ var KNOWN_SUBCOMMANDS = ["check", "check-migration", "schema-diff", "diff-env"];
4123
4124
  var subcommand = positionals[0];
4125
+ function isValidConnectionString(s) {
4126
+ return s.startsWith("postgresql://") || s.startsWith("postgres://") || s.includes("@") || // user@host shorthand
4127
+ s.includes("=");
4128
+ }
4124
4129
  function resolveConnectionString(startIdx = 0) {
4125
4130
  let connStr = positionals[startIdx];
4126
4131
  if (!connStr) {
@@ -4136,6 +4141,16 @@ function resolveConnectionString(startIdx = 0) {
4136
4141
  process.exit(1);
4137
4142
  }
4138
4143
  }
4144
+ if (!isValidConnectionString(connStr)) {
4145
+ console.error(
4146
+ `Error: "${connStr}" doesn't look like a valid connection string.
4147
+ Expected: postgresql://user:pass@host:5432/db
4148
+
4149
+ Known subcommands: ${KNOWN_SUBCOMMANDS.join(", ")}
4150
+ Run pg-dash --help for usage.`
4151
+ );
4152
+ process.exit(1);
4153
+ }
4139
4154
  return connStr;
4140
4155
  }
4141
4156
  if (subcommand === "check") {
@@ -4463,6 +4478,15 @@ Migration check: ${filePath}`);
4463
4478
  process.exit(1);
4464
4479
  }
4465
4480
  } else {
4481
+ if (subcommand && !isValidConnectionString(subcommand) && KNOWN_SUBCOMMANDS.indexOf(subcommand) === -1) {
4482
+ console.error(
4483
+ `Error: Unknown subcommand "${subcommand}".
4484
+
4485
+ Known subcommands: ${KNOWN_SUBCOMMANDS.join(", ")}
4486
+ Run pg-dash --help for usage.`
4487
+ );
4488
+ process.exit(1);
4489
+ }
4466
4490
  const connectionString = resolveConnectionString(0);
4467
4491
  const port = parseInt(values.port, 10);
4468
4492
  const bind = values.bind || process.env.PG_DASH_BIND || "127.0.0.1";