try {
$dbtype = @{$self->_get_dbh->selectrow_arrayref(qq{sp_server_info \@attribute_id=1})}[2]
} catch {
- $self->throw_exception("Unable to estable connection to determine database type: $_")
+ $self->throw_exception("Unable to establish connection to determine database type: $_")
};
if ($dbtype) {
# once the driver is determined see if we need to insert the DBD::Sybase w/ FreeTDS fixups
# this is a dirty version of "instance role application", \o/ DO WANT Moo \o/
my $self = shift;
- if (! $self->isa('DBIx::Class::Storage::DBI::Sybase::FreeTDS') and $self->using_freetds) {
+ if (! $self->isa('DBIx::Class::Storage::DBI::Sybase::FreeTDS') and $self->_using_freetds) {
require DBIx::Class::Storage::DBI::Sybase::FreeTDS;
my @isa = @{mro::get_linear_isa(ref $self)};
}
}
-=head2 using_freetds
-
-Whether or not L<DBD::Sybase> was compiled against FreeTDS. If false, it means
-the Sybase OpenClient libraries were used.
-
-=cut
-
-sub using_freetds {
+# Whether or not DBD::Sybase was compiled against FreeTDS. If false, it means
+# the Sybase OpenClient libraries were used.
+sub _using_freetds {
my $self = shift;
-
return ($self->_get_dbh->{syb_oc_version}||'') =~ /freetds/i;
}
+# Either returns the FreeTDS version against which DBD::Sybase was compiled,
+# 0 if can't be determined, or undef otherwise
+sub _using_freetds_version {
+ my $inf = shift->_get_dbh->{syb_oc_version};
+ return undef unless ($inf||'') =~ /freetds/i;
+ return $inf =~ /v([0-9\.]+)/ ? $1 : 0;
+}
+
1;
=head1 AUTHORS