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

supabase / mcp / 40743757347
98%

Build:
DEFAULT BRANCH: main
Ran 28 Oct 2026 06:19PM 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

28 Oct 2026 06:17PM UTC coverage: 97.618% (+0.003%) from 97.615%
40743757347

push

github

web-flow
fix(pg-meta): order list_tables columns by ordinal position (#497)

array_agg in coalesceRowsToArray followed heap scan order, which is not
guaranteed. ALTER COLUMN rewrites a column's pg_attribute row and moves
it to the end of the heap, so list_tables could return columns out of
order. Add an optional orderBy argument to coalesceRowsToArray and use
columns.ordinal_position when building the table columns.

Adds a test that alters columns and checks the order stays the same.

## What kind of change does this PR introduce?

Bug fix

## What is the current behavior?

Fixes #496

`list_tables` (verbose) builds each table's `columns` with
`array_agg(row_to_json(columns))` and no `ORDER BY`, so the order
follows `pg_attribute` scan order. `ALTER COLUMN ... SET NOT NULL` /
`SET DEFAULT` / `TYPE` write a new `pg_attribute` row version at the end
of the heap, so that column is returned last. `ordinal_position` is
stripped from the output, so the agent can't recover the real order.

## What is the new behavior?

Columns are returned in `ordinal_position` order. `coalesceRowsToArray`
takes an optional `orderBy`, and `listTablesSql` passes
`columns.ordinal_position`. When `orderBy` is omitted, the generated SQL
is unchanged.

No change to tool names, descriptions, input/output schemas or output
shape. This is a server-only fix, so the published `tools/list` contract
is untouched.

## How to Review

<!--
A reviewer should understand what this PR does within 15-30 seconds,
then know where to start reading.

Non-trivial or multi-file PRs must fill in the reading path below.
Trivial single-file changes may delete this section when the review path
is obvious.

- Start from the main public entrypoint or request handler, and follow
the actual execution path before reading tests.
- Use bold numbered areas, each with one or two indented bullets: the
exact files, then what to inspect.
- Use exact repository-relative paths, and avoid line numbers while the
branch is still... (continued)

1065 of 1122 branches covered (94.92%)

Branch coverage included in aggregate %.

12 of 12 new or added lines in 1 file covered. (100.0%)

5657 of 5764 relevant lines covered (98.14%)

169.02 hits per line

Jobs
ID Job ID Ran Files Coverage
1 40743757347.1 28 Oct 2026 06:19PM UTC 45
97.62
GitHub Action Run
Source Files on build 40743757347
  • Tree
  • List 45
  • Changed 2
  • Source Changed 1
  • Coverage Changed 2
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #40743757347
  • c242e63b on github
  • Prev Build on main (#40687323403)
  • Next Build on main (#40855634865)
  • 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