Mermaid ERD

This Docker image can be used to run the mermerd command-line tool, which can transform database schemas into Mermaid diagrams. The image expects the user to mount their own mermerd configuration file and a file to write the output Mermaid diagram to. When run, the container expects the user to provide a connection string to connect to a database.

Create config and result files

mermerd.yaml
Copied!
## show debug logs
debug: false

## enclose output with mermaid backticks (needed for e.g. in markdown viewer)
encloseWithMermaidBackticks: true

## omit the attribute keys (PK, FK)
omitAttributeKeys: true

## omit the constraint labels
omitConstraintLabels: true

## output file name (default "result.mmd")
outputFileName: "result.mmd"

## schema that should be used
schema:
  - your_schema

## tables to include
selectedTables:
  - your_table

## show all constraints, even though the table of the resulting constraint was not selected
showAllConstraints: true

## show enum values in description column
showEnumValues: true
touch result.mmd
Copied!

Start interactively

docker run --rm -it --net host --name mermerd \
    --mount type=bind,source="${PWD}"/mermerd.yaml,target=/root/.mermerd \
    --mount type=bind,source="${PWD}"/result.mmd,target=/root/result.mmd \
    ghcr.io/nedix/mermerd-docker \
    --connectionString "mysql://root:@tcp(host.docker.internal:3306)/mysql"
Copied!