.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "SQL::Translator::Producer::GraphViz 3pm" .TH SQL::Translator::Producer::GraphViz 3pm 2024-01-20 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME SQL::Translator::Producer::GraphViz \- GraphViz producer for SQL::Translator .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 1 \& use SQL::Translator; \& \& my $trans = SQL::Translator\->new( \& from => \*(AqMySQL\*(Aq, # or your db of choice \& to => \*(AqGraphViz\*(Aq, \& producer_args => { \& out_file => \*(Aqschema.png\*(Aq, \& bgcolor => \*(Aqlightgoldenrodyellow\*(Aq, \& show_constraints => 1, \& show_datatypes => 1, \& show_sizes => 1 \& } \& ) or die SQL::Translator\->error; \& \& $trans\->translate or die $trans\->error; .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" Creates a graph of a schema using the amazing graphviz (see http://www.graphviz.org/) application (via the GraphViz module). It's nifty\-\-you should try it! .SH "PRODUCER ARGS" .IX Header "PRODUCER ARGS" All GraphViz constructor attributes are accepted and passed through to "new" in GraphViz. The following defaults are assumed for some attributes: .PP .Vb 2 \& layout => \*(Aqdot\*(Aq, \& overlap => \*(Aqfalse\*(Aq, \& \& node => { \& shape => \*(Aqrecord\*(Aq, \& style => \*(Aqfilled\*(Aq, \& fillcolor => \*(Aqwhite\*(Aq, \& }, \& \& # in inches \& width => 8.5, \& height => 11, .Ve .PP See the documentation of "new" in GraphViz for more info on these and other attributes. .PP In addition this producer accepts the following arguments: .IP \(bu 4 skip_tables .Sp An arrayref or a comma-separated list of table names that should be skipped. Note that a skipped table node may still appear if another table has foreign key constraints pointing to the skipped table. If this happens no table field/index information will be included. .IP \(bu 4 skip_tables_like .Sp An arrayref or a comma-separated list of regular expressions matching table names that should be skipped. .IP \(bu 4 cluster .Sp Clustering of tables allows you to group and box tables according to function or domain or whatever criteria you choose. The syntax for clustering tables is: .Sp .Vb 1 \& cluster => \*(Aqcluster1=table1,table2;cluster2=table3,table4\*(Aq .Ve .Sp Or pass it as an arrayref like so: .Sp .Vb 1 \& cluster => [ \*(Aqcluster1=table1,table2\*(Aq, \*(Aqcluster2=table3,table4\*(Aq ] .Ve .Sp Or like so: .Sp .Vb 4 \& cluster => [ \& { name => \*(Aqcluster1\*(Aq, tables => [ \*(Aqtable1\*(Aq, \*(Aqtable2\*(Aq ] }, \& { name => \*(Aqcluster2\*(Aq, tables => [ \*(Aqtable3\*(Aq, \*(Aqtable4\*(Aq ] }, \& ] .Ve .IP \(bu 4 out_file .Sp The name of the file where the resulting GraphViz output will be written. Alternatively an open filehandle can be supplied. If undefined (the default) \- the result is returned as a string. .IP \(bu 4 output_type (DEFAULT: 'png') .Sp This determines which output method will be invoked to generate the graph: \f(CW\*(C`png\*(C'\fR translates to \&\f(CW\*(C`as_png\*(C'\fR, \f(CW\*(C`ps\*(C'\fR to \f(CW\*(C`as_ps\*(C'\fR and so on. .IP \(bu 4 fontname .Sp This sets the global font name (or full path to font file) for node, edge, and graph labels .IP \(bu 4 fontsize .Sp This sets the global font size for node and edge labels (note that arbitrarily large sizes may be ignored due to page size or graph size constraints) .IP \(bu 4 show_fields (DEFAULT: true) .Sp If set to a true value, the names of the columns in a table will be displayed in each table's node .IP \(bu 4 show_fk_only .Sp If set to a true value, only columns which are foreign keys will be displayed in each table's node .IP \(bu 4 show_datatypes .Sp If set to a true value, the datatype of each column will be displayed next to each column's name; this option will have no effect if the value of \f(CW\*(C`show_fields\*(C'\fR is set to false .IP \(bu 4 friendly_ints .Sp If set to a true value, each integer type field will be displayed as a tinyint, smallint, integer or bigint depending on the field's associated size parameter. This only applies for the \f(CW\*(C`integer\*(C'\fR type (and not the \f(CW\*(C`int\*(C'\fR type, which is always assumed to be a 32\-bit integer); this option will have no effect if the value of \&\f(CW\*(C`show_fields\*(C'\fR is set to false .IP \(bu 4 friendly_ints_extended .Sp If set to a true value, the friendly ints displayed will take into account the non-standard types, 'tinyint' and 'mediumint' (which, as far as I am aware, is only implemented in MySQL) .IP \(bu 4 show_sizes .Sp If set to a true value, the size (in bytes) of each CHAR and VARCHAR column will be displayed in parentheses next to the column's name; this option will have no effect if the value of \&\f(CW\*(C`show_fields\*(C'\fR is set to false .IP \(bu 4 show_constraints .Sp If set to a true value, a field's constraints (i.e., its primary-key-ness, its foreign-key-ness and/or its uniqueness) will appear as a comma-separated list in brackets next to the field's name; this option will have no effect if the value of \&\f(CW\*(C`show_fields\*(C'\fR is set to false .IP \(bu 4 show_indexes .Sp If set to a true value, each record will also show the indexes set on each table. It describes the index types along with which columns are included in the index. .IP \(bu 4 show_index_names (DEFAULT: true) .Sp If \f(CW\*(C`show_indexes\*(C'\fR is set to a true value, then the value of this parameter determines whether or not to print names of indexes. if \f(CW\*(C`show_index_names\*(C'\fR is false, then a list of indexed columns will appear below the field list. Otherwise, it will be a list prefixed with the name of each index. .IP \(bu 4 natural_join .Sp If set to a true value, "make_natural_joins" in SQL::Translator::Schema will be called before generating the graph. .IP \(bu 4 join_pk_only .Sp The value of this option will be passed as the value of the like-named argument to "make_natural_joins" in SQL::Translator::Schema; implies \f(CW\*(C`natural_join => 1\*(C'\fR .IP \(bu 4 skip_fields .Sp The value of this option will be passed as the value of the like-named argument to "make_natural_joins" in SQL::Translator::Schema; implies \f(CW\*(C`natural_join => 1\*(C'\fR .SS "DEPRECATED ARGS" .IX Subsection "DEPRECATED ARGS" .IP \(bu 4 node_shape .Sp Deprecated, use node => { shape => ... } instead .IP \(bu 4 add_color .Sp Deprecated, use bgcolor => 'lightgoldenrodyellow' instead .Sp If set to a true value, the graphic will have a background color of 'lightgoldenrodyellow'; otherwise the default white background will be used .IP \(bu 4 nodeattrs .Sp Deprecated, use node => { ... } instead .IP \(bu 4 edgeattrs .Sp Deprecated, use edge => { ... } instead .IP \(bu 4 graphattrs .Sp Deprecated, use graph => { ... } instead .SH AUTHOR .IX Header "AUTHOR" Ken Youens-Clark .PP Jonathan Yu .SH "SEE ALSO" .IX Header "SEE ALSO" SQL::Translator, GraphViz