@yawlabs/postgres-mcp 0.5.1 → 0.5.2

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 +9 -4
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -35750,16 +35750,19 @@ var adminTools = [
35750
35750
  run(
35751
35751
  // pg_sequences was added in PG10. last_value can be NULL on a never-
35752
35752
  // touched sequence; we filter those out (nothing to report yet).
35753
+ // Divide in `numeric`, not `float8`: BIGINT sequences past 2^53 lose
35754
+ // precision in float8, and the danger zone (>= threshold) is exactly
35755
+ // where the reported pct_used must stay accurate.
35753
35756
  `SELECT
35754
35757
  schemaname AS schema,
35755
35758
  sequencename AS sequence,
35756
35759
  last_value::text AS last_value,
35757
35760
  max_value::text AS max_value,
35758
- (last_value::float8 / NULLIF(max_value::float8, 0))::numeric(6, 4)::float8 AS pct_used
35761
+ (last_value::numeric / NULLIF(max_value::numeric, 0))::numeric(6, 4)::float8 AS pct_used
35759
35762
  FROM pg_catalog.pg_sequences
35760
35763
  WHERE last_value IS NOT NULL
35761
35764
  AND max_value > 0
35762
- AND (last_value::float8 / max_value::float8) >= $1
35765
+ AND (last_value::numeric / max_value::numeric) >= $1
35763
35766
  ORDER BY pct_used DESC NULLS LAST
35764
35767
  LIMIT $2`,
35765
35768
  [seqExhaustionThreshold, limit]
@@ -35898,7 +35901,8 @@ function buildHypopgHooks(indexes) {
35898
35901
  for (const idx of indexes) {
35899
35902
  const cols = idx.columns.map(quoteIdent).join(", ");
35900
35903
  const tbl = quoteQualifiedTable(idx.table);
35901
- const createSql = `CREATE INDEX ON ${tbl} USING ${idx.using} (${cols})`;
35904
+ const using = idx.using ?? "btree";
35905
+ const createSql = `CREATE INDEX ON ${tbl} USING ${using} (${cols})`;
35902
35906
  const r = await client.query(
35903
35907
  "SELECT (hypopg_create_index($1)).indexname AS indexname",
35904
35908
  [createSql]
@@ -36341,6 +36345,7 @@ var schemaTools = [
36341
36345
  }
36342
36346
  const kind = kindRes.ok ? kindRes.data?.[0]?.kind ?? "table" : "table";
36343
36347
  const warnings = [];
36348
+ if (!kindRes.ok) warnings.push(`kind fetch failed, reported as "table": ${kindRes.error}`);
36344
36349
  if (!pk.ok) warnings.push(`primary_key fetch failed: ${pk.error}`);
36345
36350
  if (!fks.ok) warnings.push(`foreign_keys fetch failed: ${fks.error}`);
36346
36351
  if (!idxs.ok) warnings.push(`indexes fetch failed: ${idxs.error}`);
@@ -36670,7 +36675,7 @@ function compareVersions(a, b) {
36670
36675
  }
36671
36676
 
36672
36677
  // src/index.ts
36673
- var version2 = true ? "0.5.1" : (await null).createRequire(import.meta.url)("../package.json").version;
36678
+ var version2 = true ? "0.5.2" : (await null).createRequire(import.meta.url)("../package.json").version;
36674
36679
  var subcommand = process.argv[2];
36675
36680
  if (subcommand === "version" || subcommand === "--version") {
36676
36681
  console.log(version2);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yawlabs/postgres-mcp",
3
- "version": "0.5.1",
3
+ "version": "0.5.2",
4
4
  "description": "PostgreSQL MCP server — query, schema introspection, explain, and health checks for AI assistants",
5
5
  "license": "MIT",
6
6
  "author": "YawLabs <contact@yaw.sh>",