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=08fabf592cfb90f174428eb8ac258caed293e6f7;hp=171c17a6a1628abdb499a67c0f55397a00c711c7;hpb=75d079145a507a0e5ff89b2676d383f4fd1a5511;p=dbsrgits%2FDBIx-Class-Historic.git diff --git a/lib/DBIx/Class/Storage/DBI/MSSQL.pm b/lib/DBIx/Class/Storage/DBI/MSSQL.pm index 171c17a..dcfe895 100644 --- a/lib/DBIx/Class/Storage/DBI/MSSQL.pm +++ b/lib/DBIx/Class/Storage/DBI/MSSQL.pm @@ -1,39 +1,50 @@ 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; } - + +sub build_datetime_parser { + my $self = shift; + my $type = "DateTime::Format::Strptime"; + eval "use ${type}"; + $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