Branch Coverage

blib/lib/Teng.pm
Criterion Covered Total %
branch 123 172 71.5


line true false branch
35 1 64 $pkg =~ s/^\+// ? :
38 0 65 if ref $class
48 2 63 if $pkg->can('init')
53 76 14 @_ == 1 ? :
56 2 88 if (my $mode = delete $args{'mode'})
58 2 0 unless (exists $args{'no_ping'})
59 1 1 $mode eq 'ping' ? :
72 85 1 unless ($loader or $self->schema)
76 0 85 unless ($schema)
83 0 70 unless ($self->connect_info or $self->{'dbh'})
87 20 70 if (not $self->{'dbh'}) { }
98 1 0 if (@_)
109 0 0 if (@_)
111 0 0 if ($mode eq 'ping') { }
119 0 0 $self->no_ping ? :
128 0 26 if (@args)
137 18 8 unless $connect_info->[3]
140 1 25 unless $self->{'dbh'} = eval { do { 'DBI'->connect(@$connect_info) } }
153 17 57 if (my $on_connect_do = $self->on_connect_do)
154 4 13 if (not ref $on_connect_do) { }
8 5 elsif (ref $on_connect_do eq 'CODE') { }
4 1 elsif (ref $on_connect_do eq 'ARRAY') { }
175 0 50 if (@_) { }
188 1 49 unless my $new_dbh = eval { do { $dbh->clone } }
203 52 0 if (my $dbh = $self->{'dbh'})
204 3 49 if ($self->owner_pid and $self->owner_pid != $$) { }
219 88 55 unless ($builder)
223 85 3 unless $self->{'sql_builder_args'}
229 139 4 if $self->{'schema'}
235 1 713 if (not $self->owner_pid or $self->owner_pid != $$) { }
713 0 elsif (my $dbh = $self->{'dbh'}) { }
239 0 713 if (not $dbh->FETCH('Active')) { }
12 701 elsif (not $self->no_ping || $dbh->ping) { }
271 1 407 if ($ENV{'TENG_SQL_COMMENT'} or $self->sql_comment)
274 0 1 if $caller[0]->isa('Teng')
275 0 1 if $caller[0] =~ /^Teng::/
287 13 389 unless $binds
288 326 262 if (&Scalar::Util::blessed($v) and ref $v eq 'SQL::Maker::SQLType') { }
293 0 262 ref $v eq 'ARRAY' ? :
299 12 396 if ($@)
304 2 394 unless (defined wantarray)
316 0 27 if ($driver eq 'mysql') { }
0 27 elsif ($driver eq 'Pg') { }
27 0 elsif ($driver eq 'SQLite') { }
0 0 elsif ($driver eq 'Oracle') { }
319 0 0 if (defined $column) { }
340 5 331 ref $args->{$col} ? :
351 1 165 unless ($table)
371 1 6 if defined $sth->{'mysql_insertid'}
381 96 53 unless defined wantarray
387 22 31 if (@missing_primary_keys == 1)
391 1 21 defined $sth->{'mysql_insertid'} ? :
394 2 51 if $self->suppress_row_objects
399 0 60 if (ref $args->{$key})
406 51 0 if (%where and $refetch)
423 0 2 unless $args
0 2 unless scalar @{[] unless $args;}
428 0 2 $dbh->{'Driver'}{'Name'} eq 'Pg' && $dbh->{'pg_server_version'} >= 82000 ? :
0 2 $dbh->{'Driver'}{'Name'} eq 'mysql' ? :
431 0 2 if ($can_multi_insert) { }
433 0 0 unless ($table)
437 0 0 if ($table->has_deflators)
473 1 7 unless ($table)
501 0 36 $self->{'txn_manager_class'} ? :
508 55 31 unless $self->{'txn_manager'}
510 10 21 if (my $info = $self->{'txn_manager'}->in_transaction)
539 1 20 if ($@)
540 0 1 @bind_vars ? :
551 4 167 $opt->{'+columns'} ? :
558 1 34 unless ($table)
577 1 6 unless exists $args->{$1}
578 1 5 if (ref $args->{$1} and ref $args->{$1} eq 'ARRAY') { }
603 0 131 unless $table
615 0 131 unless (defined wantarray)
622 16 115 unless $row
623 0 115 if $self->{'suppress_row_objects'}
644 0 55 unless (defined wantarray)
660 10 45 wantarray ? :
668 0 2 unless $table
674 0 2 unless (defined wantarray)
681 0 2 unless $row
682 0 2 if $self->{'suppress_row_objects'}
699 0 4 unless $table
701 0 4 if $self->{'suppress_row_objects'}
730 26 1 if ($sql =~ /\sfrom\s+["`]?([\w]+)["`]?\s*/is)
755 1 85 if ($self->owner_pid and $self->owner_pid != $$ and my $dbh = $self->{'dbh'})