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 |
8c44d0f2 |
8 | DBIx::Class::Storage::DBI::ODBC::Microsoft_SQL_Server |
f0070d01 |
9 | DBIx::Class::Storage::DBI::NoBindVars |
528accab |
10 | /; |
2ad62d97 |
11 | use mro 'c3'; |
98464041 |
12 | |
9b3dabe0 |
13 | sub _rebless { |
14 | my $self = shift; |
15 | $self->disable_sth_caching(1); |
b5453fbb |
16 | |
17 | # LongReadLen doesn't work with MSSQL through DBD::Sybase, and the default is |
18 | # huge on some versions of SQL server and can cause memory problems, so we |
19 | # fix it up here. |
20 | my $dbh = $self->_dbh; |
21 | |
22 | my $text_size = eval { $self->_dbi_connect_info->[-1]->{LongReadLen} } || |
23 | 32768; # the DBD::Sybase default |
24 | |
25 | $dbh->do("set textsize $text_size"); |
9b3dabe0 |
26 | } |
27 | |
98464041 |
28 | 1; |
29 | |
30 | =head1 NAME |
31 | |
32 | DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server - Storage::DBI subclass for MSSQL via |
33 | DBD::Sybase |
34 | |
35 | =head1 SYNOPSIS |
36 | |
5608593e |
37 | This subclass supports MSSQL server connections via L<DBD::Sybase>. |
98464041 |
38 | |
d4483998 |
39 | =head1 CAVEATS |
98464041 |
40 | |
d4483998 |
41 | This storage driver uses L<DBIx::Class::Storage::DBI::NoBindVars> as a base. |
42 | This means that bind variables will be interpolated (properly quoted of course) |
43 | into the SQL query itself, without using bind placeholders. |
44 | |
45 | More importantly this means that caching of prepared statements is explicitly |
46 | disabled, as the interpolation renders it useless. |
98464041 |
47 | |
7e8cecc1 |
48 | The actual driver code for MSSQL is in |
49 | L<DBIx::Class::Storage::DBI::ODBC::Microsoft_SQL_Server>. |
50 | |
98464041 |
51 | =head1 AUTHORS |
52 | |
b7505130 |
53 | See L<DBIx::Class/CONTRIBUTORS>. |
98464041 |
54 | |
55 | =head1 LICENSE |
56 | |
57 | You may distribute this code under the same terms as Perl itself. |
58 | |
59 | =cut |