Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

how to use Graphviz with sql

by Anonymous Monk
on Jan 24, 2008 at 15:49 UTC ( #664057=perlquestion: print w/replies, xml ) Need Help??

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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://664057]
Approved by friedo
Front-paged by grinder
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (2)
As of 2022-05-27 22:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Do you prefer to work remotely?



    Results (98 votes). Check out past polls.

    Notices?