• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

supabase / mcp / 41833926218
98%

Build:
DEFAULT BRANCH: main
Ran 04 Nov 2026 01:02PM UTC
Jobs 1
Files 45
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

04 Nov 2026 12:58PM UTC coverage: 97.695% (+0.002%) from 97.693%
41833926218

push

github

web-flow
fix(pg-meta): report partition FKs once and add partition_of to list_tables (#508)

Closes #507

## What kind of change does this PR introduce?

Bug fix, plus an optional `partition_of` output field.

## What is the current behavior?

`list_tables` reports the FK clones Postgres creates for partitions as
separate foreign keys, so one FK is listed once per partition. Nothing
in the output marks a partition's parent.

## What is the new behavior?

The relationships subquery filters `conparentid = 0`, the predicate
`pg_dump` uses, so each FK is reported once. FKs declared directly on a
partition are still reported.

Partitions carry `partition_of`, their immediate parent in the same
`schema.name` format as `name`, in both compact and verbose output:

```jsonc
{ "name": "public.events_2025", "rls_enabled": false, "rows": 0, "partition_of": "public.events" }
```

A sub-partition points to its own parent, not the root. Other tables
omit the field, including `INHERITS` children. A partition still names
its parent when the parent's schema isn't in `schemas`, as
`target_table` already does.

No change to tool names, descriptions or input schemas. `partition_of`
is optional in the output schema. Databases without partitioned tables
get identical output.

## How to Review

1. **Query**
   - `packages/mcp-server-supabase/src/pg-meta/tables.sql`
- One predicate in the relationships subquery. `conparentid` rather than
`relispartition`, which would also hide FKs declared on or pointing at a
partition.
- One scalar subquery for `partition_of`. It filters the parent on
`relkind = 'p'`, because `INHERITS` children also have `pg_inherits`
rows.

2. **Output**
- `packages/mcp-server-supabase/src/pg-meta/types.ts`,
`packages/mcp-server-supabase/src/tools/database-operation-tools.ts`
   - `partition_of` is omitted when null, like `comment`.

3. **Tests**
- `packages/mcp-server-supabase/src/server.database.test.ts`, next to
the composite-FK tests:
- Clones on both sides of ... (continued)

1099 of 1156 branches covered (95.07%)

Branch coverage included in aggregate %.

4 of 4 new or added lines in 2 files covered. (100.0%)

5809 of 5915 relevant lines covered (98.21%)

172.69 hits per line

Jobs
ID Job ID Ran Files Coverage
1 41833926218.1 04 Nov 2026 01:02PM UTC 45
97.69
GitHub Action Run
Source Files on build 41833926218
  • Tree
  • List 45
  • Changed 2
  • Source Changed 2
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #41833926218
  • 2c7fa824 on github
  • Prev Build on main (#41820855784)
  • Next Build on main (#41837285784)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc