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