From: Ken Youens-Clark Date: Tue, 9 Mar 2004 19:11:30 +0000 (+0000) Subject: Added options for new Dumper producer. X-Git-Tag: v0.06~148 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e8aa1b677c8fd468ece886da659db8087bb91d9b;p=dbsrgits%2FSQL-Translator.git Added options for new Dumper producer. --- diff --git a/bin/sqlt b/bin/sqlt index e4e2787..3d928ce 100755 --- a/bin/sqlt +++ b/bin/sqlt @@ -2,7 +2,7 @@ # vim: set ft=perl: # ------------------------------------------------------------------- -# $Id: sqlt,v 1.12 2004-02-06 17:48:16 kycl4rk Exp $ +# $Id: sqlt,v 1.13 2004-03-09 19:11:30 kycl4rk Exp $ # ------------------------------------------------------------------- # Copyright (C) 2002-4 SQLFairy Authors # @@ -72,6 +72,15 @@ To translate a schema: --imap-file Filename to put image map data --imap-url URL to use for image map + Dumper Producer Options: + + --skip Comma-separated list of tables to skip + --skiplike Regex for tables to skip + --dumper-db-user Database user for dumper script + --dumper-db-pass Database password for dumper script + --dumper-dsn DSN for dumper script + --add-truncate Add "TRUNCATE TABLE" statements for each table + HTML/POD Producer Options: --pretty Use CGI::Pretty for the output @@ -112,7 +121,7 @@ use Pod::Usage; use SQL::Translator; use vars qw( $VERSION ); -$VERSION = sprintf "%d.%02d", q$Revision: 1.12 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.13 $ =~ /(\d+)\.(\d+)/; my $from; # the original database my $to; # the destination database @@ -139,32 +148,44 @@ my $attrib_values; # use XML attributes instead of tags my $dsn; # DBI parser my $db_user; # DBI parser my $db_password; # DBI parser +my $skip; +my $skiplike; +my $dumper_db_user; +my $dumper_db_pass; +my $dumper_dsn; +my $add_truncate; GetOptions( - 'add-drop-table' => \$add_drop_table, - 'attrib-values' => \$attrib_values, - 'd|debug' => \$debug, - 'emit-empty-tags' => \$emit_empty_tags, - 'f|from|parser:s' => \$from, - 'fs:s' => \$field_separator, - 'h|help' => \$help, - 'imap-file:s' => \$imap_file, - 'imap-url:s' => \$imap_url, - 't|to|producer:s' => \$to, - 'l|list' => \$list, - 'pretty!' => \$pretty, - 'no-comments' => \$no_comments, - 'no-scan' => \$no_scan, - 'no-trim' => \$no_trim, - 'rs:s' => \$record_separator, - 'show-warnings' => \$show_warnings, - 'template:s' => \$template, - 'title:s' => \$title, - 'trace' => \$trace, - 'v|validate' => \$validate, - 'dsn:s' => \$dsn, - 'db-user:s' => \$db_user, - 'db-password:s' => \$db_password, + 'add-drop-table' => \$add_drop_table, + 'attrib-values' => \$attrib_values, + 'd|debug' => \$debug, + 'emit-empty-tags' => \$emit_empty_tags, + 'f|from|parser:s' => \$from, + 'fs:s' => \$field_separator, + 'h|help' => \$help, + 'imap-file:s' => \$imap_file, + 'imap-url:s' => \$imap_url, + 't|to|producer:s' => \$to, + 'l|list' => \$list, + 'pretty!' => \$pretty, + 'no-comments' => \$no_comments, + 'no-scan' => \$no_scan, + 'no-trim' => \$no_trim, + 'rs:s' => \$record_separator, + 'show-warnings' => \$show_warnings, + 'template:s' => \$template, + 'title:s' => \$title, + 'trace' => \$trace, + 'v|validate' => \$validate, + 'dsn:s' => \$dsn, + 'db-user:s' => \$db_user, + 'db-password:s' => \$db_password, + 'dumper-dsn:s' => \$dumper_dsn, + 'dumper-db-user:s' => \$dumper_db_user, + 'dumper-db-pass:s' => \$dumper_db_pass, + 'skip:s' => \$skip, + 'skiplike:s' => \$skiplike, + 'add_truncate' => \$add_truncate, ) or pod2usage(2); my @files = @ARGV; # source files @@ -203,6 +224,12 @@ my $translator = SQL::Translator->new( title => $title, emit_empty_tags => $emit_empty_tags, attrib_values => $attrib_values, + dsn => $dumper_dsn, + db_user => $dumper_db_user, + db_password => $dumper_db_pass, + skip => $skip, + skiplike => $skiplike, + add_truncate => $add_truncate, }, );