From: Arthur Axel 'fREW' Schmidt Date: Sat, 26 Feb 2011 06:07:38 +0000 (-0600) Subject: take out duplicate docs X-Git-Tag: v0.11011~71 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=282bf498899061be19ec7fd7ce16bf25a562fdcf;p=dbsrgits%2FSQL-Translator.git take out duplicate docs --- diff --git a/lib/SQL/Translator.pm b/lib/SQL/Translator.pm index 371e62a..988722d 100644 --- a/lib/SQL/Translator.pm +++ b/lib/SQL/Translator.pm @@ -38,26 +38,8 @@ use IO::Dir; use SQL::Translator::Producer; use SQL::Translator::Schema; -# ---------------------------------------------------------------------- -# The default behavior is to "pass through" values (note that the -# SQL::Translator instance is the first value ($_[0]), and the stuff -# to be parsed is the second value ($_[1]) -# ---------------------------------------------------------------------- $DEFAULT_SUB = sub { $_[0]->schema } unless defined $DEFAULT_SUB; -# ---------------------------------------------------------------------- -# init([ARGS]) -# The constructor. -# -# new takes an optional hash of arguments. These arguments may -# include a parser, specified with the keys "parser" or "from", -# and a producer, specified with the keys "producer" or "to". -# -# The values that can be passed as the parser or producer are -# given directly to the parser or producer methods, respectively. -# See the appropriate method description below for details about -# what each expects/accepts. -# ---------------------------------------------------------------------- sub init { my ( $self, $config ) = @_; # @@ -131,9 +113,6 @@ sub init { return $self; } -# ---------------------------------------------------------------------- -# add_drop_table([$bool]) -# ---------------------------------------------------------------------- sub add_drop_table { my $self = shift; if ( defined (my $arg = shift) ) { @@ -142,9 +121,6 @@ sub add_drop_table { return $self->{'add_drop_table'} || 0; } -# ---------------------------------------------------------------------- -# no_comments([$bool]) -# ---------------------------------------------------------------------- sub no_comments { my $self = shift; my $arg = shift; @@ -154,10 +130,6 @@ sub no_comments { return $self->{'no_comments'} || 0; } - -# ---------------------------------------------------------------------- -# quote_table_names([$bool]) -# ---------------------------------------------------------------------- sub quote_table_names { my $self = shift; if ( defined (my $arg = shift) ) { @@ -166,9 +138,6 @@ sub quote_table_names { return $self->{'quote_table_names'} || 0; } -# ---------------------------------------------------------------------- -# quote_field_names([$bool]) -# ---------------------------------------------------------------------- sub quote_field_names { my $self = shift; if ( defined (my $arg = shift) ) { @@ -177,11 +146,6 @@ sub quote_field_names { return $self->{'quote_field_names'} || 0; } -# ---------------------------------------------------------------------- -# producer([$producer_spec]) -# -# Get or set the producer for the current translator. -# ---------------------------------------------------------------------- sub producer { shift->_tool({ name => 'producer', @@ -190,32 +154,10 @@ sub producer { }, @_); } -# ---------------------------------------------------------------------- -# producer_type() -# -# producer_type is an accessor that allows producer subs to get -# information about their origin. This is poptentially important; -# since all producer subs are called as subroutine references, there is -# no way for a producer to find out which package the sub lives in -# originally, for example. -# ---------------------------------------------------------------------- sub producer_type { $_[0]->{'producer_type'} } -# ---------------------------------------------------------------------- -# producer_args([\%args]) -# -# Arbitrary name => value pairs of paramters can be passed to a -# producer using this method. -# -# If the first argument passed in is undef, then the hash of arguments -# is cleared; all subsequent elements are added to the hash of name, -# value pairs stored as producer_args. -# ---------------------------------------------------------------------- sub producer_args { shift->_args("producer", @_); } -# ---------------------------------------------------------------------- -# parser([$parser_spec]) -# ---------------------------------------------------------------------- sub parser { shift->_tool({ name => 'parser', @@ -228,17 +170,6 @@ sub parser_type { $_[0]->{'parser_type'}; } sub parser_args { shift->_args("parser", @_); } -# ---------------------------------------------------------------------- -# e.g. -# $sqlt->filters => [ -# sub { }, -# [ "NormalizeNames", field => "lc", tabel => "ucfirst" ], -# [ -# "DataTypeMap", -# "TEXT" => "BIGTEXT", -# ], -# ], -# ---------------------------------------------------------------------- sub filters { my $self = shift; my $filters = $self->{filters} ||= []; @@ -261,7 +192,6 @@ sub filters { return @$filters; } -# ---------------------------------------------------------------------- sub show_warnings { my $self = shift; my $arg = shift; @@ -272,7 +202,6 @@ sub show_warnings { } -# filename - get or set the filename sub filename { my $self = shift; if (@_) { @@ -296,13 +225,6 @@ sub filename { $self->{'filename'}; } -# ---------------------------------------------------------------------- -# data([$data]) -# -# if $self->{'data'} is not set, but $self->{'filename'} is, then -# $self->{'filename'} is opened and read, with the results put into -# $self->{'data'}. -# ---------------------------------------------------------------------- sub data { my $self = shift; @@ -356,7 +278,6 @@ sub data { return $self->{'data'}; } -# ---------------------------------------------------------------------- sub reset { # # Deletes the existing Schema object so that future calls to translate @@ -367,7 +288,6 @@ sub reset { return 1; } -# ---------------------------------------------------------------------- sub schema { # # Returns the SQL::Translator::Schema object @@ -383,7 +303,6 @@ sub schema { return $self->{'schema'}; } -# ---------------------------------------------------------------------- sub trace { my $self = shift; my $arg = shift; @@ -393,21 +312,6 @@ sub trace { return $self->{'trace'} || 0; } -# ---------------------------------------------------------------------- -# translate([source], [\%args]) -# -# translate does the actual translation. The main argument is the -# source of the data to be translated, which can be a filename, scalar -# reference, or glob reference. -# -# Alternatively, translate takes optional arguements, which are passed -# to the appropriate places. Most notable of these arguments are -# parser and producer, which can be used to set the parser and -# producer, respectively. This is the applications last chance to set -# these. -# -# translate returns a string. -# ---------------------------------------------------------------------- sub translate { my $self = shift; my ($args, $parser, $parser_type, $producer, $producer_type); @@ -550,36 +454,10 @@ sub translate { return wantarray ? @producer_output : $producer_output; } -# ---------------------------------------------------------------------- -# list_parsers() -# -# Hacky sort of method to list all available parsers. This has -# several problems: -# -# - Only finds things in the SQL::Translator::Parser namespace -# -# - Only finds things that are located in the same directory -# as SQL::Translator::Parser. Yeck. -# -# This method will fail in several very likely cases: -# -# - Parser modules in different namespaces -# -# - Parser modules in the SQL::Translator::Parser namespace that -# have any XS componenets will be installed in -# arch_lib/SQL/Translator. -# -# ---------------------------------------------------------------------- sub list_parsers { return shift->_list("parser"); } -# ---------------------------------------------------------------------- -# list_producers() -# -# See notes for list_parsers(), above; all the problems apply to -# list_producers as well. -# ---------------------------------------------------------------------- sub list_producers { return shift->_list("producer"); } @@ -794,22 +672,18 @@ sub _load_sub { return undef; } -# ---------------------------------------------------------------------- sub format_table_name { return shift->_format_name('_format_table_name', @_); } -# ---------------------------------------------------------------------- sub format_package_name { return shift->_format_name('_format_package_name', @_); } -# ---------------------------------------------------------------------- sub format_fk_name { return shift->_format_name('_format_fk_name', @_); } -# ---------------------------------------------------------------------- sub format_pk_name { return shift->_format_name('_format_pk_name', @_); } @@ -835,28 +709,16 @@ sub _format_name { return @args ? $self->{$field}->(@args) : $self->{$field}; } -# ---------------------------------------------------------------------- -# isa($ref, $type) -# -# Calls UNIVERSAL::isa($ref, $type). I think UNIVERSAL::isa is ugly, -# but I like function overhead. -# ---------------------------------------------------------------------- sub isa($$) { my ($ref, $type) = @_; return UNIVERSAL::isa($ref, $type); } -# ---------------------------------------------------------------------- -# version -# -# Returns the $VERSION of the main SQL::Translator package. -# ---------------------------------------------------------------------- sub version { my $self = shift; return $VERSION; } -# ---------------------------------------------------------------------- sub validate { my ( $self, $arg ) = @_; if ( defined $arg ) { diff --git a/lib/SQL/Translator/Parser/Access.pm b/lib/SQL/Translator/Parser/Access.pm index 769167e..cd954f6 100644 --- a/lib/SQL/Translator/Parser/Access.pm +++ b/lib/SQL/Translator/Parser/Access.pm @@ -398,7 +398,6 @@ VALUE : /[-+]?\.?\d+(?:[eE]\d+)?/ !; -# ------------------------------------------------------------------- sub parse { my ( $translator, $data ) = @_; my $parser = Parse::RecDescent->new($GRAMMAR); diff --git a/lib/SQL/Translator/Parser/DB2.pm b/lib/SQL/Translator/Parser/DB2.pm index a12c93d..3665d9d 100644 --- a/lib/SQL/Translator/Parser/DB2.pm +++ b/lib/SQL/Translator/Parser/DB2.pm @@ -11,7 +11,6 @@ $::RD_ERRORS = 1; # Make sure the parser dies when it encounters an error $::RD_WARN = 1; # Enable warnings. This will warn on unused rules &c. $::RD_HINT = 1; # Give out hints to help fix problems. -# ------------------------------------------------------------------- sub parse { my ( $translator, $data ) = @_; my $parser = SQL::Translator::Parser::DB2::Grammar->new(); diff --git a/lib/SQL/Translator/Parser/DBI.pm b/lib/SQL/Translator/Parser/DBI.pm index 13d8d12..bef6871 100644 --- a/lib/SQL/Translator/Parser/DBI.pm +++ b/lib/SQL/Translator/Parser/DBI.pm @@ -114,8 +114,6 @@ query Oracle directly and skip the parsing of a text file, too. =cut -# ------------------------------------------------------------------- - use strict; use DBI; use vars qw($VERSION @EXPORT); @@ -186,7 +184,6 @@ sub parse { 1; -# ------------------------------------------------------------------- =pod =head1 AUTHOR diff --git a/lib/SQL/Translator/Parser/DBI/DB2.pm b/lib/SQL/Translator/Parser/DBI/DB2.pm index ee075c0..12797f2 100644 --- a/lib/SQL/Translator/Parser/DBI/DB2.pm +++ b/lib/SQL/Translator/Parser/DBI/DB2.pm @@ -25,7 +25,6 @@ use vars qw[ $DEBUG $VERSION @EXPORT_OK ]; # $VERSION = '1.59'; $DEBUG = 0 unless defined $DEBUG; -# ------------------------------------------------------------------- sub parse { my ( $tr, $dbh ) = @_; diff --git a/lib/SQL/Translator/Parser/DBI/MySQL.pm b/lib/SQL/Translator/Parser/DBI/MySQL.pm index dcabb1b..25727b0 100644 --- a/lib/SQL/Translator/Parser/DBI/MySQL.pm +++ b/lib/SQL/Translator/Parser/DBI/MySQL.pm @@ -44,7 +44,6 @@ use vars qw[ $DEBUG $VERSION @EXPORT_OK ]; $VERSION = '1.59'; $DEBUG = 0 unless defined $DEBUG; -# ------------------------------------------------------------------- sub parse { my ( $tr, $dbh ) = @_; my $schema = $tr->schema; diff --git a/lib/SQL/Translator/Parser/DBI/Oracle.pm b/lib/SQL/Translator/Parser/DBI/Oracle.pm index 1e9504d..1d47554 100644 --- a/lib/SQL/Translator/Parser/DBI/Oracle.pm +++ b/lib/SQL/Translator/Parser/DBI/Oracle.pm @@ -42,7 +42,6 @@ use SQL::Translator::Schema::Constraint; our $VERSION = '1.59'; -# ------------------------------------------------------------------- sub parse { my ( $tr, $dbh ) = @_; diff --git a/lib/SQL/Translator/Parser/DBI/PostgreSQL.pm b/lib/SQL/Translator/Parser/DBI/PostgreSQL.pm index 1496ace..8b4f848 100644 --- a/lib/SQL/Translator/Parser/DBI/PostgreSQL.pm +++ b/lib/SQL/Translator/Parser/DBI/PostgreSQL.pm @@ -48,7 +48,6 @@ my $actions = {c => 'cascade', d => 'set default', }; -# ------------------------------------------------------------------- sub parse { my ( $tr, $dbh ) = @_; diff --git a/lib/SQL/Translator/Parser/DBI/SQLServer.pm b/lib/SQL/Translator/Parser/DBI/SQLServer.pm index c65283a..0675726 100644 --- a/lib/SQL/Translator/Parser/DBI/SQLServer.pm +++ b/lib/SQL/Translator/Parser/DBI/SQLServer.pm @@ -43,7 +43,6 @@ $DEBUG = 0 unless defined $DEBUG; no strict 'refs'; -# ------------------------------------------------------------------- sub parse { my ( $tr, $dbh ) = @_; @@ -341,8 +340,6 @@ $table_info->{TABLE_NAME}, 1; -# ------------------------------------------------------------------- - =pod =head1 AUTHOR diff --git a/lib/SQL/Translator/Parser/DBI/SQLite.pm b/lib/SQL/Translator/Parser/DBI/SQLite.pm index a61cf4c..e88bd9b 100644 --- a/lib/SQL/Translator/Parser/DBI/SQLite.pm +++ b/lib/SQL/Translator/Parser/DBI/SQLite.pm @@ -46,7 +46,6 @@ use vars qw[ $DEBUG $VERSION @EXPORT_OK ]; $VERSION = '1.59'; $DEBUG = 0 unless defined $DEBUG; -# ------------------------------------------------------------------- sub parse { my ( $tr, $dbh ) = @_; diff --git a/lib/SQL/Translator/Parser/DBI/Sybase.pm b/lib/SQL/Translator/Parser/DBI/Sybase.pm index d800fe0..da3008a 100644 --- a/lib/SQL/Translator/Parser/DBI/Sybase.pm +++ b/lib/SQL/Translator/Parser/DBI/Sybase.pm @@ -43,7 +43,6 @@ $DEBUG = 0 unless defined $DEBUG; no strict 'refs'; -# ------------------------------------------------------------------- sub parse { my ( $tr, $dbh ) = @_; @@ -318,8 +317,6 @@ $table_info->{TABLE_NAME}, 1; -# ------------------------------------------------------------------- - =pod =head1 AUTHOR diff --git a/lib/SQL/Translator/Parser/Excel.pm b/lib/SQL/Translator/Parser/Excel.pm index da1be59..36bae31 100644 --- a/lib/SQL/Translator/Parser/Excel.pm +++ b/lib/SQL/Translator/Parser/Excel.pm @@ -191,7 +191,6 @@ sub parse { return 1; } -# ------------------------------------------------------------------- sub ET_to_ST { my $et = shift; $ET_to_ST{$et} || $ET_to_ST{'Text'}; diff --git a/lib/SQL/Translator/Parser/MySQL.pm b/lib/SQL/Translator/Parser/MySQL.pm index 3c64085..e449448 100644 --- a/lib/SQL/Translator/Parser/MySQL.pm +++ b/lib/SQL/Translator/Parser/MySQL.pm @@ -784,7 +784,6 @@ CURRENT_TIMESTAMP : /current_timestamp(\(\))?/i END_OF_GRAMMAR -# ------------------------------------------------------------------- sub parse { my ( $translator, $data ) = @_; my $parser = Parse::RecDescent->new($GRAMMAR); diff --git a/lib/SQL/Translator/Parser/Oracle.pm b/lib/SQL/Translator/Parser/Oracle.pm index 26352c2..a9afa27 100644 --- a/lib/SQL/Translator/Parser/Oracle.pm +++ b/lib/SQL/Translator/Parser/Oracle.pm @@ -611,7 +611,6 @@ VALUE : /[-+]?\.?\d+(?:[eE]\d+)?/ `; -# ------------------------------------------------------------------- sub parse { my ( $translator, $data ) = @_; my $parser = Parse::RecDescent->new($GRAMMAR); diff --git a/lib/SQL/Translator/Parser/PostgreSQL.pm b/lib/SQL/Translator/Parser/PostgreSQL.pm index 841ed6e..21edb39 100644 --- a/lib/SQL/Translator/Parser/PostgreSQL.pm +++ b/lib/SQL/Translator/Parser/PostgreSQL.pm @@ -1008,7 +1008,6 @@ VALUE : /[-+]?\.?\d+(?:[eE]\d+)?/ !; -# ------------------------------------------------------------------- sub parse { my ( $translator, $data ) = @_; my $parser = Parse::RecDescent->new($GRAMMAR); diff --git a/lib/SQL/Translator/Parser/SQLServer.pm b/lib/SQL/Translator/Parser/SQLServer.pm index edfe0d0..3b52fc9 100644 --- a/lib/SQL/Translator/Parser/SQLServer.pm +++ b/lib/SQL/Translator/Parser/SQLServer.pm @@ -480,7 +480,6 @@ RQUOTE : ']' }; -# ------------------------------------------------------------------- sub parse { my ( $translator, $data ) = @_; my $parser = Parse::RecDescent->new($GRAMMAR); diff --git a/lib/SQL/Translator/Parser/SQLite.pm b/lib/SQL/Translator/Parser/SQLite.pm index 0f6b520..e0e3cca 100644 --- a/lib/SQL/Translator/Parser/SQLite.pm +++ b/lib/SQL/Translator/Parser/SQLite.pm @@ -632,7 +632,6 @@ VALUE : /[-+]?\.?\d+(?:[eE]\d+)?/ !; -# ------------------------------------------------------------------- sub parse { my ( $translator, $data ) = @_; my $parser = Parse::RecDescent->new($GRAMMAR); diff --git a/lib/SQL/Translator/Parser/Storable.pm b/lib/SQL/Translator/Parser/Storable.pm index d50cf88..8cb46c9 100644 --- a/lib/SQL/Translator/Parser/Storable.pm +++ b/lib/SQL/Translator/Parser/Storable.pm @@ -66,8 +66,6 @@ sub parse { 1; -# ------------------------------------------------------------------- - =pod =head1 SEE ALSO diff --git a/lib/SQL/Translator/Parser/Sybase.pm b/lib/SQL/Translator/Parser/Sybase.pm index aa1b9f5..d7f0de6 100644 --- a/lib/SQL/Translator/Parser/Sybase.pm +++ b/lib/SQL/Translator/Parser/Sybase.pm @@ -308,7 +308,6 @@ QUOTE : /'/ }; -# ------------------------------------------------------------------- sub parse { my ( $translator, $data ) = @_; my $parser = Parse::RecDescent->new($GRAMMAR); diff --git a/lib/SQL/Translator/Parser/XML.pm b/lib/SQL/Translator/Parser/XML.pm index 2cec293..8eb07ce 100644 --- a/lib/SQL/Translator/Parser/XML.pm +++ b/lib/SQL/Translator/Parser/XML.pm @@ -38,8 +38,6 @@ Ken Y. Clark Ekclark@cpan.orgE. =cut -# ------------------------------------------------------------------- - use strict; use vars qw[ $VERSION $DEBUG ]; $VERSION = '1.59'; diff --git a/lib/SQL/Translator/Parser/XML/SQLFairy.pm b/lib/SQL/Translator/Parser/XML/SQLFairy.pm index 28210d8..e7f668c 100644 --- a/lib/SQL/Translator/Parser/XML/SQLFairy.pm +++ b/lib/SQL/Translator/Parser/XML/SQLFairy.pm @@ -94,8 +94,6 @@ To convert your old format files simply pass them through the translator :) =cut -# ------------------------------------------------------------------- - use strict; use vars qw[ $DEBUG $VERSION @EXPORT_OK ]; @@ -274,7 +272,6 @@ sub parse { return 1; } -# ------------------------------------------------------------------- sub get_tagfields { # # get_tagfields XP, NODE, NAMESPACE => qw/TAGNAMES/; @@ -326,8 +323,6 @@ sub get_tagfields { 1; -# ------------------------------------------------------------------- - =pod =head1 BUGS diff --git a/lib/SQL/Translator/Parser/xSV.pm b/lib/SQL/Translator/Parser/xSV.pm index da47584..d155fc1 100644 --- a/lib/SQL/Translator/Parser/xSV.pm +++ b/lib/SQL/Translator/Parser/xSV.pm @@ -61,8 +61,6 @@ C. =cut -# ------------------------------------------------------------------- - use strict; use vars qw($VERSION @EXPORT); $VERSION = '1.59'; @@ -183,7 +181,6 @@ sub parse { 1; -# ------------------------------------------------------------------- =pod =head1 AUTHORS diff --git a/lib/SQL/Translator/Producer/ClassDBI.pm b/lib/SQL/Translator/Producer/ClassDBI.pm index 41314a2..7e68294 100644 --- a/lib/SQL/Translator/Producer/ClassDBI.pm +++ b/lib/SQL/Translator/Producer/ClassDBI.pm @@ -33,7 +33,6 @@ my %CDBI_auto_pkgs = ( Oracle => 'Oracle', ); -# ------------------------------------------------------------------- sub produce { my $t = shift; local $DEBUG = $t->debug; @@ -386,8 +385,6 @@ sub produce { 1; -# ------------------------------------------------------------------- - =pod =head1 NAME diff --git a/lib/SQL/Translator/Producer/DB2.pm b/lib/SQL/Translator/Producer/DB2.pm index 11f7727..9743dbd 100644 --- a/lib/SQL/Translator/Producer/DB2.pm +++ b/lib/SQL/Translator/Producer/DB2.pm @@ -189,8 +189,6 @@ DELETE LANGUAGE RESET DESCRIPTOR LC_CTYPE RESIGNAL /; -#------------------------------------------------------------------------------ - sub produce { my ($translator) = @_; diff --git a/lib/SQL/Translator/Producer/DiaUml.pm b/lib/SQL/Translator/Producer/DiaUml.pm index 7c02d33..f6a0f10 100644 --- a/lib/SQL/Translator/Producer/DiaUml.pm +++ b/lib/SQL/Translator/Producer/DiaUml.pm @@ -52,8 +52,6 @@ automatically arrange them horizontally or vertically. =cut -# ------------------------------------------------------------------- - use strict; use vars qw[ $DEBUG $VERSION @EXPORT_OK ]; @@ -75,8 +73,6 @@ sub tt_schema { 'schema.tt2' } 1; -# ------------------------------------------------------------------- - =pod =head1 AUTHOR diff --git a/lib/SQL/Translator/Producer/Diagram.pm b/lib/SQL/Translator/Producer/Diagram.pm index 852bd80..59a7144 100644 --- a/lib/SQL/Translator/Producer/Diagram.pm +++ b/lib/SQL/Translator/Producer/Diagram.pm @@ -579,8 +579,6 @@ sub produce { 1; -# ------------------------------------------------------------------- - =pod =head1 AUTHOR diff --git a/lib/SQL/Translator/Producer/Dumper.pm b/lib/SQL/Translator/Producer/Dumper.pm index 38b67a2..12ebdc6 100644 --- a/lib/SQL/Translator/Producer/Dumper.pm +++ b/lib/SQL/Translator/Producer/Dumper.pm @@ -121,7 +121,6 @@ sub produce { return $out; } -# ------------------------------------------------------------------- sub template { # # Returns the template to be processed by Template Toolkit diff --git a/lib/SQL/Translator/Producer/GraphViz.pm b/lib/SQL/Translator/Producer/GraphViz.pm index aafe6f4..0108a21 100644 --- a/lib/SQL/Translator/Producer/GraphViz.pm +++ b/lib/SQL/Translator/Producer/GraphViz.pm @@ -641,8 +641,6 @@ sub produce { 1; -# ------------------------------------------------------------------- - =pod =head1 AUTHOR diff --git a/lib/SQL/Translator/Producer/Latex.pm b/lib/SQL/Translator/Producer/Latex.pm index 5540ec5..4cfd8bd 100644 --- a/lib/SQL/Translator/Producer/Latex.pm +++ b/lib/SQL/Translator/Producer/Latex.pm @@ -52,8 +52,6 @@ automatically arrange them horizontally or vertically. =cut -# ------------------------------------------------------------------- - use strict; use vars qw[ $DEBUG $VERSION @EXPORT_OK ]; @@ -106,8 +104,6 @@ sub latex { 1; -# ------------------------------------------------------------------- - =pod =head1 AUTHOR diff --git a/lib/SQL/Translator/Producer/MySQL.pm b/lib/SQL/Translator/Producer/MySQL.pm index afa03fd..1ed2b1e 100644 --- a/lib/SQL/Translator/Producer/MySQL.pm +++ b/lib/SQL/Translator/Producer/MySQL.pm @@ -994,8 +994,6 @@ sub next_unused_name { 1; -# ------------------------------------------------------------------- - =pod =head1 SEE ALSO diff --git a/lib/SQL/Translator/Producer/Oracle.pm b/lib/SQL/Translator/Producer/Oracle.pm index e0d805b..88496e7 100644 --- a/lib/SQL/Translator/Producer/Oracle.pm +++ b/lib/SQL/Translator/Producer/Oracle.pm @@ -201,7 +201,6 @@ my %truncated; # Quote used to escape table, field, sequence and trigger names my $quote_char = '"'; -# ------------------------------------------------------------------- sub produce { my $translator = shift; $DEBUG = $translator->debug; @@ -764,7 +763,6 @@ sub create_view { return \@create; } -# ------------------------------------------------------------------- sub mk_name { my $basename = shift || ''; my $type = shift || ''; @@ -805,7 +803,6 @@ sub mk_name { 1; -# ------------------------------------------------------------------- sub quote { my ($name, $q) = @_; $q && $name ? "$quote_char$name$quote_char" : $name; diff --git a/lib/SQL/Translator/Producer/POD.pm b/lib/SQL/Translator/Producer/POD.pm index 9abdc36..9cf1700 100644 --- a/lib/SQL/Translator/Producer/POD.pm +++ b/lib/SQL/Translator/Producer/POD.pm @@ -45,7 +45,6 @@ $VERSION = '1.59'; use SQL::Translator::Schema::Constants; use SQL::Translator::Utils qw(header_comment); -# ------------------------------------------------------------------- sub produce { my $t = shift; my $schema = $t->schema; diff --git a/lib/SQL/Translator/Producer/PostgreSQL.pm b/lib/SQL/Translator/Producer/PostgreSQL.pm index 3d0a603..64d177d 100644 --- a/lib/SQL/Translator/Producer/PostgreSQL.pm +++ b/lib/SQL/Translator/Producer/PostgreSQL.pm @@ -174,7 +174,6 @@ and table_constraint is: =cut -# ------------------------------------------------------------------- sub produce { my $translator = shift; local $DEBUG = $translator->debug; @@ -239,7 +238,6 @@ sub produce { : join ('', @output); } -# ------------------------------------------------------------------- sub mk_name { my $basename = shift || ''; my $type = shift || ''; diff --git a/lib/SQL/Translator/Producer/SQLServer.pm b/lib/SQL/Translator/Producer/SQLServer.pm index bbd46da..737bb36 100644 --- a/lib/SQL/Translator/Producer/SQLServer.pm +++ b/lib/SQL/Translator/Producer/SQLServer.pm @@ -101,7 +101,6 @@ TODO =cut -# ------------------------------------------------------------------- sub produce { my $translator = shift; $DEBUG = $translator->debug; @@ -380,7 +379,6 @@ sub produce { return $output; } -# ------------------------------------------------------------------- sub mk_name { my ($name, $scope, $critical) = @_; @@ -402,13 +400,10 @@ sub mk_name { return unreserve($name); } -# ------------------------------------------------------------------- sub unreserve { $util->quote($_[0]) } 1; -# ------------------------------------------------------------------- - =pod =head1 SEE ALSO diff --git a/lib/SQL/Translator/Producer/SQLite.pm b/lib/SQL/Translator/Producer/SQLite.pm index eb50e5e..7549462 100644 --- a/lib/SQL/Translator/Producer/SQLite.pm +++ b/lib/SQL/Translator/Producer/SQLite.pm @@ -107,7 +107,6 @@ sub produce { } } -# ------------------------------------------------------------------- sub mk_name { my ($name, $scope, $critical) = @_; diff --git a/lib/SQL/Translator/Producer/Storable.pm b/lib/SQL/Translator/Producer/Storable.pm index 3c918c0..7b4c2e0 100644 --- a/lib/SQL/Translator/Producer/Storable.pm +++ b/lib/SQL/Translator/Producer/Storable.pm @@ -60,8 +60,6 @@ sub produce { 1; -# ------------------------------------------------------------------- - =pod =head1 AUTHOR diff --git a/lib/SQL/Translator/Producer/Sybase.pm b/lib/SQL/Translator/Producer/Sybase.pm index b5065f7..34e254b 100644 --- a/lib/SQL/Translator/Producer/Sybase.pm +++ b/lib/SQL/Translator/Producer/Sybase.pm @@ -132,7 +132,6 @@ and table_constraint is: =cut -# ------------------------------------------------------------------- sub produce { my $translator = shift; $DEBUG = $translator->debug; @@ -370,7 +369,6 @@ sub produce { return $output; } -# ------------------------------------------------------------------- sub mk_name { my $basename = shift || ''; my $type = shift || ''; @@ -409,7 +407,6 @@ sub mk_name { return $name; } -# ------------------------------------------------------------------- sub unreserve { my $name = shift || ''; my $schema_obj_name = shift || ''; @@ -431,8 +428,6 @@ sub unreserve { 1; -# ------------------------------------------------------------------- - =pod =head1 SEE ALSO diff --git a/lib/SQL/Translator/Producer/TT/Base.pm b/lib/SQL/Translator/Producer/TT/Base.pm index 069d693..7566736 100644 --- a/lib/SQL/Translator/Producer/TT/Base.pm +++ b/lib/SQL/Translator/Producer/TT/Base.pm @@ -149,8 +149,6 @@ sub tt_vars { () }; 1; -# ------------------------------------------------------------------- - =pod =head1 SYNOPSIS diff --git a/lib/SQL/Translator/Producer/TT/Table.pm b/lib/SQL/Translator/Producer/TT/Table.pm index 3494065..fd08eb2 100644 --- a/lib/SQL/Translator/Producer/TT/Table.pm +++ b/lib/SQL/Translator/Producer/TT/Table.pm @@ -171,8 +171,6 @@ whitespace either side, to be recognised. =cut -# ------------------------------------------------------------------- - use strict; use vars qw[ $DEBUG $VERSION @EXPORT_OK ]; @@ -300,8 +298,6 @@ sub insert_code { 1; -# ------------------------------------------------------------------- - =pod =head1 AUTHOR diff --git a/lib/SQL/Translator/Producer/TTSchema.pm b/lib/SQL/Translator/Producer/TTSchema.pm index 839e22e..9b7351b 100644 --- a/lib/SQL/Translator/Producer/TTSchema.pm +++ b/lib/SQL/Translator/Producer/TTSchema.pm @@ -122,8 +122,6 @@ constructor. =cut -# ------------------------------------------------------------------- - use strict; use vars qw[ $DEBUG $VERSION @EXPORT_OK ]; @@ -186,8 +184,6 @@ sub produce { 1; -# ------------------------------------------------------------------- - =pod =head1 AUTHOR diff --git a/lib/SQL/Translator/Producer/XML.pm b/lib/SQL/Translator/Producer/XML.pm index 947b442..99bcc15 100644 --- a/lib/SQL/Translator/Producer/XML.pm +++ b/lib/SQL/Translator/Producer/XML.pm @@ -40,8 +40,6 @@ Ken Youens-Clark Ekclark@cpan.orgE. =cut -# ------------------------------------------------------------------- - use strict; use vars qw[ $VERSION $DEBUG ]; $VERSION = '1.59'; diff --git a/lib/SQL/Translator/Producer/YAML.pm b/lib/SQL/Translator/Producer/YAML.pm index 7174444..6dbdc07 100644 --- a/lib/SQL/Translator/Producer/YAML.pm +++ b/lib/SQL/Translator/Producer/YAML.pm @@ -43,7 +43,6 @@ $VERSION = '1.59'; use YAML qw(Dump); -# ------------------------------------------------------------------- sub produce { my $translator = shift; my $schema = $translator->schema; @@ -83,7 +82,6 @@ sub produce { }); } -# ------------------------------------------------------------------- sub view_table { my $table = shift; @@ -106,7 +104,6 @@ sub view_table { }; } -# ------------------------------------------------------------------- sub view_constraint { my $constraint = shift; @@ -126,7 +123,6 @@ sub view_constraint { }; } -# ------------------------------------------------------------------- sub view_field { my $field = shift; @@ -145,7 +141,6 @@ sub view_field { }; } -# ------------------------------------------------------------------- sub view_procedure { my $procedure = shift; @@ -160,7 +155,6 @@ sub view_procedure { }; } -# ------------------------------------------------------------------- sub view_trigger { my $trigger = shift; @@ -176,7 +170,6 @@ sub view_trigger { }; } -# ------------------------------------------------------------------- sub view_view { my $view = shift; @@ -189,7 +182,6 @@ sub view_view { }; } -# ------------------------------------------------------------------- sub view_index { my $index = shift; @@ -204,8 +196,6 @@ sub view_index { 1; -# ------------------------------------------------------------------- - =head1 SEE ALSO SQL::Translator, YAML, http://www.yaml.org/. diff --git a/lib/SQL/Translator/Schema.pm b/lib/SQL/Translator/Schema.pm index 882eda8..4144b50 100644 --- a/lib/SQL/Translator/Schema.pm +++ b/lib/SQL/Translator/Schema.pm @@ -75,7 +75,6 @@ sub new { return $self; } -# ---------------------------------------------------------------------- sub as_graph { =pod @@ -93,7 +92,6 @@ Returns the schema as an L object. translator => $self->translator ); } -# ---------------------------------------------------------------------- sub as_graph_pm { =pod @@ -125,7 +123,6 @@ Returns a Graph::Directed object with the table names for nodes. return $g; } -# ---------------------------------------------------------------------- sub add_table { =pod @@ -173,7 +170,6 @@ not be created. return $table; } -# ---------------------------------------------------------------------- sub drop_table { =pod @@ -218,7 +214,6 @@ can be set to 1 to also drop all triggers on the table, default is 0. return $table; } -# ---------------------------------------------------------------------- sub add_procedure { =pod @@ -267,7 +262,6 @@ procedure will not be created. return $procedure; } -# ---------------------------------------------------------------------- sub drop_procedure { =pod @@ -304,7 +298,6 @@ object. return $proc; } -# ---------------------------------------------------------------------- sub add_trigger { =pod @@ -351,7 +344,6 @@ not be created. return $trigger; } -# ---------------------------------------------------------------------- sub drop_trigger { =pod @@ -387,7 +379,6 @@ trigger name or an C object. return $trigger; } -# ---------------------------------------------------------------------- sub add_view { =pod @@ -433,7 +424,6 @@ not be created. return $view; } -# ---------------------------------------------------------------------- sub drop_view { =pod @@ -468,7 +458,6 @@ name or an C object. return $view; } -# ---------------------------------------------------------------------- sub database { =pod @@ -486,7 +475,6 @@ Get or set the schema's database. (optional) return $self->{'database'} || ''; } -# ---------------------------------------------------------------------- sub is_valid { =pod @@ -510,7 +498,6 @@ Returns true if all the tables and views are valid. return 1; } -# ---------------------------------------------------------------------- sub get_procedure { =pod @@ -530,7 +517,6 @@ Returns a procedure by the name provided. return $self->{'procedures'}{$procedure_name}; } -# ---------------------------------------------------------------------- sub get_procedures { =pod @@ -558,7 +544,6 @@ Returns all the procedures as an array or array reference. } } -# ---------------------------------------------------------------------- sub get_table { =pod @@ -586,7 +571,6 @@ Returns a table by the name provided. return $self->{'tables'}{$table_name}; } -# ---------------------------------------------------------------------- sub get_tables { =pod @@ -614,7 +598,6 @@ Returns all the tables as an array or array reference. } } -# ---------------------------------------------------------------------- sub get_trigger { =pod @@ -634,7 +617,6 @@ Returns a trigger by the name provided. return $self->{'triggers'}{$trigger_name}; } -# ---------------------------------------------------------------------- sub get_triggers { =pod @@ -662,7 +644,6 @@ Returns all the triggers as an array or array reference. } } -# ---------------------------------------------------------------------- sub get_view { =pod @@ -682,7 +663,6 @@ Returns a view by the name provided. return $self->{'views'}{$view_name}; } -# ---------------------------------------------------------------------- sub get_views { =pod @@ -710,7 +690,6 @@ Returns all the views as an array or array reference. } } -# ---------------------------------------------------------------------- sub make_natural_joins { =pod @@ -782,7 +761,6 @@ A list of fields to skip in the joins return 1; } -# ---------------------------------------------------------------------- sub name { =pod @@ -800,7 +778,6 @@ Get or set the schema's name. (optional) return $self->{'name'} || ''; } -# ---------------------------------------------------------------------- sub translator { =pod @@ -816,7 +793,6 @@ Get the SQL::Translator instance that instantiated the parser. return $self->{'translator'}; } -# ---------------------------------------------------------------------- sub DESTROY { my $self = shift; undef $_ for values %{ $self->{'tables'} }; @@ -825,8 +801,6 @@ sub DESTROY { 1; -# ---------------------------------------------------------------------- - =pod =head1 AUTHOR diff --git a/lib/SQL/Translator/Schema/Constants.pm b/lib/SQL/Translator/Schema/Constants.pm index c1aab3c..27712f5 100644 --- a/lib/SQL/Translator/Schema/Constants.pm +++ b/lib/SQL/Translator/Schema/Constants.pm @@ -98,8 +98,6 @@ use constant UNIQUE => 'UNIQUE'; 1; -# ---------------------------------------------------------------------- - =pod =head1 AUTHOR diff --git a/lib/SQL/Translator/Schema/Constraint.pm b/lib/SQL/Translator/Schema/Constraint.pm index 555a95b..3099667 100644 --- a/lib/SQL/Translator/Schema/Constraint.pm +++ b/lib/SQL/Translator/Schema/Constraint.pm @@ -59,8 +59,6 @@ my %VALID_CONSTRAINT_TYPE = ( NOT_NULL, 1, ); -# ---------------------------------------------------------------------- - __PACKAGE__->_attributes( qw/ table name type fields reference_fields reference_table match_type on_delete on_update expression deferrable @@ -95,7 +93,6 @@ Object constructor. $self->SUPER::init(@_); } -# ---------------------------------------------------------------------- sub deferrable { =pod @@ -121,7 +118,6 @@ False, so the following are eqivalent: return defined $self->{'deferrable'} ? $self->{'deferrable'} : 1; } -# ---------------------------------------------------------------------- sub expression { =pod @@ -144,7 +140,6 @@ Gets and set the expression used in a CHECK constraint. return $self->{'expression'} || ''; } -# ---------------------------------------------------------------------- sub is_valid { =pod @@ -207,7 +202,6 @@ Determine whether the constraint is valid or not. return 1; } -# ---------------------------------------------------------------------- sub fields { =pod @@ -260,7 +254,6 @@ Returns undef or an empty list if the constraint has no fields set. } } -# ---------------------------------------------------------------------- sub field_names { =head2 field_names @@ -277,7 +270,6 @@ avoid the overload magic of the Field objects returned by the fields method. return wantarray ? @{ $self->{'fields'} || [] } : ($self->{'fields'} || ''); } -# ---------------------------------------------------------------------- sub match_type { =pod @@ -303,7 +295,6 @@ Get or set the constraint's match_type. Only valid values are "full" return $self->{'match_type'} || ''; } -# ---------------------------------------------------------------------- sub name { =pod @@ -322,7 +313,6 @@ Get or set the constraint's name. return $self->{'name'} || ''; } -# ---------------------------------------------------------------------- sub options { =pod @@ -350,8 +340,6 @@ Returns an array or array reference. } } - -# ---------------------------------------------------------------------- sub on_delete { =pod @@ -374,7 +362,6 @@ Get or set the constraint's "on delete" action. return $self->{'on_delete'} || ''; } -# ---------------------------------------------------------------------- sub on_update { =pod @@ -397,7 +384,6 @@ Get or set the constraint's "on update" action. return $self->{'on_update'} || ''; } -# ---------------------------------------------------------------------- sub reference_fields { =pod @@ -456,7 +442,6 @@ arrayref; returns an array or array reference. } } -# ---------------------------------------------------------------------- sub reference_table { =pod @@ -474,7 +459,6 @@ Get or set the table referred to by the constraint. return $self->{'reference_table'} || ''; } -# ---------------------------------------------------------------------- sub table { =pod @@ -497,7 +481,6 @@ Get or set the constraint's table object. return $self->{'table'}; } -# ---------------------------------------------------------------------- sub type { =pod @@ -523,7 +506,6 @@ Get or set the constraint's type. return $self->{'type'} || ''; } -# ---------------------------------------------------------------------- sub equals { =pod @@ -589,7 +571,6 @@ Determines if this constraint is the same as another return 1; } -# ---------------------------------------------------------------------- sub DESTROY { my $self = shift; undef $self->{'table'}; # destroy cyclical reference @@ -597,8 +578,6 @@ sub DESTROY { 1; -# ---------------------------------------------------------------------- - =pod =head1 AUTHOR diff --git a/lib/SQL/Translator/Schema/Field.pm b/lib/SQL/Translator/Schema/Field.pm index c0fd26f..ae2b127 100644 --- a/lib/SQL/Translator/Schema/Field.pm +++ b/lib/SQL/Translator/Schema/Field.pm @@ -91,7 +91,6 @@ our %type_mapping = ( text => SQL_LONGVARCHAR ); -# ---------------------------------------------------------------------- __PACKAGE__->_attributes( qw/ table name data_type size is_primary_key is_nullable @@ -112,7 +111,6 @@ Object constructor. =cut -# ---------------------------------------------------------------------- sub comments { =pod @@ -148,7 +146,6 @@ all the comments joined on newlines. } -# ---------------------------------------------------------------------- sub data_type { =pod @@ -184,7 +181,6 @@ for more details. } -# ---------------------------------------------------------------------- sub default_value { =pod @@ -204,7 +200,6 @@ assume an error like other methods. return $self->{'default_value'}; } -# ---------------------------------------------------------------------- =pod =head2 extra @@ -217,8 +212,6 @@ Accepts a hash(ref) of name/value pairs to store; returns a hash. =cut - -# ---------------------------------------------------------------------- sub foreign_key_reference { =pod @@ -252,7 +245,6 @@ Get or set the field's foreign key reference; return $self->{'foreign_key_reference'}; } -# ---------------------------------------------------------------------- sub is_auto_increment { =pod @@ -287,7 +279,6 @@ Get or set the field's C attribute. return $self->{'is_auto_increment'} || 0; } -# ---------------------------------------------------------------------- sub is_foreign_key { =pod @@ -320,7 +311,6 @@ Returns whether or not the field is a foreign key. return $self->{'is_foreign_key'} || 0; } -# ---------------------------------------------------------------------- sub is_nullable { =pod @@ -359,7 +349,6 @@ foreign keys; checks) are represented as table constraints. return defined $self->{'is_nullable'} ? $self->{'is_nullable'} : 1; } -# ---------------------------------------------------------------------- sub is_primary_key { =pod @@ -394,7 +383,6 @@ a table constraint (should it?). return $self->{'is_primary_key'} || 0; } -# ---------------------------------------------------------------------- sub is_unique { =pod @@ -426,7 +414,6 @@ Determine whether the field has a UNIQUE constraint or not. return $self->{'is_unique'} || 0; } -# ---------------------------------------------------------------------- sub is_valid { =pod @@ -446,7 +433,6 @@ Determine whether the field is valid or not. return 1; } -# ---------------------------------------------------------------------- sub name { =pod @@ -493,7 +479,6 @@ e.g. "person.foo". return $self->table.".".$self->name; } -# ---------------------------------------------------------------------- sub order { =pod @@ -515,7 +500,6 @@ Get or set the field's order. return $self->{'order'} || 0; } -# ---------------------------------------------------------------------- sub schema { =head2 schema @@ -532,7 +516,6 @@ doesn't have one. return undef; } -# ---------------------------------------------------------------------- sub size { =pod @@ -571,7 +554,6 @@ numbers and returns a string. ; } -# ---------------------------------------------------------------------- sub table { =pod @@ -614,7 +596,6 @@ Returns the field exactly as the parser found it return $self->{parsed_field} || $self; } -# ---------------------------------------------------------------------- sub equals { =pod @@ -671,7 +652,6 @@ Determines if this field is the same as another return 1; } -# ---------------------------------------------------------------------- sub DESTROY { # # Destroy cyclical references. @@ -683,8 +663,6 @@ sub DESTROY { 1; -# ---------------------------------------------------------------------- - =pod =head1 AUTHOR diff --git a/lib/SQL/Translator/Schema/Index.pm b/lib/SQL/Translator/Schema/Index.pm index 2a8593e..dfe35c4 100644 --- a/lib/SQL/Translator/Schema/Index.pm +++ b/lib/SQL/Translator/Schema/Index.pm @@ -61,8 +61,6 @@ my %VALID_INDEX_TYPE = ( SPATIAL => 1, # MySQL only (?) ); -# ---------------------------------------------------------------------- - __PACKAGE__->_attributes( qw/ name type fields table options /); @@ -77,7 +75,6 @@ Object constructor. =cut -# ---------------------------------------------------------------------- sub fields { =pod @@ -115,7 +112,6 @@ names and keep them in order by the first occurrence of a field name. return wantarray ? @{ $self->{'fields'} || [] } : $self->{'fields'}; } -# ---------------------------------------------------------------------- sub is_valid { =pod @@ -141,7 +137,6 @@ Determine whether the index is valid or not. return 1; } -# ---------------------------------------------------------------------- sub name { =pod @@ -159,7 +154,6 @@ Get or set the index's name. return $self->{'name'} || ''; } -# ---------------------------------------------------------------------- sub options { =pod @@ -186,7 +180,6 @@ an array or array reference. } } -# ---------------------------------------------------------------------- sub table { =pod @@ -209,7 +202,6 @@ Get or set the index's table object. return $self->{'table'}; } -# ---------------------------------------------------------------------- sub type { =pod @@ -241,7 +233,6 @@ uppercase. return $self->{'type'} || 'NORMAL'; } -# ---------------------------------------------------------------------- sub equals { =pod @@ -289,7 +280,6 @@ Determines if this index is the same as another return 1; } -# ---------------------------------------------------------------------- sub DESTROY { my $self = shift; undef $self->{'table'}; # destroy cyclical reference @@ -297,8 +287,6 @@ sub DESTROY { 1; -# ---------------------------------------------------------------------- - =pod =head1 AUTHOR diff --git a/lib/SQL/Translator/Schema/Object.pm b/lib/SQL/Translator/Schema/Object.pm index 8129dce..38e5f93 100644 --- a/lib/SQL/Translator/Schema/Object.pm +++ b/lib/SQL/Translator/Schema/Object.pm @@ -107,7 +107,6 @@ sub init { return $self; } -# ---------------------------------------------------------------------- sub extra { =pod @@ -151,7 +150,6 @@ Returns a hash or a hashref. return wantarray ? %$extra : $extra; } -# ---------------------------------------------------------------------- sub remove_extra { =head2 remove_extra @@ -178,7 +176,6 @@ certain extra attributes only. } } -# ---------------------------------------------------------------------- sub equals { =pod @@ -200,7 +197,6 @@ Determines if this object is the same as another. return 1; } -# ---------------------------------------------------------------------- sub _compare_objects { my $self = shift; my $obj1 = shift; @@ -217,8 +213,6 @@ sub _compare_objects { return $result; } -#============================================================================= - 1; =pod diff --git a/lib/SQL/Translator/Schema/Procedure.pm b/lib/SQL/Translator/Schema/Procedure.pm index 9bc175c..34f8622 100644 --- a/lib/SQL/Translator/Schema/Procedure.pm +++ b/lib/SQL/Translator/Schema/Procedure.pm @@ -54,8 +54,6 @@ use vars qw($VERSION); $VERSION = '1.59'; -# ---------------------------------------------------------------------- - __PACKAGE__->_attributes( qw/ name sql parameters comments owner sql schema order /); @@ -70,7 +68,6 @@ Object constructor. =cut -# ---------------------------------------------------------------------- sub parameters { =pod @@ -106,7 +103,6 @@ Gets and set the parameters of the stored procedure. return wantarray ? @{ $self->{'parameters'} || [] } : ($self->{'parameters'} || ''); } -# ---------------------------------------------------------------------- sub name { =pod @@ -125,7 +121,6 @@ Get or set the procedure's name. return $self->{'name'} || ''; } -# ---------------------------------------------------------------------- sub sql { =pod @@ -144,7 +139,6 @@ Get or set the procedure's SQL. return $self->{'sql'} || ''; } -# ---------------------------------------------------------------------- sub order { =pod @@ -163,7 +157,6 @@ Get or set the order of the procedure. return $self->{'order'}; } -# ---------------------------------------------------------------------- sub owner { =pod @@ -182,7 +175,6 @@ Get or set the owner of the procedure. return $self->{'owner'} || ''; } -# ---------------------------------------------------------------------- sub comments { =pod @@ -214,7 +206,6 @@ Get or set the comments on a procedure. } } -# ---------------------------------------------------------------------- sub schema { =pod @@ -238,7 +229,6 @@ Get or set the procedures's schema object. return $self->{'schema'}; } -# ---------------------------------------------------------------------- sub equals { =pod @@ -278,7 +268,6 @@ Determines if this procedure is the same as another return 1; } -# ---------------------------------------------------------------------- sub DESTROY { my $self = shift; undef $self->{'schema'}; # destroy cyclical reference @@ -286,8 +275,6 @@ sub DESTROY { 1; -# ---------------------------------------------------------------------- - =pod =head1 AUTHORS diff --git a/lib/SQL/Translator/Schema/Table.pm b/lib/SQL/Translator/Schema/Table.pm index 70bb1d4..6655e4d 100644 --- a/lib/SQL/Translator/Schema/Table.pm +++ b/lib/SQL/Translator/Schema/Table.pm @@ -60,8 +60,6 @@ use overload fallback => 1, ; -# ---------------------------------------------------------------------- - __PACKAGE__->_attributes( qw/schema name comments options order/ ); =pod @@ -89,9 +87,6 @@ sub new { return $self; } - - -# ---------------------------------------------------------------------- sub add_constraint { =pod @@ -177,7 +172,6 @@ C object. return $constraint; } -# ---------------------------------------------------------------------- sub drop_constraint { =pod @@ -214,7 +208,6 @@ an index name or an C object. return $constraint; } -# ---------------------------------------------------------------------- sub add_index { =pod @@ -256,7 +249,6 @@ C object. return $index; } -# ---------------------------------------------------------------------- sub drop_index { =pod @@ -293,7 +285,6 @@ an index name of an C object. return $index; } -# ---------------------------------------------------------------------- sub add_field { =pod @@ -347,7 +338,7 @@ existing field, you will get an error and the field will not be created. return $field; } -# ---------------------------------------------------------------------- + sub drop_field { =pod @@ -400,7 +391,6 @@ a field name or an C object. return $field; } -# ---------------------------------------------------------------------- sub comments { =pod @@ -437,7 +427,6 @@ all the comments joined on newlines. } } -# ---------------------------------------------------------------------- sub get_constraints { =pod @@ -462,7 +451,6 @@ Returns all the constraint objects as an array or array reference. } } -# ---------------------------------------------------------------------- sub get_indices { =pod @@ -488,7 +476,6 @@ Returns all the index objects as an array or array reference. } } -# ---------------------------------------------------------------------- sub get_field { =pod @@ -516,7 +503,6 @@ Returns a field by the name provided. return $self->{'fields'}{ $field_name }; } -# ---------------------------------------------------------------------- sub get_fields { =pod @@ -545,7 +531,6 @@ Returns all the field objects as an array or array reference. } } -# ---------------------------------------------------------------------- sub is_valid { =pod @@ -571,7 +556,6 @@ Determine whether the view is valid or not. return 1; } -# ---------------------------------------------------------------------- sub is_trivial_link { =pod @@ -631,7 +615,6 @@ Returns true if the table has some non-key fields. return $self->{'is_data'}; } -# ---------------------------------------------------------------------- sub can_link { =pod @@ -723,7 +706,6 @@ Determine whether the table can link two arg tables via many-to-many. return $self->{'can_link'}{ $table1->name }{ $table2->name }; } -# ---------------------------------------------------------------------- sub name { =pod @@ -756,7 +738,6 @@ that name and disallows the change if one exists (setting the error to return $self->{'name'} || ''; } -# ---------------------------------------------------------------------- sub schema { =pod @@ -779,7 +760,6 @@ Get or set the table's schema object. return $self->{'schema'}; } -# ---------------------------------------------------------------------- sub primary_key { =pod @@ -845,7 +825,6 @@ These are eqivalent: return; } -# ---------------------------------------------------------------------- sub options { =pod @@ -872,7 +851,6 @@ an array or array reference. } } -# ---------------------------------------------------------------------- sub order { =pod @@ -894,7 +872,6 @@ Get or set the table's order. return $self->{'order'} || 0; } -# ---------------------------------------------------------------------- sub field_names { =head2 field_names @@ -922,7 +899,6 @@ avoid the overload magic of the Field objects returned by the get_fields method. } } -# ---------------------------------------------------------------------- sub equals { =pod @@ -1011,8 +987,6 @@ INDEX2: return 1; } -# ---------------------------------------------------------------------- - =head1 LOOKUP METHODS The following are a set of shortcut methods for getting commonly used lists of @@ -1060,7 +1034,6 @@ sub pkey_fields { return wantarray ? @fields : \@fields; } -# ---------------------------------------------------------------------- sub fkey_fields { my $me = shift; my @fields; @@ -1068,14 +1041,12 @@ sub fkey_fields { return wantarray ? @fields : \@fields; } -# ---------------------------------------------------------------------- sub nonpkey_fields { my $me = shift; my @fields = grep { !$_->is_primary_key } $me->get_fields; return wantarray ? @fields : \@fields; } -# ---------------------------------------------------------------------- sub data_fields { my $me = shift; my @fields = @@ -1083,7 +1054,6 @@ sub data_fields { return wantarray ? @fields : \@fields; } -# ---------------------------------------------------------------------- sub unique_fields { my $me = shift; my @fields; @@ -1091,21 +1061,18 @@ sub unique_fields { return wantarray ? @fields : \@fields; } -# ---------------------------------------------------------------------- sub unique_constraints { my $me = shift; my @cons = grep { $_->type eq UNIQUE } $me->get_constraints; return wantarray ? @cons : \@cons; } -# ---------------------------------------------------------------------- sub fkey_constraints { my $me = shift; my @cons = grep { $_->type eq FOREIGN_KEY } $me->get_constraints; return wantarray ? @cons : \@cons; } -# ---------------------------------------------------------------------- sub DESTROY { my $self = shift; undef $self->{'schema'}; # destroy cyclical reference @@ -1116,8 +1083,6 @@ sub DESTROY { 1; -# ---------------------------------------------------------------------- - =pod =head1 AUTHORS diff --git a/lib/SQL/Translator/Schema/Trigger.pm b/lib/SQL/Translator/Schema/Trigger.pm index 2bc57cd..b1b95fc 100644 --- a/lib/SQL/Translator/Schema/Trigger.pm +++ b/lib/SQL/Translator/Schema/Trigger.pm @@ -56,8 +56,6 @@ use vars qw($VERSION $TABLE_COUNT $VIEW_COUNT); $VERSION = '1.59'; -# ---------------------------------------------------------------------- - __PACKAGE__->_attributes( qw/ name schema perform_action_when database_events database_event fields table on_table action order @@ -73,7 +71,6 @@ Object constructor. =cut -# ---------------------------------------------------------------------- sub perform_action_when { =pod @@ -104,7 +101,6 @@ C. return $self->{'perform_action_when'}; } -# ---------------------------------------------------------------------- sub database_event { =pod @@ -120,7 +116,6 @@ Obsolete please use database_events! return $self->database_events( @_ ); } -# ---------------------------------------------------------------------- sub database_events { =pod @@ -157,7 +152,6 @@ Gets or sets the events that triggers the trigger. : $self->{'database_events'}; } -# ---------------------------------------------------------------------- sub fields { =pod @@ -193,7 +187,6 @@ Gets and set which fields to monitor for C. return wantarray ? @{ $self->{'fields'} || [] } : $self->{'fields'}; } -# ---------------------------------------------------------------------- sub table { =pod @@ -215,7 +208,6 @@ Gets or set the table on which the trigger works, as a L{table}; } -# ---------------------------------------------------------------------- sub on_table { =pod @@ -237,7 +229,6 @@ Gets or set the table name on which the trigger works, as a string. return $self->table->name; } -# ---------------------------------------------------------------------- sub action { =pod @@ -263,7 +254,6 @@ Gets or set the action of the trigger. return $self->{'action'}; } -# ---------------------------------------------------------------------- sub is_valid { =pod @@ -290,7 +280,6 @@ Determine whether the trigger is valid or not. return 1; } -# ---------------------------------------------------------------------- sub name { =pod @@ -308,7 +297,6 @@ Get or set the trigger's name. return $self->{'name'} || ''; } -# ---------------------------------------------------------------------- sub order { =pod @@ -330,7 +318,6 @@ Get or set the trigger's order. return $self->{'order'} || 0; } -# ---------------------------------------------------------------------- sub schema { =pod @@ -354,7 +341,6 @@ Get or set the trigger's schema object. return $self->{'schema'}; } -# ---------------------------------------------------------------------- sub compare_arrays { =pod @@ -383,7 +369,6 @@ Compare two arrays. return 1; } -# ---------------------------------------------------------------------- sub equals { =pod @@ -439,7 +424,6 @@ Determines if this trigger is the same as another return 1; } -# ---------------------------------------------------------------------- sub DESTROY { my $self = shift; undef $self->{'schema'}; # destroy cyclical reference @@ -447,8 +431,6 @@ sub DESTROY { 1; -# ---------------------------------------------------------------------- - =pod =head1 AUTHORS diff --git a/lib/SQL/Translator/Schema/View.pm b/lib/SQL/Translator/Schema/View.pm index 4d39621..3b26233 100644 --- a/lib/SQL/Translator/Schema/View.pm +++ b/lib/SQL/Translator/Schema/View.pm @@ -50,8 +50,6 @@ use vars qw($VERSION $TABLE_COUNT $VIEW_COUNT); $VERSION = '1.59'; -# ---------------------------------------------------------------------- - __PACKAGE__->_attributes( qw/ name sql fields schema order /); @@ -66,7 +64,6 @@ Object constructor. =cut -# ---------------------------------------------------------------------- sub fields { =pod @@ -104,7 +101,6 @@ names and keep them in order by the first occurrence of a field name. return wantarray ? @{ $self->{'fields'} || [] } : ($self->{'fields'} || ''); } -# ---------------------------------------------------------------------- sub is_valid { =pod @@ -125,7 +121,6 @@ Determine whether the view is valid or not. return 1; } -# ---------------------------------------------------------------------- sub name { =pod @@ -143,7 +138,6 @@ Get or set the view's name. return $self->{'name'} || ''; } -# ---------------------------------------------------------------------- sub order { =pod @@ -165,7 +159,6 @@ Get or set the view's order. return $self->{'order'} || 0; } -# ---------------------------------------------------------------------- sub sql { =pod @@ -183,7 +176,6 @@ Get or set the view's SQL. return $self->{'sql'} || ''; } -# ---------------------------------------------------------------------- sub schema { =pod @@ -207,7 +199,6 @@ Get or set the view's schema object. return $self->{'schema'}; } -# ---------------------------------------------------------------------- sub equals { =pod @@ -248,7 +239,6 @@ Determines if this view is the same as another return 1; } -# ---------------------------------------------------------------------- sub DESTROY { my $self = shift; undef $self->{'schema'}; # destroy cyclical reference @@ -256,8 +246,6 @@ sub DESTROY { 1; -# ---------------------------------------------------------------------- - =pod =head1 AUTHOR diff --git a/lib/SQL/Translator/Utils.pm b/lib/SQL/Translator/Utils.pm index 980a622..b74d383 100644 --- a/lib/SQL/Translator/Utils.pm +++ b/lib/SQL/Translator/Utils.pm @@ -32,24 +32,6 @@ $DEFAULT_COMMENT = '-- '; ); use constant COLLISION_TAG_LENGTH => 8; -# ---------------------------------------------------------------------- -# debug(@msg) -# -# Will send debugging messages to STDERR, if the caller's $DEBUG global -# is set. -# -# This debug() function has a neat feature: Occurances of the strings -# PKG, LINE, and SUB in each message will be replaced with elements -# from caller(): -# -# debug("PKG: Bad things happened on line LINE!"); -# -# Will be warned as: -# -# [SQL::Translator: Bad things happened on line 643] -# -# If called from Translator.pm, on line 643. -# ---------------------------------------------------------------------- sub debug { my ($pkg, $file, $line, $sub) = caller(0); { @@ -70,7 +52,6 @@ sub debug { } } -# ---------------------------------------------------------------------- sub normalize_name { my $name = shift or return ''; @@ -91,7 +72,6 @@ sub normalize_name { return $name; } -# ---------------------------------------------------------------------- sub header_comment { my $producer = shift || caller; my $comment_char = shift; @@ -115,13 +95,6 @@ HEADER_COMMENT return $header_comment; } -# ---------------------------------------------------------------------- -# parse_list_arg -# -# Meant to accept a list, an array reference, or a string of -# comma-separated values. Retuns an array reference of the -# arguments. Modified to also handle a list of references. -# ---------------------------------------------------------------------- sub parse_list_arg { my $list = UNIVERSAL::isa( $_[0], 'ARRAY' ) ? shift : [ @_ ]; @@ -143,14 +116,6 @@ sub parse_list_arg { } } -# ---------------------------------------------------------------------- -# truncate_id_uniquely( $desired_name, $max_symbol_length ) -# -# Truncates the name $desired_name to the $max_symbol_length by -# including part of the hash of the full name at the end of the -# truncated name, giving a high probability that the symbol will be -# unique. -# ---------------------------------------------------------------------- sub truncate_id_uniquely { my ( $desired_name, $max_symbol_length ) = @_; @@ -171,13 +136,6 @@ sub truncate_id_uniquely { } -#--------------------------------------------------------------------- -# parse_mysql_version ( $version_string, $result_target) -# -# Attempts to parse an arbitrary string as a mysql version number. -# Returns either a floating point perl style string, or a mysql style -# 5 digit string, depending on the supplied $result_target -#--------------------------------------------------------------------- sub parse_mysql_version { my ($v, $target) = @_; @@ -218,14 +176,6 @@ sub parse_mysql_version { } } -#--------------------------------------------------------------------- -# parse_dbms_version ( $version_string, $target ) -# -# Attempts to parse either a native or perl-style version string into -# a version number format as specified by $target, which can be either -# 'perl' for a perl-style version number, or 'native' for an X.X.X -# style version number. -#--------------------------------------------------------------------- sub parse_dbms_version { my ($v, $target) = @_; @@ -261,8 +211,6 @@ sub parse_dbms_version { 1; -# ---------------------------------------------------------------------- - =pod =head1 NAME @@ -403,6 +351,12 @@ version specifications: 5.001005 (perl style) 30201 (mysql style) +=head2 parse_dbms_version + +Takes a version string (X.Y.Z) or perl style (XX.YYYZZZ) and a target ('perl' +or 'native') transforms the string to the given target style. +to + =head1 AUTHORS Darren Chamberlain Edarren@cpan.orgE,