Commit | Line | Data |
98464041 |
1 | package DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server; |
2 | |
3 | use strict; |
4 | use warnings; |
2ad62d97 |
5 | |
528accab |
6 | use base qw/ |
eabab5d0 |
7 | DBIx::Class::Storage::DBI::Sybase::Base |
5a77aa8b |
8 | DBIx::Class::Storage::DBI::MSSQL |
528accab |
9 | /; |
2ad62d97 |
10 | use mro 'c3'; |
98464041 |
11 | |
9b3dabe0 |
12 | sub _rebless { |
13 | my $self = shift; |
86e68d2d |
14 | my $dbh = $self->last_dbh; |
7379eb67 |
15 | |
b4ad6d39 |
16 | if (not $self->placeholders_with_type_conversion_supported) { |
7379eb67 |
17 | bless $self, |
18 | 'DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server::NoBindVars'; |
19 | $self->_rebless; |
20 | } |
b5453fbb |
21 | |
22 | # LongReadLen doesn't work with MSSQL through DBD::Sybase, and the default is |
23 | # huge on some versions of SQL server and can cause memory problems, so we |
24 | # fix it up here. |
7379eb67 |
25 | my $text_size = eval { $self->_dbi_connect_info->[-1]->{LongReadLen} } || |
26 | 32768; # the DBD::Sybase default |
27 | |
28 | $dbh->do("set textsize $text_size"); |
9b3dabe0 |
29 | } |
30 | |
98464041 |
31 | 1; |
32 | |
33 | =head1 NAME |
34 | |
5a77aa8b |
35 | DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server - Support for Microsoft |
36 | SQL Server via DBD::Sybase |
98464041 |
37 | |
38 | =head1 SYNOPSIS |
39 | |
5608593e |
40 | This subclass supports MSSQL server connections via L<DBD::Sybase>. |
98464041 |
41 | |
7379eb67 |
42 | =head1 DESCRIPTION |
d4483998 |
43 | |
7379eb67 |
44 | This driver tries to determine whether your version of L<DBD::Sybase> and |
45 | supporting libraries (usually FreeTDS) support using placeholders, if not the |
46 | storage will be reblessed to |
47 | L<DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server::NoBindVars>. |
98464041 |
48 | |
7379eb67 |
49 | The MSSQL specific functionality is provided by |
50 | L<DBIx::Class::Storage::DBI::MSSQL>. |
7e8cecc1 |
51 | |
5a77aa8b |
52 | =head1 AUTHOR |
98464041 |
53 | |
b7505130 |
54 | See L<DBIx::Class/CONTRIBUTORS>. |
98464041 |
55 | |
56 | =head1 LICENSE |
57 | |
58 | You may distribute this code under the same terms as Perl itself. |
59 | |
60 | =cut |