Repository navigation
feat(erd): table and column comments from the database as notes (#1279) - #1291
Merged
Merged
Conversation
The catalog reads COMMENT ON TABLE / COLUMN (PostgreSQL col_description and obj_description, MySQL column_comment and table_comment; SQLite has none). A table with a comment gets a note icon in its header whose tooltip is the comment; a column with one gets a small note icon and a 'Note:' line in its row tooltip. Cards are measured with the icons. MCP describe_table reports the comments, which tell a model what a table is for.
3 tasks
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.
Summary
First issue of stage 2 of the ERD epic (#1286). Comments written in the database are its documentation; the diagram now shows them.
col_description/obj_description, MySQLcolumn_comment/table_comment; SQLite has none. Old catalog rows without them still read.Note:line in the row's tooltip. Cards are measured with the icons.describe_tablereportscommentfor the table and its columns. That is often what tells a model what a table is for.Checked on the live PostgreSQL databases through MCP: the query runs (both functions resolve). Neither database has comments, so nothing changes visually there.
Not done: showing the table note under the header when the card is selected (it would change the card's height and the layout); the tooltip carries it instead.
Tests: comments parsed (table, column, empty, short rows, a FK keeps its comment); each dialect's SQL; header and row notes on a card with their tooltips.
Closes #1279
Test plan
COMMENT ON TABLE ... / COLUMN ...in PostgreSQL orCOMMENT '...'in MySQL, then Refresh the diagram