Match inspect_database omit to neon inspect db 3.4.0 - #322
Merged
Conversation
Omitting databaseName now covers every API-listed database instead of defaulting to one.
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
databaseName is only echoed when the caller passed it, so a compute-wide omit cannot be copied into the next call.
thisistonydang
approved these changes
Aug 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
inspect_databasetreated a missingdatabaseNamethe way the other tools do: connect to the default or first database, and always echo that name back.neon inspect db3.4.0 does the opposite. Omit the name and the CLI covers every database on the branch. Pass a name to inspect one.A model that omits the name, matching the CLI, only sees one database. Locks, bloat, and table sizes in the others never appear.
Diagnosis
The SQL catalog was already shared with the CLI. The handler was the mismatch. It resolved one connection string and assembled a single-database report. The input schema said so:
The new shape follows from three facts.
Database catalogs differ. Compute-wide views (
lfc-hit-rate,working-set,replication-slots) return the same rows from every database, so omit runs them once against the first listed database.The
databasecolumn is a schema, not a count. Omit adds it even on a one-database branch so a second database does not change the fields.databaseNamein the response means the caller named a database. Omit never echoes it, including compute-wide omit, which still connects through one database. The databases that actually ran are indatabases.A combined row count is not a per-database SQL cap. 25+25 would miss the cap. 24+1 would invent one. The note fires when at least one database's batch hits the SQL
LIMIT.When
limitslices the combined rows and a later database disappears from the page, the note names which databases the returned rows still cover.Interface
Callers who pass
databaseNamekeep the previous row fields and still getdatabaseNameback. The response always includesdatabases.Callers who omit
databaseNameno longer get the default database. That is the CLI match, and it is a breaking change for that path.Empty
databaseNameis rejected:databaseName cannot be empty. Omit it to cover every database.databaseNamesetdatabasecolumndatabaseNamein responsedatabases[name][first listed]Database-scoped checks:
table-sizes,index-sizes,unused-indexes,seq-scans,long-running-queries,locks,outliers,calls,vacuum-stats,bloat,subscriptions.Compute-wide checks:
lfc-hit-rate,working-set,replication-slots.limit(default 50, max 1000) applies to the combined rows after per-database ranking and SQL caps.Named
{ "name": "inspect_database", "arguments": { "projectId": "project-id", "check": "table-sizes", "databaseName": "neondb" } }{ "check": "table-sizes", "describe": "Size of each table (including TOAST), largest first (pg_table_size)", "projectId": "project-id", "branchId": "br-id", "databaseName": "neondb", "databases": ["neondb"], "fields": ["schema", "name", "size"], "totalRowCount": 1, "rows": [{ "schema": "public", "name": "t", "size": "8 kB" }], "truncated": false }Omit, database-scoped
{ "name": "inspect_database", "arguments": { "projectId": "project-id", "check": "table-sizes" } }{ "check": "table-sizes", "describe": "Size of each table (including TOAST), largest first (pg_table_size)", "projectId": "project-id", "branchId": "br-id", "databases": ["analytics", "neondb"], "fields": ["database", "schema", "name", "size"], "totalRowCount": 2, "rows": [ { "database": "analytics", "schema": "public", "name": "a", "size": "8 kB" }, { "database": "neondb", "schema": "public", "name": "b", "size": "8 kB" } ], "truncated": false }Same shape on a one-database branch: no
databaseName,fieldsstill start withdatabase.When
limitdrops a later database from the page:An all-empty omit uses the all-database empty message, for example
No locks held in any database.A SQL cap on omit:
Named SQL-cap wording is unchanged:
at most 25 rows, and hit that cap.Omit, compute-wide
{ "name": "inspect_database", "arguments": { "projectId": "project-id", "check": "replication-slots" } }{ "check": "replication-slots", "describe": "Replication slots (compute-wide): kind, status, client, restart/confirmed-flush LSNs, and lag (pg_replication_slots + pg_stat_replication)", "projectId": "project-id", "branchId": "br-id", "databases": ["other_db"], "fields": [ "slot_name", "slot_type", "slot_kind", "status", "client_addr", "restart_lsn", "confirmed_flush_lsn", "replication_lag" ], "totalRowCount": 0, "rows": [], "truncated": false, "note": "No replication slots found." }No
databaseName. Nodatabasecolumn.databasesis the one database the check connected through.Errors
One failing database fails the whole run. On a multi-database branch the error names that database and how to narrow:
A one-database branch does not get the
Pass databaseNamehint. Named-database errors keep their previous text.Also in here
inspect_databasetool description, smoke-test notes, and CHANGELOG document the omit contract.lfc-hit-rate,working-set, andreplication-slotsdescribe strings now say compute-wide.d0c84e3to5abe208.databaseNamenow passdatabaseName: "neondb"so they still cover the named path.Verification
Unit, integration, protocol e2e, and live e2e were run on this branch. Website Playwright e2e was not.
databaseNamedatabaseeven on one databasedatabaseNamedatabaseNameis rejectedlimitapplies to the combined rows and names the databases still on the page when a later one is sliced offemptyMessageAlldatabaseName; connection errors do not get the extension hintLive e2e: omit
table-sizeson a one-database branch, omitlocksacross two databases, omitreplication-slotsagainst the first listed database, and omitoutliersfailing the run when a later database is missingpg_stat_statements.For your attention
databaseNameoff to get the default database.neondb.