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

as graphviz is a very nice thing i like very much, i was wondering if something like sql2dot is existing for perl or written in perl (i especially wanted to use it with mysql, but also postgreSQL would be nice ;)

anyone knows about some perlscript to create graphs from sql (or more detailed: creating dot files from a sql-file or database), or is interested in writing one? (as i definitely will start to do so)

Replies are listed 'Best First'.
Re: graphviz, perl and sql2dot ?
by blokhead (Monsignor) on Oct 13, 2003 at 22:20 UTC
Re: graphviz, perl and sql2dot ?
by particle (Vicar) on Oct 13, 2003 at 22:45 UTC

    while not a general case, i wrote a small script last friday to generate images directly from an oracle database. i was going to post a link to the code, but instead i'll stick it below.

    it's a bit overkill on the argument parsing, but that's because i scavenged another script to write this, and never bothered to clean up the extra cruft. it should give you some idea how to write the sql, feed the results to GraphViz, and generate output.

    ~Particle *accelerates*

Re: graphviz, perl and sql2dot ?
by PodMaster (Abbot) on Oct 14, 2003 at 08:06 UTC