mermaid describes itself as a "Markdownish syntax" for generating entity-relationship diagrams. You can learn syntax in minutes, but it may take you longer to represent your database. SchemaCrawler generates mermaid syntax from your existing database. Then you can see what it looks like in the mermaid live editor, as well as make modifications.
Try it out. Make sure that you have Docker installed on your system, or download SchemaCrawler. Download a sample SQLite database called "chinook-database-2.0.1.sqlite" into your current directory.
Then run a command like:
docker run \
--mount type=bind,source="$(pwd)",target=/home/schcrwlr/share \
--rm -it \
schemacrawler/schemacrawler \
/opt/schemacrawler/bin/schemacrawler.sh \
--server=sqlite \
--database=share/chinook-database-2.0.1.sqlite \
--info-level=standard \
--command script \
--script-language python \
--script mermaid.py
(If you are using PowerShell on Windows, replace the trailing backslash on each line with a back-tick "`".)
Copy the output into the mermaid live editor and see what it looks like. Once you have got this working, you can connect to any database - whether Oracle, MySQL, PostgreSQL, Microsoft SQL Server, IBM DB2 or any other database that SchemaCrawler supports.
If you want to customize the script, grab the source from of "mermaid.py" from SchemaCrawler's GitHub repository, and follow instructions on the scripting gist.
To learn about how to use SchemaCrawler, download the SchemaCrawler distribution zip file and go through the examples.
Top comments (7)
Got a better example of this working see github.com/Software-Developers-IRL....
To run on windows cmd.exe:
run mermaid script, need to have the mermaid.py and sqlite file in the same directory where you launched
Package now released. You can generate sql DDLs from markdown mermaid erDiagram.
See npmjs.com/package/@funktechno/litt....
Go to killercoda.com/schemacrawler for up-to-date Schemacrawler course
linkedin.com/company/mermaid-chart/
Can you show an example of the generated diagram?
Diagram from the mermaid live editor
Hi @sualeh : could you please provide us the killercoda version ?