From: Justin Hunter Date: Wed, 5 Aug 2009 22:53:28 +0000 (-0700) Subject: initial mysql dbi parser role X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6fbb2193ef6a764859b0c229b98c614b01cbf12d;p=dbsrgits%2FSQL-Translator-2.0-ish.git initial mysql dbi parser role --- diff --git a/lib/SQL/Translator/Parser/DBI/MySQL.pm b/lib/SQL/Translator/Parser/DBI/MySQL.pm index 6085b81..cc9c6f5 100644 --- a/lib/SQL/Translator/Parser/DBI/MySQL.pm +++ b/lib/SQL/Translator/Parser/DBI/MySQL.pm @@ -1,3 +1,22 @@ use MooseX::Declare; role SQL::Translator::Parser::DBI::MySQL { + use MooseX::Types::Moose qw(HashRef Str); + use SQL::Translator::Types qw(View); + + method _get_view_sql(View $view) { + #my ($sql) = $self->dbh->selectrow_array(''); + #return $sql; + return ''; + } + + method _is_auto_increment(HashRef $column_info) { + return $column_info->{mysql_is_auto_increment}; + } + + method _column_default_value(HashRef $column_info) { + my $default_value = $column_info->{COLUMN_DEF}; + $default_value =~ s/::.*$// if defined $default_value + + return $default_value; + } }