Merge 'trunk' into 'DBIx-Class-current'
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / MSSQL.pm
CommitLineData
75d07914 1package DBIx::Class::Storage::DBI::MSSQL;
3885cff6 2
75d07914 3use strict;
4use warnings;
3885cff6 5
81092e2d 6use base qw/DBIx::Class::Storage::DBI/;
3885cff6 7
75d07914 8sub last_insert_id {
a9f32dbc 9 my $self = shift;
10 my ($id) =
11 $self->dbh_do( sub { shift->selectrow_array('SELECT @@IDENTITY' ) } );
75d07914 12 return $id;
13}
ed8de058 14
15sub build_datetime_parser {
16 my $self = shift;
17 my $type = "DateTime::Format::Strptime";
18 eval "use ${type}";
19 $self->throw_exception("Couldn't load ${type}: $@") if $@;
20 return $type->new( pattern => '%m/%d/%Y %H:%M:%S' );
21}
3885cff6 22
75d07914 231;
3885cff6 24
75d07914 25=head1 NAME
3885cff6 26
27DBIx::Class::Storage::DBI::MSSQL - Storage::DBI subclass for MSSQL
28
75d07914 29=head1 SYNOPSIS
3885cff6 30
81092e2d 31This subclass supports MSSQL, and can in theory be used directly
32via the C<storage_type> mechanism:
3885cff6 33
34 $schema->storage_type('::DBI::MSSQL');
81092e2d 35 $schema->connect_info('dbi:....', ...);
36
37However, as there is no L<DBD::MSSQL>, you will probably want to use
38one of the other DBD-specific MSSQL classes, such as
39L<DBIx::Class::Storage::DBI::Sybase::MSSQL>. These classes will
40merge this class with a DBD-specific class to obtain fully
41correct behavior for your scenario.
3885cff6 42
75d07914 43=head1 AUTHORS
3885cff6 44
75d07914 45Brian Cassidy <bricas@cpan.org>
3885cff6 46
75d07914 47=head1 LICENSE
3885cff6 48
75d07914 49You may distribute this code under the same terms as Perl itself.
3885cff6 50
75d07914 51=cut