X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FODBC%2FDB2_400_SQL.pm;h=1bed7f58714550a9823b8082e46cda6c4464f7e1;hb=7f32c82b6791c30615bd6da46063e2a80be3ebc5;hp=cba274a27ea10cf6011465c40e5805ca2c7ab14c;hpb=2a57124dc95b1f1b8b2c2e6003a42b5777c462e4;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/ODBC/DB2_400_SQL.pm b/lib/DBIx/Class/Storage/DBI/ODBC/DB2_400_SQL.pm index cba274a..1bed7f5 100644 --- a/lib/DBIx/Class/Storage/DBI/ODBC/DB2_400_SQL.pm +++ b/lib/DBIx/Class/Storage/DBI/ODBC/DB2_400_SQL.pm @@ -3,12 +3,10 @@ use strict; use warnings; use base qw/DBIx::Class::Storage::DBI::ODBC/; +use mro 'c3'; -sub last_insert_id -{ - my ($self) = @_; - - my $dbh = $self->_dbh; +sub _dbh_last_insert_id { + my ($self, $dbh, $source, $col) = @_; # get the schema/table separator: # '.' when SQL naming is active @@ -23,11 +21,24 @@ sub last_insert_id return @res ? $res[0] : undef; } +sub _sql_maker_opts { + my ($self) = @_; + + $self->dbh_do(sub { + my ($self, $dbh) = @_; + + return { + limit_dialect => 'FetchFirst', + name_sep => $dbh->get_info(41) + }; + }); +} + 1; =head1 NAME -DBIx::Class::Storage::DBI::ODBC::DB2_400_SQL - Automatic primary key class for DB2/400 +DBIx::Class::Storage::DBI::ODBC::DB2_400_SQL - Support specific to DB2/400 over ODBC =head1 SYNOPSIS @@ -39,12 +50,14 @@ over ODBC =head1 DESCRIPTION -This class implements autoincrements for DB2/400 over ODBC. +This class implements support specific to DB2/400 over ODBC, including +auto-increment primary keys, SQL::Abstract::Limit dialect, and name separator +for connections using either SQL naming or System naming. =head1 AUTHORS -Marc Mims C<< >> +Marc Mims C<< >> Based on DBIx::Class::Storage::DBI::DB2 by Jess Robinson.