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

dot character in ERD #1895

Closed
ozum opened this issue Feb 17, 2021 · 5 comments
Closed

dot character in ERD #1895

ozum opened this issue Feb 17, 2021 · 5 comments
Labels
Graph: Entity Relationship Status: Approved Is ready to be worked on Type: Bug / Error Something isn't working or is incorrect

Comments

@ozum
Copy link

ozum commented Feb 17, 2021

I can't use dot character (.) in ERD diagrams.

To Reproduce
Open live editor and put code below:

erDiagram
  public.product ||--o{ public.product_color : label
Loading

or

erDiagram
  "public.product" ||--o{ "public.product_color" : label
Loading

Got error:

Parse error on line 2:
erDiagram  "public.product" ||-
-----------^
Expecting 'EOF', 'SPACE', 'NEWLINE', 'ALPHANUM', 'open_directive', got 'WORD'

Expected behavior
I expected using quotes around text solve the problem.

  • Browser Chrome
@ozum ozum added Status: Triage Needs to be verified, categorized, etc Type: Bug / Error Something isn't working or is incorrect labels Feb 17, 2021
@Yash-Singh1 Yash-Singh1 added Status: Approved Is ready to be worked on and removed Status: Triage Needs to be verified, categorized, etc labels May 11, 2022
@zomgbre
Copy link

zomgbre commented Mar 23, 2023

This appears to still be an issue. :( I'm looking to diagram MongoDB style model which can have nested entities.

@jcdang
Copy link

jcdang commented Oct 2, 2023

I think @weedySeaDragon could speak more on this but it seems like this feature has been removed

jcdang@4bedc49
jcdang@3c1bad1

@ozum has mentioned
"public.product" ||--o{ "public.product_color" : label works

I think the approach going forward is to use AS alias but it still has an issue.

erDiagram
  public_product AS "public.product" {
  }
  public_product_color AS "public.product_color" {
  }
  public_product ||--o{ public_product_color : label
Loading

@weedySeaDragon
Copy link
Contributor

I checked the code:

  • entity name:

    • as others noted, you need to put double quotes (") around an entity name if you want anything other than letters (alpha: A-Za-z) or numbers (0-9) in the name
    • There is a note in the documentation that in the future, you can specify an alias for the name in square brackets ([]), but that's not currently implemented.
  • entity attributes:

    • right now, only letters (A-Za-z), numbers (0-9), underscore, dash, asterisk (*), square brackets ([]), and parentheses (()) are allowed. (This is the regexp:[\*A-Za-z_][A-Za-z0-9\-_\[\]\(\)). No spaces or period or quotes are allowed.

@jcdang and @zomgbre - If you need something else (like spaces or other characters in the attributes), I encourage you to submit a feature request.

@jcdang
Copy link

jcdang commented Oct 3, 2023

Thanks for the response @weedySeaDragon. Do these features need to go through some roadmap acceptance process? I would like to help but I would need to know the syntax direction so I can make appropriate changes to the grammar. I've seen multiple ways of doing aliases in mermaid and I believe it would make things easier to have a consistent escape pattern to have this feature done across all diagram models.

@weedySeaDragon
Copy link
Contributor

@jcdang I agree that having standardized ( and DRY) grammar parts would be helpful.
I know that work is being done to use langium and to pull out those common and standardized parts. And also that backward compatibility is important.
Issue #4401 has the overview and initial discussions. Look at the linked/referenced issues and PRs to see initial work.

There is a core goup of contributors that will review proposed implementations. You can open up an issue and describe a proposed solution and when that is reviewed, your solution can be discussed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Graph: Entity Relationship Status: Approved Is ready to be worked on Type: Bug / Error Something isn't working or is incorrect
Projects
None yet
Development

No branches or pull requests

5 participants