X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FSQL%2FTranslator.pm;h=9a1e235c12d6e800073516af55d198fb2c20725c;hb=f56361ad7eea3245af7ec5b0eaed5ca439bd6168;hp=9e1d0b5b8a539a9367ea3b0e1dd93d1e65d43361;hpb=2bdef63659f546187a4d1266e88aa66671b228b7;p=dbsrgits%2FSQL-Translator.git diff --git a/lib/SQL/Translator.pm b/lib/SQL/Translator.pm index 9e1d0b5..9a1e235 100644 --- a/lib/SQL/Translator.pm +++ b/lib/SQL/Translator.pm @@ -3,7 +3,7 @@ package SQL::Translator; use Moo 1.000003; our ( $DEFAULT_SUB, $DEBUG, $ERROR ); -our $VERSION = '0.11013'; +our $VERSION = '0.11013_02'; $DEBUG = 0 unless defined $DEBUG; $ERROR = ""; @@ -17,7 +17,7 @@ use IO::Dir; use Sub::Quote qw(quote_sub); use SQL::Translator::Producer; use SQL::Translator::Schema; -use SQL::Translator::Utils qw(throw ex2err); +use SQL::Translator::Utils qw(throw ex2err carp_ro); $DEFAULT_SUB = sub { $_[0]->schema } unless defined $DEFAULT_SUB; @@ -90,7 +90,7 @@ sub BUILD { has $_ => ( is => 'rw', default => quote_sub(q{ 0 }), - coerce => sub { $_[0] ? 1 : 0 }, + coerce => quote_sub(q{ $_[0] ? 1 : 0 }), ) foreach qw(add_drop_table no_comments show_warnings trace validate); # quote_identifiers is on by default, use a 0-but-true as indicator @@ -98,7 +98,7 @@ has $_ => ( has quote_identifiers => ( is => 'rw', default => quote_sub(q{ '0E0' }), - coerce => sub { $_[0] || 0 }, + coerce => quote_sub(q{ $_[0] || 0 }), ); sub quote_table_names { @@ -136,6 +136,8 @@ around producer => sub { has producer_type => ( is => 'rwp', init_arg => undef ); +around producer_type => carp_ro('producer_type'); + has producer_args => ( is => 'rw', default => quote_sub(q{ +{} }) ); around producer_args => sub { @@ -157,6 +159,8 @@ around parser => sub { has parser_type => ( is => 'rwp', init_arg => undef ); +around parser_type => carp_ro('parser_type'); + has parser_args => ( is => 'rw', default => quote_sub(q{ +{} }) ); around parser_args => sub { @@ -272,6 +276,8 @@ has schema => ( predicate => '_has_schema', ); +around schema => carp_ro('schema'); + around reset => sub { my $orig = shift; my $self = shift;