Support NOT NULL attribute key for erDiagram syntax #4429
Labels
Graph: Entity Relationship
Status: Triage
Needs to be verified, categorized, etc
Type: Enhancement
New feature or request
Proposal
Mermaid.js should add the attribute key
NN
for erDiagrams to modelNOT NULL
database columns.NOT NULL
is a widely used concept in relational databases to enforce the existence of a value for a field. Mermaid already supportsPK
,FK
andUK
, for Primary Key, Foreign Key and Unique Key attributes (https://mermaid.js.org/syntax/entityRelationshipDiagram.html#attribute-keys-and-comments) yet does not provide any facility to mark a columnNOT NULL
other than manually typing a comment for it, i.e.:The changes look fairly isolated to
mermaid/packages/mermaid/src/diagrams/er/parser/erDiagram.jison
Line 31 in cb2bc2a
Example
The new syntax would look like this:
Marking
id
,title
andisbn
allNN
asNOT NULL
.Screenshots
Current, as comment approach:
The text was updated successfully, but these errors were encountered: