Generate (Good Looking) PlantUML Diagrams for Your Database

PlantUML is a domain-specific language to allow you to describe UML and generate diagrams, including entity-relationship diagrams (ERD). You can learn syntax in minutes, but it may take you longer to represent your database. SchemaCrawler generates Pla…


This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Sualeh Fatehi

PlantUML is a domain-specific language to allow you to describe UML and generate diagrams, including entity-relationship diagrams (ERD). You can learn syntax in minutes, but it may take you longer to represent your database. SchemaCrawler generates PlantUML ERD syntax from your existing database. Then you can see what it looks like in the PlantUML online 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 \
--title "Chinook Database Schema" \
--script-language python \
--script plantuml.py

(If you are using PowerShell on Windows, replace the trailing backslash on each line with a back-tick "`".)

Copy the output into the PlantUML online editor and see what it looks like.

It might look something like this:

PlantUML ERD

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 "plantuml.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.


This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by Sualeh Fatehi


Print Share Comment Cite Upload Translate Updates
APA

Sualeh Fatehi | Sciencx (2022-11-28T00:02:57+00:00) Generate (Good Looking) PlantUML Diagrams for Your Database. Retrieved from https://www.scien.cx/2022/11/28/generate-good-looking-plantuml-diagrams-for-your-database/

MLA
" » Generate (Good Looking) PlantUML Diagrams for Your Database." Sualeh Fatehi | Sciencx - Monday November 28, 2022, https://www.scien.cx/2022/11/28/generate-good-looking-plantuml-diagrams-for-your-database/
HARVARD
Sualeh Fatehi | Sciencx Monday November 28, 2022 » Generate (Good Looking) PlantUML Diagrams for Your Database., viewed ,<https://www.scien.cx/2022/11/28/generate-good-looking-plantuml-diagrams-for-your-database/>
VANCOUVER
Sualeh Fatehi | Sciencx - » Generate (Good Looking) PlantUML Diagrams for Your Database. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/11/28/generate-good-looking-plantuml-diagrams-for-your-database/
CHICAGO
" » Generate (Good Looking) PlantUML Diagrams for Your Database." Sualeh Fatehi | Sciencx - Accessed . https://www.scien.cx/2022/11/28/generate-good-looking-plantuml-diagrams-for-your-database/
IEEE
" » Generate (Good Looking) PlantUML Diagrams for Your Database." Sualeh Fatehi | Sciencx [Online]. Available: https://www.scien.cx/2022/11/28/generate-good-looking-plantuml-diagrams-for-your-database/. [Accessed: ]
rf:citation
» Generate (Good Looking) PlantUML Diagrams for Your Database | Sualeh Fatehi | Sciencx | https://www.scien.cx/2022/11/28/generate-good-looking-plantuml-diagrams-for-your-database/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.