X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FDB2.pm;h=a5b98c3aafb93a7c4cf42b75ba398a8859574bb0;hb=64ae166780d0cb2b9577e506da9b9b240c146d20;hp=83e2bc7512c2f56cea4e34578345f6e7532d8545;hpb=75d079145a507a0e5ff89b2676d383f4fd1a5511;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/DB2.pm b/lib/DBIx/Class/Storage/DBI/DB2.pm index 83e2bc7..a5b98c3 100644 --- a/lib/DBIx/Class/Storage/DBI/DB2.pm +++ b/lib/DBIx/Class/Storage/DBI/DB2.pm @@ -4,23 +4,23 @@ use strict; use warnings; use base qw/DBIx::Class::Storage::DBI/; +use mro 'c3'; -# __PACKAGE__->load_components(qw/PK::Auto/); +__PACKAGE__->sql_limit_dialect ('RowNumberOver'); -sub last_insert_id -{ - my ($self) = @_; +sub _dbh_last_insert_id { + my ($self, $dbh, $source, $col) = @_; - my $dbh = $self->_dbh; - my $sth = $dbh->prepare_cached("VALUES(IDENTITY_VAL_LOCAL())", {}, 3); + my $sth = $dbh->prepare_cached('VALUES(IDENTITY_VAL_LOCAL())', {}, 3); $sth->execute(); my @res = $sth->fetchrow_array(); return @res ? $res[0] : undef; - } +sub datetime_parser_type { "DateTime::Format::DB2"; } + 1; =head1 NAME @@ -30,7 +30,7 @@ DBIx::Class::Storage::DBI::DB2 - Automatic primary key class for DB2 =head1 SYNOPSIS # In your table classes - __PACKAGE__->load_components(qw/PK::Auto Core/); + use base 'DBIx::Class::Core'; __PACKAGE__->set_primary_key('id'); =head1 DESCRIPTION