47678e35b985b097ad3ce0d7f4c9b1a61fd6ffd9
[dbsrgits/DBIx-Class.git] / lib / DBIx / Class / Storage / DBI / Sybase / Microsoft_SQL_Server.pm
1 package DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server;
2
3 use strict;
4 use warnings;
5
6 use base qw/
7   DBIx::Class::Storage::DBI::Sybase::Base
8   DBIx::Class::Storage::DBI::MSSQL
9 /;
10 use mro 'c3';
11
12 sub _rebless {
13   my $self = shift;
14   my $dbh  = $self->_get_dbh;
15
16   if (not $self->_typeless_placeholders_supported) {
17     bless $self,
18       'DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server::NoBindVars';
19     $self->_rebless;
20   }
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.
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");
29 }
30
31
32 1;
33
34 =head1 NAME
35
36 DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server - Support for Microsoft
37 SQL Server via DBD::Sybase
38
39 =head1 SYNOPSIS
40
41 This subclass supports MSSQL server connections via L<DBD::Sybase>.
42
43 =head1 DESCRIPTION
44
45 This driver tries to determine whether your version of L<DBD::Sybase> and
46 supporting libraries (usually FreeTDS) support using placeholders, if not the
47 storage will be reblessed to
48 L<DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server::NoBindVars>.
49
50 The MSSQL specific functionality is provided by
51 L<DBIx::Class::Storage::DBI::MSSQL>.
52
53 =head1 AUTHOR
54
55 See L<DBIx::Class/CONTRIBUTORS>.
56
57 =head1 LICENSE
58
59 You may distribute this code under the same terms as Perl itself.
60
61 =cut