You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a developer I would love to have the possibility to create a visualisation of SQL schemas with mermaid. This would mainly mean to be able to create tables with the names of the columns and their data types as well as the column constraints to indicate primary and foreign keys etc. So actual what the ERD type is. But for a foreign key it would be very nice to have an arrow to the targeting primary key of the foreign table.
As an example let's say an article can be written by only one author. This is ho it looks like currently:
erDiagram
articles {
int id PK
int author_id FK
}
authors {
int id PK
}
authors ||--o{ articles : "writes"
Loading
But the actual SQL database schema would be more accurately visualised if it would look like this, because cardinalities doesn't technically exists in an SQL database, only foreign keys exist.
As an alternative, the ERD could be made database independent and treated as something only semantically at which point a completely new type for SQL which has primary and foreign keys included and the arrow I mentioned above. Then mermaid would have one semantic diagram and one technical diagram for visualising entity relations.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
As a developer I would love to have the possibility to create a visualisation of SQL schemas with mermaid. This would mainly mean to be able to create tables with the names of the columns and their data types as well as the column constraints to indicate primary and foreign keys etc. So actual what the ERD type is. But for a foreign key it would be very nice to have an arrow to the targeting primary key of the foreign table.
As an example let's say an article can be written by only one author. This is ho it looks like currently:
But the actual SQL database schema would be more accurately visualised if it would look like this, because cardinalities doesn't technically exists in an SQL database, only foreign keys exist.
As an alternative, the ERD could be made database independent and treated as something only semantically at which point a completely new type for SQL which has primary and foreign keys included and the arrow I mentioned above. Then mermaid would have one semantic diagram and one technical diagram for visualising entity relations.
Beta Was this translation helpful? Give feedback.
All reactions