From: Justin Hunter Date: Tue, 23 Mar 2010 20:32:19 +0000 (-0700) Subject: DBIx::Class parser stubs X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=885425c59005918ee3e0d8bb3335cec3b52b5924;p=dbsrgits%2FSQL-Translator-2.0-ish.git DBIx::Class parser stubs --- diff --git a/lib/SQL/Translator/Grammar/DBIx/Class.pm b/lib/SQL/Translator/Grammar/DBIx/Class.pm new file mode 100644 index 0000000..190bb21 --- /dev/null +++ b/lib/SQL/Translator/Grammar/DBIx/Class.pm @@ -0,0 +1,3 @@ +use MooseX::Declare; +role SQL::Translator::Grammar::DBIx::Class { +} diff --git a/lib/SQL/Translator/Parser/DDL/DBIx/.Class.pm.swp b/lib/SQL/Translator/Parser/DDL/DBIx/.Class.pm.swp new file mode 100644 index 0000000..eaaeb27 Binary files /dev/null and b/lib/SQL/Translator/Parser/DDL/DBIx/.Class.pm.swp differ diff --git a/lib/SQL/Translator/Parser/DDL/DBIx/Class.pm b/lib/SQL/Translator/Parser/DDL/DBIx/Class.pm new file mode 100644 index 0000000..a20fb1b --- /dev/null +++ b/lib/SQL/Translator/Parser/DDL/DBIx/Class.pm @@ -0,0 +1,20 @@ +use MooseX::Declare; +role SQL::Translator::Parser::DDL::DBIx::Class { + use MooseX::Types::Moose qw(); + use MooseX::MultiMethods; + use SQL::Translator::Constants qw(:sqlt_types :sqlt_constants); + use aliased 'SQL::Translator::Object::Column'; + use aliased 'SQL::Translator::Object::Constraint'; + use aliased 'SQL::Translator::Object::ForeignKey'; + use aliased 'SQL::Translator::Object::Index'; + use aliased 'SQL::Translator::Object::PrimaryKey'; + use aliased 'SQL::Translator::Object::Procedure'; + use aliased 'SQL::Translator::Object::Schema'; + use aliased 'SQL::Translator::Object::Table'; + use aliased 'SQL::Translator::Object::View'; + + multi method parse(Schema $data) { $data } + + multi method parse(Str $data) { + } +} diff --git a/t/999dbic_parser.t b/t/999dbic_parser.t new file mode 100644 index 0000000..dbb0420 --- /dev/null +++ b/t/999dbic_parser.t @@ -0,0 +1,17 @@ +use strict; +use warnings; +use Test::More; +use SQL::Translator; +use SQL::Translator::Constants qw(:sqlt_types :sqlt_constants); + +my $t = SQL::Translator->new( trace => 0, from => 'DBIx::Class' ); +$| = 1; + +my $sql = ''; + +my $data = $t->parse( $sql ); +my $schema = $t->schema; + +isa_ok( $schema, 'SQL::Translator::Object::Schema', 'Schema object' ); + +done_testing;