Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

ER diagrams

sirene draws Mermaid entity relationship diagrams (erDiagram) with the same layout, themes, and outputs as flowcharts:

erDiagram
  CUSTOMER ||--o{ ORDER : places
  ORDER {
    int id PK
    string status
  }
the drawing of the mermaid source above

In the editor an ER diagram is read-only on the drawing side, as state and class diagrams are.

What is read

SyntaxDrawn as
A, "Quoted name", A[Alias], A["Alias"]a box titled with the name or alias
A { type name PK, FK "comment" }one row per attribute, in columns of type, name, keys, and comment
|o, ||, }o, }| (o|, o{, |{ mean the same, on either side)zero or one, exactly one, zero or more, one or more
--a solid line (identifying)
.., .-, -.a dotted line (non-identifying)
one or more to zero or many, only one optionally to 1+, …the same, in words; optionally to is dotted
A ||--o{ B : labelthe label in the middle; it may be quoted
List~T~ in a typeList<T>
direction, classDef, class A,B name, A:::name, styleas in flowcharts

An edge runs from the left entity to the right one. In ASCII the markers are ? (zero or one), 1 (exactly one), * (zero or more), and + (one or more), next to the entity.

Not drawn

Styling of an entity that does not exist is a warning, and the rest of the diagram is drawn.