Skip to content

Generate Markdown with Mermaid ERD inclusive

1. Generate mermaid ERD content

dbterd run -t mermaid -ad "samples/dbtresto" -s schema:dbt.mart 2023-05-06 08:17:54,413 - dbterd - INFO - Run with dbterd==?.?.? (main.py:54) 2023-05-06 08:17:54,715 - dbterd - INFO - target/output.md (base.py:75)

2. Copy mermaid to ERD.md

Linux/MacOs

We'll use echo and cat to copy content over into the target Markdown file.

echo \`\`\`mermaid > ./samples/dbtresto/ERD.md echo --- >> ./samples/dbtresto/ERD.md echo title: Sample ERD >> ./samples/dbtresto/ERD.md echo --- >> ./samples/dbtresto/ERD.md cat ./target/output.md >> ./samples/dbtresto/ERD.md echo \`\`\` >> ./samples/dbtresto/ERD.md

3. Commit it and check it on Github

Check out the sample output:

erd