From: Ken Youens-Clark Date: Mon, 16 Jun 2003 18:16:25 +0000 (+0000) Subject: Removed some things that don't actually work. X-Git-Tag: v0.02~25 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=35d7535160232b1b3e1c1651145aa59e771fa6d3;p=dbsrgits%2FSQL-Translator.git Removed some things that don't actually work. --- diff --git a/bin/sql_translator.pl b/bin/sql_translator.pl index 0132d36..7eb215b 100755 --- a/bin/sql_translator.pl +++ b/bin/sql_translator.pl @@ -1,7 +1,7 @@ #!/usr/bin/perl -w # ------------------------------------------------------------------- -# $Id: sql_translator.pl,v 1.9 2003-05-12 14:48:43 kycl4rk Exp $ +# $Id: sql_translator.pl,v 1.10 2003-06-16 18:16:25 kycl4rk Exp $ # ------------------------------------------------------------------- # Copyright (C) 2002 Ken Y. Clark , # darren chamberlain @@ -29,7 +29,7 @@ use SQL::Translator; use Data::Dumper; use vars qw( $VERSION ); -$VERSION = sprintf "%d.%02d", q$Revision: 1.9 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.10 $ =~ /(\d+)\.(\d+)/; my $from; # the original database my $to; # the destination database @@ -38,7 +38,6 @@ my $stdin; # whether to read STDIN for create script my $no_comments; # whether to put comments in out file my $show_warnings; # whether to show warnings from SQL::Translator my $add_drop_table; # whether to show warnings from SQL::Translator -my $xlate; # user overrides for field translation my $debug; # whether to print debug info my $trace; # whether to print parser trace my $list; # list all parsers and producers @@ -46,6 +45,7 @@ my $no_trim; # don't trim whitespace on xSV fields my $no_scan; # don't scan xSV fields for data types and sizes my $field_separator; # for xSV files my $record_separator; # for xSV files +my $validate; # whether to validate the parsed document # # Get options, explain how to use the script if necessary. @@ -60,6 +60,7 @@ GetOptions( 'no-comments' => \$no_comments, 'show-warnings' => \$show_warnings, 'add-drop-table' => \$add_drop_table, + 'v|validate' => \$validate, 'no-trim' => \$no_trim, 'no-scan' => \$no_scan, 'fs:s' => \$field_separator, @@ -70,25 +71,16 @@ my @files = @ARGV; # the create script(s) for the original db pod2usage(1) if $help; -if ( $xlate ) { - my @fields = split /,/, $xlate; - $xlate = {}; - for my $field ( @fields ) { - my ( $from, $to ) = split(/\//, $field); - $xlate->{$from} = $to; - } -} - # # If everything is OK, translate file(s). # my $translator = SQL::Translator->new( - xlate => $xlate || {}, debug => $debug || 0, trace => $trace || 0, no_comments => $no_comments || 0, show_warnings => $show_warnings || 0, add_drop_table => $add_drop_table || 0, + validate => $validate || 0, parser_args => { trim_fields => $no_trim ? 0 : 1, scan_fields => $no_scan ? 0 : 1, @@ -154,6 +146,7 @@ To translate a schema: Options: -d|--debug Print debug info + -v|--validate Validate the schema --trace Print parser trace info --no-comments Don't include comments in SQL output --show-warnings Print to STDERR warnings of conflicts, etc.