Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks,
I have a set of interactions in a Database Table and now i want to draw a picture which shows the interactions.
i have done this manually using Graphviz software,but now i want to do this using a program
do any one of you know how to do this that is to convert sql to dot and send it to graphviz
I also looked at Graphviz::DBI module, it only helps to draw database schema
if some one has used it earlier please guide me
or if you have examples it will be more helpful
Thanks

Replies are listed 'Best First'.
Re: how to use Graphviz with sql
by friedo (Prior) on Jan 24, 2008 at 15:54 UTC
    The GraphViz module is what you want. It allows you do do everything that Dot does (define and label nodes and edges) but from within Perl. It should be a simple matter of getting your data via DBI and then going through it to call add_node and add_edge.
Re: how to use Graphviz with sql
by andreas1234567 (Vicar) on Jan 25, 2008 at 08:08 UTC
    I once did something like this. Below is a sample that creates a simple graph with nodes and edges showing relationships between them:
    --
    Andreas
Re: how to use Graphviz with sql
by cyocum (Curate) on Jan 25, 2008 at 16:21 UTC
    Well, I just used SQLFairy using graphviz to create a PNG schema graph for a project that I am currently working on. I think that you might have some luck using that. My command-line looked like this:
    sqlt-graph -f MySQL -o blah.png -t png blah.sql