Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
November 28, 2022 12:02 am GMT

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


Original Link: https://dev.to/sualeh/generate-good-looking-plantuml-diagrams-for-your-database-3g19

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To