X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDBIx%2FClass%2FStorage%2FDBI%2FMSSQL.pm;h=dcfe8952f24a156831a57a581c2078899ea05fef;hb=e7827df02409b8e642cd68fca01de4a1c8fbb628;hp=a303d253919b416d577002de4cc66bb1f2c5df01;hpb=ed8de058d4898d62c85d317f741ec3ac50bb6ad2;p=dbsrgits%2FDBIx-Class.git diff --git a/lib/DBIx/Class/Storage/DBI/MSSQL.pm b/lib/DBIx/Class/Storage/DBI/MSSQL.pm index a303d25..dcfe895 100644 --- a/lib/DBIx/Class/Storage/DBI/MSSQL.pm +++ b/lib/DBIx/Class/Storage/DBI/MSSQL.pm @@ -1,14 +1,13 @@ package DBIx::Class::Storage::DBI::MSSQL; - + use strict; use warnings; - + use base qw/DBIx::Class::Storage::DBI/; - -# __PACKAGE__->load_components(qw/PK::Auto/); - -sub last_insert_id { - my( $id ) = $_[0]->_dbh->selectrow_array('SELECT @@IDENTITY' ); + +sub _dbh_last_insert_id { + my ($self, $dbh, $source, $col) = @_; + my ($id) = $dbh->selectrow_array('SELECT @@IDENTITY'); return $id; } @@ -19,29 +18,33 @@ sub build_datetime_parser { $self->throw_exception("Couldn't load ${type}: $@") if $@; return $type->new( pattern => '%m/%d/%Y %H:%M:%S' ); } - + 1; - + =head1 NAME - -DBIx::Class::Storage::DBI::MSSQL - Automatic primary key class for MSSQL - + +DBIx::Class::Storage::DBI::MSSQL - Storage::DBI subclass for MSSQL + =head1 SYNOPSIS - - # In your table classes - __PACKAGE__->load_components(qw/PK::Auto Core/); - __PACKAGE__->set_primary_key('id'); - -=head1 DESCRIPTION - -This class implements autoincrements for MSSQL. - + +This subclass supports MSSQL, and can in theory be used directly +via the C mechanism: + + $schema->storage_type('::DBI::MSSQL'); + $schema->connect_info('dbi:....', ...); + +However, as there is no L, you will probably want to use +one of the other DBD-specific MSSQL classes, such as +L. These classes will +merge this class with a DBD-specific class to obtain fully +correct behavior for your scenario. + =head1 AUTHORS - + Brian Cassidy - + =head1 LICENSE - + You may distribute this code under the same terms as Perl itself. - + =cut