From: Justin Hunter Date: Fri, 3 Jul 2009 21:57:21 +0000 (-0700) Subject: use filename instead of ddl X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bab65ec9d6929606bdea1a226ddad3ce1b6b1526;p=dbsrgits%2FSQL-Translator-2.0-ish.git use filename instead of ddl --- diff --git a/lib/SQL/Translator/Parser.pm b/lib/SQL/Translator/Parser.pm index 13e3eb0..78d88ec 100644 --- a/lib/SQL/Translator/Parser.pm +++ b/lib/SQL/Translator/Parser.pm @@ -3,7 +3,6 @@ use namespace::autoclean; use Moose; use MooseX::Types::Moose qw(Str); use SQL::Translator::Types qw(DBIHandle); -#extends 'SQL::Translator'; my $apply_role_dbi = sub { my $self = shift; @@ -22,7 +21,7 @@ has 'dbh' => ( trigger => $apply_role_dbi, ); -has 'ddl' => ( +has 'filename' => ( isa => Str, is => 'ro', predicate => 'has_ddl', @@ -31,13 +30,12 @@ has 'ddl' => ( sub BUILD {} -after BUILD => sub { +sub parse { my $self = shift; my $schema = SQL::Translator::Object::Schema->new({ name => $self->schema_name }); $self->_add_tables($schema); - use Data::Dumper; - print Dumper($schema); -}; + $schema; +} __PACKAGE__->meta->make_immutable;