Database to omni/graphviz

I was looking for a tool to reverse engineer a datamodel from a database in omnigraffle. I found one or two scripts to do this… but the installation wasn’t even worth the results.

I decided to give it a go myself. Using some calls to the DatabaseMetaData object from JDBC I managed to generate the following omnigraffle diagram (I reverse engineerd the file format, easy… XML) of some of the tables and references between them from my current project (the RDBMS is postgresql):

omnigraffle output
And the full database (press the ‘x’ key to close the overlay):
full database
which Omni couldn’t layout correctly anymore…

Final layouting was done by the omnigraffle automated layout command, the rest was all generated by my application, for which the code can be found at http://svn.maas-frensch.com/pmutils/JDBCMetadataToOmni/

The application is still very rough, but since it works I’ll probably try and extend it with a more comprehensive CLI or maybe even a GUI…!

I’ve updated the application to write graphviz diagrams as well:

Graphviz output

Omnigraffle is capable of rendering graphviz files, but the native renderer seems to be a bit better at writing these sorts of huge diagrams.

This entry was posted in java. Bookmark the permalink.

8 Responses to Database to omni/graphviz

  1. arne says:

    OOoooohh. Pretty. Now make a picture of the entire database schema :)

  2. peter says:

    I’ll give it a try… not sure if I’m allowed to post it here….

  3. erikvanoosten says:

    You guys are insane! How can you work with such a huge schema!

  4. peter says:

    Easy, we use Hibernate ;-)

  5. peter says:

    Actually the schema isn’t as bad as the diagram might suggest, it’s actually a lot easier to query then the MMBase schema which is currently used to store the application data.

  6. arne says:

    Ouch, that is seriously massive. Hibernate really does a great job at hiding the complexity.

  7. peter says:

    BTW the output file is generated by using velocity templates, which should make it easy to generate any type of file

  8. arne kröger says:

    seems to be great. could you please provide a new url or check for the svn-server. it seems to be down at the moment.

    this exactly seems to be the tool i need

    thanks

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>