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

Allow erDiagram entity names to be quoted strings. #3171

Closed
ioquatix opened this issue Jun 23, 2022 · 3 comments · Fixed by #3516
Closed

Allow erDiagram entity names to be quoted strings. #3171

ioquatix opened this issue Jun 23, 2022 · 3 comments · Fixed by #3516
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request

Comments

@ioquatix
Copy link

In some systems, entities can be nested in modules and namespaces. This is commonly written with two :: characters, but there are other ways including slashes, etc.

It would be nice to support this by allowing quoted strings as entity names.

e.g.

erDiagram
  "Service::User" {
    string name
    string password
  }

  "Service::Log" {
    string message
  }

  "Service::User" }o--o{ "Service::Log" : has_many
@ioquatix ioquatix added Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request labels Jun 23, 2022
@ceruulean
Copy link

ceruulean commented Jul 3, 2022

There is the same issue in class diagrams, I would like to use brackets in the name

classDiagram
    "ShapeData<T>" <|-- classA

EDIT: i just realized there's a bracket escape for generics using ~

@nabe1653
Copy link

I wish too to use the special charactor in erDiagram. Bracket is needed to show mysql column type.

erDiagram
    CAR {
        int8 allowedDriver FK "The license of the allowed driver"
    }
    
This is worked.
erDiagram
    CAR {
        int(8) allowedDriver FK "The license of the allowed driver"
        "int(8)" allowedDriver FK "The license of the allowed driver"
    }
    
Both line do not work with below error:
- Expecting 'ATTRIBUTE_WORD', got '('
- Expecting 'BLOCK_STOP', 'ATTRIBUTE_WORD', got 'COMMENT'

@onetom
Copy link

onetom commented Sep 15, 2022

In Datomic-like databases (DataScript, XTDB, Datalevin...), the equivalent of table, column and column-type names are namespaced keywords, like :google.user/email, :db.type/uuid.

Furthermore, "column" definitions can have arbitrary attributes, but even the builtin attributes are numerous, so expecting only 4 columns is similarly unnecessarily limiting.

These drakonian limitation on the entity attribute syntax is overly limiting and would be wonderful, if it could be lifted!

Allowing quoting for all the fields would alleviate most of these problems and - I presume - wouldn't make the language syntax overly ambiguous.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants