Mermaid Erd Creation

Create entity relationship diagrams using Mermaid syntax

snoodleboot-io Updated 2 repo stars

File contents

Mermaid ERD Format

Use this format for entity relationship diagrams:

erDiagram
    USER {
        uuid id PK
        string email
        timestamp created_at
    }
    ORDER {
        uuid id PK
        uuid user_id FK
        string status
    }
    USER ||--o{ ORDER : "places"

Syntax

  • Entity name in UPPERCASE
  • Fields inside { } with: type name constraint
  • Constraints: PK (primary key), FK (foreign key)
  • Relationships: ||--o{ means "one to zero-or-many"
    • ||--|| : one to one
    • ||--o{ : one to zero-or-many
    • }o--o{ : zero-or-many to zero-or-many

When to Use

  • Include ERD in every data model design
  • Update ERD when schema changes
  • Use for documentation and stakeholder communication

snoodleboot-io/prompticorn commit b8ef180693

Frequently asked questions

npx get-skill add snoodleboot-io/mermaid-erd-creation-2