Skip to content
Stefan Kuehnel edited this page Aug 2, 2019 · 7 revisions

Create ER-Diagrams from your existing Databases easily

Motivation

In real world applications you always try to automate as much work as possible. This also applies to the generation of documentation. For Java APIs one usually uses Javadoc and for REST APIs there are also some tools around (like swagger). For documentation of large database schemas one could use reverse engineering capabilities of some data modeling tools, but mostly have to do some manual work, because the diagrams created by such tools does not have a nice layout in most cases. So I came up with the idea, to let those diagrams be generated using GraphViz because GraphViz uses some advanced layout algorithms.

Examples

I've created a program TestDBGenerator, which creates a large number of random tables with random columns. The program does not create tables directly but generates an DDL SQL (DDL - Data Definition Language) file. This program can also create input files for GraphViz in the so called .dot format. An example diagram for a database created with this program can be found in the examples folder.

Known Problems

  • With some large databases the generated .dot file may cause problems when rendering with dot (e.g. long computation times or even segmentation faults)
  • I've tested mainly with PostgreSQL and recently also with Oracle XE; with other databases types may not be recognized perfectly
Clone this wiki locally