1 package DBIx::Class::DB;
3 use base qw/Class::Data::Inheritable/;
6 __PACKAGE__->mk_classdata('_dbi_connect_info');
7 __PACKAGE__->mk_classdata('_dbi_connect_package');
8 __PACKAGE__->mk_classdata('_dbh');
13 unless (($dbh = $class->_dbh) && $dbh->FETCH('Active') && $dbh->ping) {
14 $class->_populate_dbh;
21 my @info = @{$class->_dbi_connect_info || []};
22 my $pkg = $class->_dbi_connect_package || $class;
23 $pkg->_dbh($class->_dbi_connect(@info));
27 my ($class, @info) = @_;
28 return DBI->connect_cached(@info);
32 my ($class, @info) = @_;
33 $class->_dbi_connect_package($class);
34 $class->_dbi_connect_info(\@info);