Remove copyright headers from individual scripts
[dbsrgits/SQL-Translator.git] / lib / SQL / Translator / Producer / DiaUml.pm
CommitLineData
35a1938f 1package SQL::Translator::Producer::DiaUml;
2
35a1938f 3=pod
4
5=head1 NAME
6
7SQL::Translator::Producer::DiaUml -
8 Produces dia UML diagrams from schema.
9
10=head1 SYNOPSIS
11
12 use SQL::Translator;
13 my $translator = SQL::Translator->new(
14 from => 'MySQL',
15 filename => 'foo_schema.sql',
16 to => 'DiaUml',
17 );
18 print $translator->translate;
19
20=head1 DESCRIPTION
21
22Currently you will get one class (with the a table
23stereotype) generated per table in the schema. The fields are added as
24attributes of the classes and their datatypes set. It doesn't currently set any
25of the relationships. It doesn't do any layout, all the classses are in one big
26stack. However it is still useful as you can use the layout tools in Dia to
27automatically arrange them horizontally or vertically.
28
29=head2 Producer Args
30
31=over 4
32
33=back
34
35=cut
36
37# -------------------------------------------------------------------
38
39use strict;
40
da06ac74 41use vars qw[ $DEBUG $VERSION @EXPORT_OK ];
11ad2df9 42$VERSION = '1.59';
35a1938f 43$DEBUG = 0 unless defined $DEBUG;
44
6e64adbe 45use File::ShareDir qw/dist_dir/;
46
35a1938f 47use SQL::Translator::Utils 'debug';
35a1938f 48use base qw/SQL::Translator::Producer::TT::Base/;
49# Convert produce call into a method call on our class
50sub produce { return __PACKAGE__->new( translator => shift )->run; };
51
35a1938f 52sub tt_config {
6e64adbe 53 ( INCLUDE_PATH => File::Spec->catdir (dist_dir('SQL-Translator'), 'DiaUml') );
35a1938f 54}
55
56sub tt_schema { 'schema.tt2' }
57
581;
59
60# -------------------------------------------------------------------
61
62=pod
63
64=head1 AUTHOR
65
66Mark Addison E<lt>grommit@users.sourceforge.netE<gt>.
67
68=head1 TODO
69
70* Add the foriegn keys from the schema as UML relations.
71
72* Layout the classes.
73
74=head1 SEE ALSO
75
76SQL::Translator.
77
78=cut