1SQLT-GRAPH(1)         User Contributed Perl Documentation        SQLT-GRAPH(1)
2
3
4

NAME

6       sqlt-graph - Automatically create a graph from a database schema
7

SYNOPSIS

9         ./sqlt-graph -d|--db|-f|--from=db_parser [options] schema.sql
10
11         Options:
12
13           -l|--layout        Layout schema for GraphViz
14                              ("dot," "neato," "twopi"; default "dot")
15           -n|--node-shape    Shape of the nodes ("record," "plaintext,"
16                              "ellipse," "circle," "egg," "triangle," "box,"
17                              "diamond," "trapezium," "parallelogram," "house,"
18                              "hexagon," "octagon," default "record")
19           -o|--output        Output file name (default STDOUT)
20           -t|--output-type   Output file type ("canon", "text," "ps," "hpgl,"
21                              "pcl," "mif," "pic," "gd," "gd2," "gif," "jpeg,"
22                              "png," "wbmp," "cmap," "ismap," "imap," "vrml,"
23                              "vtx," "mp," "fig," "svg," "plain," default "png")
24           -c|--color         Add colors
25           --cluster          Cluster tables
26           --no-fields        Don't show field names
27           --height           Image height (in inches, default "11",
28                              set to "0" to undefine)
29           --width            Image width (in inches, default "8.5",
30                              set to "0" to undefine)
31           --fontsize         custom font size for node and edge labels
32           --fontname         name of custom font (or full path to font file) for
33                              node, edge, and graph labels
34           --nodeattr         attribute name and value (in key=val syntax) for
35                              nodes; this option may be repeated to specify
36                              multiple node attributes
37           --edgeattr         same as --nodeattr, but for edge attributes
38           --graphattr        same as --nodeattr, but for graph attributes
39           --natural-join     Perform natural joins
40           --natural-join-pk  Perform natural joins from primary keys only
41           --show-datatypes   Show datatype of each field
42           --show-sizes       Show column sizes for VARCHAR and CHAR fields
43           --show-constraints Show list of constraints for each field
44           -s|--skip          Fields to skip in natural joins
45           --skip-tables      Comma-separated list of table names to exclude
46           --skip-tables-like Comma-separated list of regexen to exclude tables
47           --debug            Print debugging information
48

DESCRIPTION

50       This script will create a graph of your schema.  Only the database
51       driver argument (for SQL::Translator) is required.  If no output file
52       name is given, then image will be printed to STDOUT, so you should
53       redirect the output into a file.
54
55       The default action is to assume the presence of foreign key
56       relationships defined via "REFERNCES" or "FOREIGN KEY" constraints on
57       the tables.  If you are parsing the schema of a file that does not have
58       these, you will find the natural join options helpful.  With natural
59       joins, like-named fields will be considered foreign keys.  This can
60       prove too permissive, however, as you probably don't want a field
61       called "name" to be considered a foreign key, so you could include it
62       in the "skip" option, and all fields called "name" will be excluded
63       from natural joins.  A more efficient method, however, might be to
64       simply deduce the foriegn keys from primary keys to other fields named
65       the same in other tables.  Use the "natural-join-pk" option to acheive
66       this.
67
68       If the schema defines foreign keys, then the graph produced will be
69       directed showing the direction of the relationship.  If the foreign
70       keys are intuited via natural joins, the graph will be undirected.
71
72       Clustering of tables allows you to group and box tables according to
73       function or domain or whatever criteria you choose.  The syntax for
74       clustering tables is:
75
76         cluster1=table1,table2;cluster2=table3,table4
77

AUTHOR

79       Ken Youens-Clark <kclark@cpan.org>.
80

SEE ALSO

82       perl, SQL::Translator.
83
84
85
86perl v5.12.0                      2009-08-18                     SQLT-GRAPH(1)
Impressum