Repository navigation
refactor(erd): ErdSource per connection, schema-aware catalog, neighbourhood load (#1147) - #1184
Merged
Merged
Conversation
…ourhood load (#1147) ErdSource gives the whole schema or the tables within a depth of one table. The PostgreSQL catalog names tables outside the current schema schema.table and reads foreign keys across user schemas, so a reference into another schema is drawn. The neighbourhood walks foreign keys both ways up to the depth, stops on cycles and self references, and loads columns only for the tables it found. ErdView takes an optional source and a focused table. Extension SQL workspaces hide the Diagram button.
Grid scroll benchmark
Informational only (threshold 5%). Shared CI runners are noisy; re-run before trusting a single result. |
Grid scroll benchmark
Informational only (threshold 5%). Shared CI runners are noisy; re-run before trusting a single result. |
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.
Refs #1147
Changes
ErdSourcewithloadSchema()andloadNeighbourhood(table, depth).SqlErdSourceimplements it on a query runner for PostgreSQL, MySQL and SQLite.schema.table, and foreign keys are read across user schemas, so a reference into another schema is drawn with the same key as the rest of the diagram.depth, cycles and self references end the walk, columns are loaded only for the tables found. Pure functionErdCatalog.neighbourhood.ErdViewtakes an optionalsourceandfocusTable(picked and centred after the first draw). Without a source it works as before.GenericSqlWorkspace.showDiagram(default on);ExtensionSqlWorkspaceturns it off, so the extension SQL workspace has no Diagram button.Not in this PR
ErdTableReftype: names are strings in the diagram's naming, and the schema is part of the name (sales.orders) rather than a separate field.🤖 Generated with Claude Code