1 package DBIx::Class::Storage::DBI::Sybase::Common;
6 use base qw/DBIx::Class::Storage::DBI/;
11 DBIx::Class::Storage::DBI::Sybase::Common - Common functionality for drivers using
16 This is the base class for L<DBIx::Class::Storage::DBI::Sybase> and
17 L<DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server>. It provides some
18 utility methods related to L<DBD::Sybase> and the supported functions of the
19 database you are connecting to.
28 my $dbh = $self->_dbh or return 0;
30 local $dbh->{RaiseError} = 1;
38 sub _set_max_connect {
40 my $val = shift || 256;
42 my $dsn = $self->_dbi_connect_info->[0];
44 return if ref($dsn) eq 'CODE';
46 if ($dsn !~ /maxConnect=/) {
47 $self->_dbi_connect_info->[0] = "$dsn;maxConnect=$val";
48 my $connected = defined $self->_dbh;
50 $self->ensure_connected if $connected;
56 Whether or not L<DBD::Sybase> was compiled against FreeTDS. If false, it means
57 the Sybase OpenClient libraries were used.
64 return $self->_dbh->{syb_oc_version} =~ /freetds/i;
69 When using FreeTDS and/or MSSQL, C<< $dbh->{LongReadLen} >> is not available,
70 use this function instead. It does:
72 $dbh->do("SET TEXTSIZE $bytes");
74 Takes the number of bytes, or uses the C<LongReadLen> value from your
75 L<DBIx::Class/connect_info> if omitted.
81 my $text_size = shift ||
82 eval { $self->_dbi_connect_info->[-1]->{LongReadLen} };
84 return unless defined $text_size;
86 $self->_dbh->do("SET TEXTSIZE $text_size");
93 See L<DBIx::Class/CONTRIBUTORS>.
97 You may distribute this code under the same terms as Perl itself.