Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking Relationship Lines to Their Columns #30

Open
TortoiseHam opened this issue Mar 1, 2024 · 5 comments
Open

Linking Relationship Lines to Their Columns #30

TortoiseHam opened this issue Mar 1, 2024 · 5 comments

Comments

@TortoiseHam
Copy link

First off, thanks for making this fork to keep the package alive.

When I generate a diagram with several tables, where Table A Column B foreign keys to Table C Column D, I had expected to get a line from B to D. Instead a line is drawn from A to C without regard for which rows of the tables contain B and D. Is this the kind of thing that might be easily fixable or is it more of a fundamental limitation of the underlying libraries being used to generate the diagram?

@maurerle
Copy link
Owner

maurerle commented Mar 6, 2024

I think I know what you mean, though I don't really know any tool which does it like that.

Seems like it is neither supported in mermaid or erd:
https://mermaid.js.org/syntax/entityRelationshipDiagram.html
https://github.com/BurntSushi/erd

It will require more fundamental changes and probably would be incompatible to the other export formats we currently support.
I might be wrong and missing something, but I am happy to be proven wrong :)

@qwenger
Copy link

qwenger commented Mar 23, 2024

I also think that would be interesting, but I share your concerns.

Also a quick note on that: compound keys would have to be handled specifically.

@TortoiseHam
Copy link
Author

Yeah, it seems like this isn't supported anywhere, which feels like a missed opportunity to me. I would think that compound keys could just be handled by using a line from each source to each target (or maybe from each source into a central line for travel and then fanning out again at the target). But if none of the underlying libraries support it then it would probably take a while to implement.

@maurerle
Copy link
Owner

Actually the ERD tool from pgAdmin4 does this
image

As can also be seen here:
https://www.pgadmin.org/docs/pgadmin4/8.5/erd_tool.html#the-table-link

Though exporting this into json and png is possible, I don't think this helps with this issue.
But you might want to consider this if this fits your needs.

@TortoiseHam
Copy link
Author

@maurerle, Awesome, thanks for pointing this out :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants