Branch Coverage

blib/lib/DBR/Config/Instance.pm
Criterion Covered Total %
branch 32 52 61.5


line true false branch
34 51 17 if ($conn)
52 0 133 unless $$self{'session'}
54 83 50 if ($params{'guid'}) { }
60 0 50 unless $$self{'guid'} = $INSTANCE_MAP{$handle}{$class} || $INSTANCE_MAP{$handle}{'*'}
65 0 133 unless $INSTANCES_BY_GUID{$$self{'guid'}}
84 0 17 unless my $instrows = $dbh->select(-'table', 'dbr_instances', -'fields', 'instance_id schema_id class dbname username password host dbfile module handle readonly')
93 0 17 unless my $instance = $self->register('session', $$self{'session'}, 'spec', $instrow) || $self->_error("failed to load instance from database (@{[$parent->handle];} @{[$parent->class];})")
114 0 34 unless $$self{'session'}
117 0 34 unless my $spec = $params{'spec'}
134 0 34 unless $$config{'module'}
135 0 34 unless $$config{'handle'}
140 0 34 unless eval "require $connclass"
144 0 34 unless my $reqfields = $connclass->required_config_fields
147 0 34 unless $$config{$name}
150 17 17 $$spec{'dbr_bootstrap'} ? :
166 0 34 if ($$spec{'alias'})
170 17 17 if ($$config{'schema_id'})
171 0 17 unless 'DBR::Config::Schema'->_register_instance('schema_id', $$config{'schema_id'}, 'class', $$config{'class'}, 'guid', $guid)
193 75 2353 if (lc $flag eq 'dbh') { }
1717 636 elsif (lc $flag eq 'conn') { }
198 0 0 unless return 'DBR::Handle'->new('conn', $self->getconn, 'session', $$self{'session'}, 'instance', $self)
212 2964 51 if $conn and $conn->ping
214 0 51 if ($conn)
223 0 51 unless $conn = $self->_new_connection
236 0 51 unless my $dbh = 'DBI'->connect(@params)
241 0 51 unless my $conn = $connclass->new('session', $$self{'session'}, 'dbh', $dbh)