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

[ER Diagram] Use readable syntax instead of pictogram #3247

Closed
saddit opened this issue Jul 21, 2022 · 5 comments · Fixed by #3649
Closed

[ER Diagram] Use readable syntax instead of pictogram #3247

saddit opened this issue Jul 21, 2022 · 5 comments · Fixed by #3649

Comments

@saddit
Copy link

saddit commented Jul 21, 2022

Is your feature request related to a problem? Please describe.
I'm always frustrated when writing er diagram using '||--o{'

Describe the solution you'd like
Using 'one to one'/'one to many(1)'/'many(0) to many(0)' instead of '||--||'/'||-|{'/'}o--o{' or something better.

Describe alternatives you've considered
I just want a readable syntax

Additional context
I love all diagram except er. Thanks all contributors.

@saddit saddit added Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request labels Jul 21, 2022
@knsv
Copy link
Collaborator

knsv commented Aug 20, 2022

We cant change the existing syntax but it could be possible to add this as an alternate syntax.

@knsv knsv added Good first issue! Graph: Entity Relationship and removed Status: Triage Needs to be verified, categorized, etc labels Aug 20, 2022
@DKurilo
Copy link
Contributor

DKurilo commented Oct 11, 2022

I created PR and added aliases, so:

erDiagram
    CUSTOMER ||--o{ ORDER : places
    ORDER ||--|{ LINE-ITEM : contains
    CUSTOMER }|..|{ DELIVERY-ADDRESS : uses
    ADDRESS many to many CUSTOMER : have
    ZIP one or zero to many ADDRESS : have
    T1 one or zero to one or more T2 : test
    T2 one or many optionally to zero or one T3 : test
    T3 zero or more to zero or many T4 : test
    T4 many(0) to many(1) T5 : test
    T5 many optionally to one T6 : test
    T6 only one optionally to only one T1 : test
    T4 0+ to 1+ T6 : test
    T1 1 to 1 T3 : test

generates:
mermaid-er-diagram

Is it okay or do you want me to change something?

Upd: updated diagram code and image after comment from @838239178

@saddit
Copy link
Author

saddit commented Oct 12, 2022

Using 0+ or 1+ instead of zero or more maybe more concise. Whatever, thank you for your contribution.

@DKurilo
Copy link
Contributor

DKurilo commented Oct 12, 2022

Using 0+ or 1+ instead of zero or more maybe more concise. Whatever, thank you for your contribution.

okay, I added these aliases too.

    T4 0+ to 1+ T6 : test
    T1 1 to 1 T3 : test

@saddit
Copy link
Author

saddit commented Oct 12, 2022

lgtm

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

Successfully merging a pull request may close this issue.

3 participants