package SQL::Translator;
+# ----------------------------------------------------------------------
+# Copyright (C) 2002-2009 The SQLFairy Authors
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; version 2.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
+# 02111-1307 USA
+# -------------------------------------------------------------------
+
use strict;
use vars qw( $VERSION $DEFAULT_SUB $DEBUG $ERROR );
use base 'Class::Base';
require 5.005;
-$VERSION = '0.11007';
+$VERSION = '0.11009';
$DEBUG = 0 unless defined $DEBUG;
$ERROR = "";
$self->trace( $config->{'trace'} );
$self->validate( $config->{'validate'} );
-
- $self->quote_table_names( (defined $config->{'quote_table_names'}
+
+ $self->quote_table_names( (defined $config->{'quote_table_names'}
? $config->{'quote_table_names'} : 1) );
- $self->quote_field_names( (defined $config->{'quote_field_names'}
+ $self->quote_field_names( (defined $config->{'quote_field_names'}
? $config->{'quote_field_names'} : 1) );
return $self;
# ----------------------------------------------------------------------
# Does the get/set work for parser and producer. e.g.
-# return $self->_tool({
-# name => 'producer',
+# return $self->_tool({
+# name => 'producer',
# path => "SQL::Translator::Producer",
# default_sub => "produce",
# }, @_);
my $path = $args->{path};
my $default_sub = $args->{default_sub};
my $tool = shift;
-
+
# passed an anonymous subroutine reference
if (isa($tool, 'CODE')) {
$self->{$name} = $tool;
my $uctype = ucfirst lc $type;
#
- # First find all the directories where SQL::Translator
+ # First find all the directories where SQL::Translator
# parsers or producers (the "type") appear to live.
#
load("SQL::Translator::$uctype") or return ();
}
#
- # Now use File::File::find to look recursively in those
+ # Now use File::File::find to look recursively in those
# directories for all the *.pm files, then present them
# with the slashes turned into dashes.
#
my %found;
- find(
- sub {
+ find(
+ sub {
if ( -f && m/\.pm$/ ) {
my $mod = $_;
$mod =~ s/\.pm$//;
return $module if $INC{$file}; # Already loaded
eval { require $file };
- next if $@ =~ /Can't locate $file in \@INC/;
+ next if $@ =~ /Can't locate $file in \@INC/;
eval { $module->import() } unless $@;
return __PACKAGE__->error("Error loading $name as $module : $@")
if $@ && $@ !~ /"SQL::Translator::Producer" is not exported/;
=head2 add_drop_table
-Toggles whether or not to add "DROP TABLE" statements just before the
+Toggles whether or not to add "DROP TABLE" statements just before the
create definitions.
=head2 quote_table_names
define what subroutine is called to produce the output. A subroutine
defined as a producer will be invoked as a function (I<not a method>)
and passed its container C<SQL::Translator> instance, which it should
-call the C<schema> method on, to get the C<SQL::Translator::Schema>
+call the C<schema> method on, to get the C<SQL::Translator::Schema>
generated by the parser. It is expected that the function transform the
-schema structure to a string. The C<SQL::Translator> instance is also useful
+schema structure to a string. The C<SQL::Translator> instance is also useful
for informational purposes; for example, the type of the parser can be
retrieved using the C<parser_type> method, and the C<error> and
C<debug> methods can be called when needed.
=head1 AUTHORS
-Alexander Hartmaier <abraxxa@cpan.org>
-
-Allen Day <allenday@users.sourceforge.net>
-
-Anders Nor Berle <berle@cpan.org>
-
-Andrew Moore <amoore@cpan.org>
-
-Ben Faga <faga@cshl.edu>
-
-Chris Hilton <chilton@alterpoint.com>
-
-Chris Mungall <cjm@fruitfly.org>
-
-Chris To <christot@users.sourceforge.net>
-
-Daniel Ruoso <daniel@ruoso.com>
-
-Darren Chamberlain <dlc@users.sourceforge.net>
-
-Dave Cash <dave@gnofn.org>
-
-Fabien Wernli <faxmodem@cpan.org>
-
-Geoff Cant <geoff@catalyst.net.nz>
-
-Gudmundur A. Thorisson <mummi@cshl.org>
-
-Guillermo Roditi <groditi@cpan.org>
-
-Jason Williams <smdwilliams@users.sourceforge.net>
-
-Jonathan Yu <jawnsy@cpan.org>
-
-John Goulah <jgoulah@cpan.org>
-
-Ken Youens-Clark <kclark@cpan.org>
-
-Kevin McClellan <kdmcclel@gmail.com>
-
-Mark Addison <grommit@users.sourceforge.net>
-
-Mikey Melillo <mmelillo@users.sourceforge.net>
-
-Moritz Onken <onken@netcubed.de>
-
-Paul Harrington <phrrngtn@users.sourceforge.net>
-
-Peter Rabbitson <ribasushi@cpan.org>
-
-Ross Smith II <rossta@users.sf.net>
-
-Ryan D Johnson <ryan@innerfence.com>
-
-Sam Angiuoli <angiuoli@users.sourceforge.net>
-
-Stephen Bennett <stephen@freenode.net>
-
-Stephen Clouse <stephenclouse@gmail.com>
-
-Wallace Reis <wreis@cpan.org>
-
-Ying Zhang <zyolive@yahoo.com>
-
-=head1 COPYRIGHT
-
-Copyright (c) 2002-2011 the SQL::Translator L</AUTHORS> as listed
-above.
+See the included AUTHORS file:
+L<http://search.cpan.org/dist/SQL-Translator/AUTHORS>
If you would like to contribute to the project, you can send patches
to the developers mailing list:
Or send us a message (with your Sourceforge username) asking to be
added to the project and what you'd like to contribute.
-=head1 LICENSE
+
+=head1 COPYRIGHT
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
=head1 PRAISE
-If you find this module useful, please use
+If you find this module useful, please use
L<http://cpanratings.perl.org/rate/?distribution=SQL-Translator> to rate it.
=head1 SEE ALSO