#!/usr/bin/env perl
# vim: set ft=perl:
+# -------------------------------------------------------------------
+# Copyright (C) 2002-2009 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
+# -------------------------------------------------------------------
+
=head1 NAME
sqlt - convert SQL schema using SQL::Translator
General Parser Options:
--skip Comma-separated list of tables to skip (only implemented in some parsers)
- --ignore_opts Comma-separated list of table options to ignore
+ --ignore_opts Comma-separated list of table options to ignore
DBI Parser Options:
) or pod2usage(2);
if ($use_same_auth) {
- $producer_dsn = $dsn;
- $producer_db_user = $db_user;
- $producer_db_password = $db_password;
+ $producer_dsn = $dsn;
+ $producer_db_user = $db_user;
+ $producer_db_password = $db_password;
}
-if (
+if (
( !defined $from && defined $dsn )
||
$from =~ /^DBI.*/
exit(0);
}
-my $translator = SQL::Translator->new(
+my $translator = SQL::Translator->new(
debug => $debug || 0,
trace => $trace || 0,
no_comments => $no_comments || 0,
newlines => $newlines,
postgres_version => $postgres_version,
mysql_version => $mysql_version,
- package_name => $package_name,
+ package_name => $package_name,
},
);
$translator->producer($to);
for my $file (@files) {
- my @args =
+ my @args =
($file eq '-') ? (data => \*STDIN) :
($file eq '!') ? (data => '') :
(file => $file);