Skip to content
Browse files

Merge pull request #1 from walf443/support_dbi_wrapper

support DBI's wrapper class for example Amon2::DBI, DBIx::Sunny.
  • Loading branch information...
2 parents ceed350 + 7c0f24b commit 826616eff15cab554d98dc49267ab951cf3312c1 @nekokak committed Feb 14, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 lib/DBIx/Handler.pm
View
3 lib/DBIx/Handler.pm
@@ -20,13 +20,14 @@ sub new {
result_class => $opts->{result_class} || undef,
on_connect_do => $opts->{on_connect_do} || undef,
on_disconnect_do => $opts->{on_disconnect_do} || undef,
+ dbi_class => $opts->{dbi_class} || "DBI",
}, $class;
}
sub _connect {
my $self = shift;
- my $dbh = $self->{_dbh} = DBI->connect(@{$self->{_connect_info}});
+ my $dbh = $self->{_dbh} = $self->{dbi_class}->connect(@{$self->{_connect_info}});
if (DBI->VERSION > 1.613 && (@{$self->{_connect_info}} < 4 || !exists $self->{_connect_info}[3]{AutoInactiveDestroy})) {
$dbh->STORE(AutoInactiveDestroy => 1);

0 comments on commit 826616e

Please sign in to comment.
Something went wrong with that request. Please try again.