-
Notifications
You must be signed in to change notification settings - Fork 119
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
Draw column relations #72
Conversation
eralchemy/models.py
Outdated
self.left_col, | ||
return '{}{} {}--{} {}{}'.format( | ||
self.left_table, | ||
'' if self.left_column is None else '."%s"' % self.left_column, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Column names are wrapped in double quotes so that .er
files generated prior to these changes can still be parsed correctly. Without some special column delimiter, it would be hard to distinguish the cases for foo.bar
, where foo
could either be a schema or table name, and bar
could be a table or column name.
Hi @JosePVB I really like this approach as it make the relationship between classes even clearer ! |
This looks very nice - I somehow missed it. Would be good to have this as an option in the future :) |
77d6ff4
to
7030b3f
Compare
Draw relations between specific columns rather than just between the tables (because when there are multiple relations between two tables, that ends up looking very messy).
7030b3f
to
8fa193e
Compare
This PR takes advantage of Graphviz support for the PORT attribute on HTML-like labels, to draw the relationships between the specific columns in tables, as opposed to arbitrarily linking the tables together. See https://www.graphviz.org/doc/info/shapes.html#html for more information.
This PR addresses issue #55. It includes the initial work to support this feature, done by @sersorrel. I then added support for this feature in the Markdown output and updated the existing tests.
Below is an example of the what the newsmeme ER diagram looks like with these changes.