aboutsummaryrefslogtreecommitdiff
path: root/scripts/graphviz-sql.sh
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2007-09-24 18:31:42 +0000
committerRob Austein <sra@hactrn.net>2007-09-24 18:31:42 +0000
commit08303a726509e6a3f0375496fc4b2acc6ee4f215 (patch)
tree0e0dff2a6dc093b3e698f3c9a9d7342b114d50df /scripts/graphviz-sql.sh
parent8788556827db19e2490e106f6b1fb7b7c6bc7111 (diff)
Cleanup
svn path=/scripts/graphviz-sql.sh; revision=1016
Diffstat (limited to 'scripts/graphviz-sql.sh')
-rw-r--r--scripts/graphviz-sql.sh13
1 files changed, 7 insertions, 6 deletions
diff --git a/scripts/graphviz-sql.sh b/scripts/graphviz-sql.sh
index 7ff0babd..7a7cc8e9 100644
--- a/scripts/graphviz-sql.sh
+++ b/scripts/graphviz-sql.sh
@@ -2,15 +2,16 @@
# $Id$
#
# This uses the SQL::Translator package (aka "SQL Fairy") to parse
-# an SQL schema and graph the result via GraphViz.
+# a MYSQL schema and diagram the result using GraphViz.
#
# SQL::Translator appears to be pretty good at analyzing SQL, but is
# badly confused about how to format record labels in the "dot"
-# language. Simplest solution for now is just to whack sqlt-graph's
-# broken output into shape, in the long run I should send the author a
-# patch.
+# language. I should send the author a patch, but simplest solution
+# for now is just to whack sqlt-graph's broken output into shape.
+#
+# On FreeBSD, SQL Fairy is /usr/ports/databases/p5-SQL-Translator.
-for i in *.sql
+for i in "$@"
do
sqlt-graph --db MySQL --output-type canon --show-datatypes --show-constraints $i |
perl -0777 -pe '
@@ -26,5 +27,5 @@ do
' |
tee ${i%.sql}.dot |
dot -Tps2 |
- ps2pdf - ${i%.dot}.pdf
+ ps2pdf - ${i%.sql}.pdf
done