fix: preserve table coordinates across ERD renderers - #97
Open
DivyamTalwar wants to merge 1 commit into
Open
DivyamTalwar wants to merge 1 commit into
DivyamTalwar wants to merge 1 commit into
Conversation
Bare relation names and dot-concatenated schema keys collide for ordinary same-named cross-schema tables and valid identifiers containing periods. Use structured table coordinates for catalog assembly, index attachment, relationship resolution and every renderer. Keep display labels separate from identity and retain compact Mermaid IDs when unambiguous. Preserve source/target schema metadata on edges, use deterministic opaque IDs for unsafe or colliding Mermaid names, and avoid parsing FK display text as coordinates. Legacy unique-name edges remain compatible; ambiguous legacy edges do not silently guess a schema. Real renderer regressions fail on 9e41414 and the complete ERD race suite passes 20 repetitions. Add a disposable catalog fixture whose cleanup is limited to successfully created schemas. PostgreSQL/parser verification is required before publishing. No dependency or collector SQL changes.
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.
What and why
Closes #96.
Introspection read source and target schemas but discarded them from relationship endpoints. Renderers then keyed layout and edges by table name, conflating distinct relations. Preserve structured schema/table coordinates through introspection, ASCII layouts, relationship forests, HTML and Mermaid. Keep uniquely resolvable legacy names working and refuse ambiguous legacy endpoints.
Verification
Verified commit:
c3de1bf87d289472533cd3fdbfc299a9eb47f984.bash scripts/gate.sh, andgo test -race ./...pass.TestIntegrationIntrospectPreservesQualifiedTableIdentitypasses without skips on disposable PostgreSQL 14, 16 and 18, covering same names, embedded dots, quoted/Unicode schemas, index ownership and cross-schema foreign keys.Scope, risk and rollback
The change is internal to the ERD model and renderers; the versioned model.Context schema is unchanged. Complex/duplicate table names receive explicit labels and stable Mermaid identifiers. No browser visual validation is claimed. No dependencies or database migrations change. Revert this commit to restore the previous rendering.
Checklist
scripts/gate.shpasses on committed HEAD; full race suite passes.