From: Allen Day Date: Fri, 15 Oct 2004 02:23:30 +0000 (+0000) Subject: patch for parser/producer args courtesy of darren (w/ embellishments by me) X-Git-Tag: v0.11008~610 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=47fed978e23b8c832e87e0a9ed524f32e20babd2;p=dbsrgits%2FSQL-Translator.git patch for parser/producer args courtesy of darren (w/ embellishments by me) --- diff --git a/lib/SQL/Translator.pm b/lib/SQL/Translator.pm index 446fa21..74cc734 100644 --- a/lib/SQL/Translator.pm +++ b/lib/SQL/Translator.pm @@ -1,7 +1,7 @@ package SQL::Translator; # ---------------------------------------------------------------------- -# $Id: Translator.pm,v 1.57 2004-04-22 19:59:46 kycl4rk Exp $ +# $Id: Translator.pm,v 1.58 2004-10-15 02:23:29 allenday Exp $ # ---------------------------------------------------------------------- # Copyright (C) 2002-4 The SQLFairy Authors # @@ -27,7 +27,7 @@ use base 'Class::Base'; require 5.004; $VERSION = '0.06'; -$REVISION = sprintf "%d.%02d", q$Revision: 1.57 $ =~ /(\d+)\.(\d+)/; +$REVISION = sprintf "%d.%02d", q$Revision: 1.58 $ =~ /(\d+)\.(\d+)/; $DEBUG = 0 unless defined $DEBUG; $ERROR = ""; @@ -426,7 +426,10 @@ sub schema { my $self = shift; unless ( defined $self->{'schema'} ) { - $self->{'schema'} = SQL::Translator::Schema->new; + $self->{'schema'} = SQL::Translator::Schema->new( + parser_args => $self->parser_args, + producer_args => $self->producer_args, + ); } return $self->{'schema'}; diff --git a/lib/SQL/Translator/Schema.pm b/lib/SQL/Translator/Schema.pm index 36bd610..d2f9ba4 100644 --- a/lib/SQL/Translator/Schema.pm +++ b/lib/SQL/Translator/Schema.pm @@ -1,7 +1,7 @@ package SQL::Translator::Schema; # ---------------------------------------------------------------------- -# $Id: Schema.pm,v 1.16 2004-10-13 23:14:06 allenday Exp $ +# $Id: Schema.pm,v 1.17 2004-10-15 02:23:30 allenday Exp $ # ---------------------------------------------------------------------- # Copyright (C) 2002-4 SQLFairy Authors # @@ -55,7 +55,7 @@ use SQL::Translator::Utils 'parse_list_arg'; use base 'Class::Base'; use vars qw[ $VERSION $TABLE_ORDER $VIEW_ORDER $TRIGGER_ORDER $PROC_ORDER ]; -$VERSION = sprintf "%d.%02d", q$Revision: 1.16 $ =~ /(\d+)\.(\d+)/; +$VERSION = sprintf "%d.%02d", q$Revision: 1.17 $ =~ /(\d+)\.(\d+)/; # ---------------------------------------------------------------------- sub init { @@ -74,7 +74,8 @@ Object constructor. =cut my ( $self, $config ) = @_; - $self->params( $config, qw[ name database ] ) || return undef; + $self->params( $config, qw[ name database parser_args producer_args ] ) + || return undef; return $self; } @@ -598,6 +599,24 @@ Get or set the schema's name. (optional) return $self->{'name'} || ''; } +=head2 parser_args + +=cut + +sub parser_args { + my $self = shift; + return $self->{'parser_args'}; +} + +=head2 producer_args + +=cut + +sub producer_args { + my $self = shift; + return $self->{'producer_args'}; +} + # ---------------------------------------------------------------------- sub DESTROY { my $self = shift;