maurerle / eralchemy2

Entity Relation Diagrams generation tool - DEPRECATED
https://github.com/eralchemy/eralchemy
Apache License 2.0
69 stars 16 forks source link

Linking Relationship Lines to Their Columns #30

Closed TortoiseHam closed 2 weeks ago

TortoiseHam commented 7 months ago

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 commented 7 months ago

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 commented 6 months ago

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 commented 6 months ago

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 commented 5 months ago

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 commented 5 months ago

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

maurerle commented 2 weeks ago

Fixed in eralchemy/eralchemy which is soon to be released: https://github.com/eralchemy/eralchemy