I'm available to work on new projects starting October 2017! Get in touch!

Back to post list

Exporting Relations diagram from Sequel Pro

27-02-2017

If you're using Sequel Pro on a Mac, you might not be aware there is a handy trick to visualise your database. We will be able to achiev this by using Sequel Pros' export feature to a .dot file. That dot fil can then be converted to a svg, and finally the svg can optionally be converted to a png.

First, install Graphviz using their download page or via mac ports:

sudo port install graphviz

Next, in Sequel Pro go to export > Dot, choose a location and click "Export".

Go into your terminal, navigate to the folder where the dot file was stored and type the following:

dot -Tsvg database_name.dot > database_name.svg

You can already open that svg file in a browser or other compatible software (like Adobe Illustrator). But, we can go one step further, and convert the svg file to a png using ImageMagick. Make sure you have ImageMagick installed, or install it with brew (brew install ImageMagick). Run the following command to convert to a png:

convert database_name.svg database_name.png

You now have a basic visual representation of your database.

I'm available to work on new projects starting October 2017! Get in touch!

Using PHPStorm to develop php applications