workaround for evil ADO bug
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / ADO / Microsoft_SQL_Server.pm
1 package DBIx::Class::Storage::DBI::ADO::Microsoft_SQL_Server;
2
3 use strict;
4 use warnings;
5
6 use base qw/
7   DBIx::Class::Storage::DBI::ADO
8   DBIx::Class::Storage::DBI::MSSQL
9 /;
10 use mro 'c3';
11
12 sub _rebless {
13   my $self = shift;
14   $self->_identity_method('@@identity');
15 }
16
17 sub _sth_bind_param {
18   my ($self, $sth, $placeholder_index, $data, $attributes, @extra) = @_;
19
20   $attributes->{ado_size} = 8000; # max VARCHAR on MSSQL
21
22   $self->next::method($sth, $placeholder_index, $data, $attributes, @extra);
23 }
24
25 1;
26
27 =head1 NAME
28
29 DBIx::Class::Storage::DBI::ADO::Microsoft_SQL_Server - Support for Microsoft
30 SQL Server via DBD::ADO
31
32 =head1 SYNOPSIS
33
34 This subclass supports MSSQL server connections via L<DBD::ADO>.
35
36 =head1 DESCRIPTION
37
38 The MSSQL specific functionality is provided by
39 L<DBIx::Class::Storage::DBI::MSSQL>.
40
41 C<_identity_method> is set to C<@@identity>, as C<SCOPE_IDENTITY()> doesn't work
42 with L<DBD::ADO>. See L<DBIx::Class::Storage::DBI::MSSQL/IMPLEMENTATION NOTES>
43 for caveats regarding this.
44
45 =head1 AUTHOR
46
47 See L<DBIx::Class/CONTRIBUTORS>.
48
49 =head1 LICENSE
50
51 You may distribute this code under the same terms as Perl itself.
52
53 =cut