return $self->_sql_maker;
}
+# nothing to do by default
sub _rebless {}
+sub _init {}
sub _populate_dbh {
my ($self) = @_;
$self->_driver_determined(1);
+ $self->_init; # run driver-specific initializations
+
$self->_run_connection_actions
if $started_unconnected && defined $self->_dbh;
}
$self->_identity_method('@@identity');
}
-sub _rebless {
- no warnings 'uninitialized';
+sub _init {
my $self = shift;
if (ref($self->_dbi_connect_info->[0]) ne 'CODE' &&
? 'DBIx::Class::Storage::DBI::Oracle::WhereJoins'
: 'DBIx::Class::Storage::DBI::Oracle::Generic';
- # Load and rebless
- eval "require $class";
-
- bless $self, $class unless $@;
+ $self->ensure_class_loaded ($class);
+ bless $self, $class;
}
}
$self->_rebless;
}
}
-
- $self->set_textsize; # based on LongReadLen in connect_info
-
}
elsif (not $self->_get_dbh->{syb_dynamic_supported}) {
# not necessarily FreeTDS, but no placeholders nevertheless
# this is highly unlikely, but we check just in case
$self->auto_cast(1);
}
-
- $self->_set_max_connect(256);
}
}
}
+sub _init {
+ my $self = shift;
+ $self->_set_max_connect(256);
+
+ # based on LongReadLen in connect_info
+ $self->set_textsize if $self->using_freetds;
+}
+
# Make sure we have CHAINED mode turned on if AutoCommit is off in non-FreeTDS
# DBD::Sybase (since we don't know how DBD::Sybase was compiled.) If however
# we're using FreeTDS, CHAINED mode turns on an implicit transaction which we
sub using_freetds {
my $self = shift;
- return $self->_dbh->{syb_oc_version} =~ /freetds/i;
+ return $self->_get_dbh->{syb_oc_version} =~ /freetds/i;
}
=head2 set_textsize
/;
use mro 'c3';
-sub new {
- my $self = shift->next::method(@_);
- $self->_rebless;
- return $self;
-}
-
sub _rebless {
my $self = shift;
my $dbh = $self->_get_dbh;
'DBIx::Class::Storage::DBI::Sybase::Microsoft_SQL_Server::NoBindVars';
$self->_rebless;
}
+}
+
+sub _init {
+ my $self = shift;
-# LongReadLen doesn't work with MSSQL through DBD::Sybase, and the default is
-# huge on some versions of SQL server and can cause memory problems, so we
-# fix it up here (see Sybase/Common.pm .)
+ # LongReadLen doesn't work with MSSQL through DBD::Sybase, and the default is
+ # huge on some versions of SQL server and can cause memory problems, so we
+ # fix it up here (see Sybase/Common.pm)
$self->set_textsize;
}
/;
use mro 'c3';
-sub new {
- my $self = shift->next::method(@_);
- $self->_rebless;
- return $self;
-}
-
-sub _rebless {
+sub _init {
my $self = shift;
-
$self->disable_sth_caching(1);
}
use List::Util ();
use Scalar::Util ();
-sub new {
- my $self = shift->next::method(@_);
- $self->_rebless;
- return $self;
-}
-
-sub _rebless {
+sub _init {
my $self = shift;
$self->disable_sth_caching(1);
$self->_identity_method('@@IDENTITY');
+ $self->next::method (@_);
}
sub _fetch_identity_sql { 'SELECT ' . $_[0]->_identity_method }