Branch Coverage

blib/lib/YATT/Lite/WebMVC0/DBSchema.pm
Criterion Covered Total %
branch 142 256 55.4


line true false branch
69 1 10 if (my $sub = $self->{'cf_on_destroy'})
77 5 6 if (my $dbh = delete $schema->{'cf_DBH'}) { }
79 1 4 unless $dbh->{'AutoCommit'}
82 0 5 if $schema->{'cf_debug'}
85 0 6 if $schema->{'cf_debug'}
96 14 0 if @_
103 0 1 unless ref $orig
108 4 2 ref $v ? :
112 1 0 if @_
113 0 1 if $new->{'cf_debug'}
119 1 1 if (my $dbh = delete $self->{'cf_DBH'})
120 1 0 if $self->{'cf_is_clone'}
136 20 0 if (ref $item) { }
149 14 6 if ref $list->[0]
150 0 6 if ($list->[0] =~ /^-(\w+)/) { }
153 0 6 unless @$list >= 2
164 5 0 if $self->{'cf_auto_create'}
169 5 0 if $self->{'cf_group_writable'} // 1
178 0 0 unless my $sub = $app->can('backend_startup')
183 0 0 if ($schema->{'cf_connect_atstart'})
209 0 0 if ($when =~ /^at_?start$/i) { }
0 0 elsif ($when =~ /^on_?demand$/i) { }
223 3 2 @_ ? :
224 0 5 unless (defined $spec)
227 5 0 if (ref $spec eq 'ARRAY' or not ref $spec) { }
0 0 elsif (ref $spec eq 'CODE') { }
236 0 0 $schema->{'cf_debug'} >= 2 ? :
0 5 if $schema->{'cf_debug'}
243 0 5 if ($dbtype =~ /^dbi:/i) { }
5 0 elsif (my $sub = $schema->can("connect_to_\L$dbtype\E")) { }
255 0 0 unless my($driver) = $dbi =~ /^dbi:([^:]+):/i
257 0 0 if (my $sub = $schema->can("connect_to_\L$driver\E")) { }
272 0 5 if ($dsn_or_sqlite_fn =~ /^dbi:SQLite:(?:dbname=)?(.*)$/i) { }
278 5 0 unless (delete $opts{'RO'})
279 5 0 if 'version'->parse($DBD::SQLite::VERSION) >= $minver
286 5 0 if $first_time
314 1 3 unless $schema->{'cf_auto_create'}
326 0 21 if $schema->has_table($table->{'cf_name'}, $dbh)
329 0 0 do { $schema->{'cf_verbose'} >= 2 } ? :
0 29 $schema->{'cf_verbose'} ? :
339 0 2 if $schema->has_view($view->{'cf_name'}, $dbh)
340 0 2 if $view->{'cf_virtual'}
341 0 2 if ($schema->{'cf_verbose'})
347 10 0 if (@created)
352 10 0 if (@sql)
353 1 9 unless $dbh->{'AutoCommit'}
365 0 8 if (grep {ref $_ eq 'SCALAR';} @$record) { }
370 0 0 if $schema->{'cf_verbose'}
375 0 8 if $schema->{'cf_verbose'}
386 5 0 if ($dbh->{'AutoCommit'})
393 0 16 ref $_ ? :
401 10 13 if ($schema->{'dbtype'} and my $sub = $schema->can("$schema->{'dbtype'}_has_type")) { }
412 5 5 unless $schema->{'dbtype'}
413 0 5 unless my $sub = $schema->can("$schema->{'dbtype'}_$method")
420 10 0 unless my($found) = $dbh->selectrow_array("select name from sqlite_master where type = ? and name = ?\n", undef, $type, $name)
460 23 25 $opts->{'raw'} ? :
483 0 17 unless my YATT::Lite::WebMVC0::DBSchema::Table $tab = $self->{'table_dict'}{$tabName}
485 0 17 if ($opts{'raw'}) { }
491 3 0 if (my YATT::Lite::WebMVC0::DBSchema::Column $pk = $self->get_table_pk($subTab) || $self->get_table_pk($tab))
503 0 7 unless my YATT::Lite::WebMVC0::DBSchema::Table $tab = $self->{'table_dict'}{$tabName}
520 23 0 ref $tabName ? :
522 0 23 unless $pkinfo
523 10 13 if (wantarray) { }
524 1 9 ref $pkinfo eq 'ARRAY' ? :
526 2 11 ref $pkinfo eq 'ARRAY' ? :
534 0 33 if @_ == 1
535 0 33 if ($tab and not $tab->{'not_configured'})
546 3 32 if $opts
550 20 114 if (ref $colpairs[0]) { }
552 54 60 ref $desc ? :
557 13 7 if (my($relType, @relSpec) = $self->known_rels($method, undef, @args)) { }
560 0 7 unless my $sub = $self->can("add_table_\L$method\E")
572 0 3 if ($tab->{'pk'} and @args)
594 0 33 unless (defined $item)
601 0 33 if not ref $item and $item =~ s/\.(\w+)$//
603 13 20 ref $item ? :
608 0 33 if ($tab->{'relation_dict'}{$relName})
618 0 114 if ($tab->{'col_dict'}{$colName})
622 0 114 if (ref $type) { }
0 114 elsif (not defined $type) { }
630 69 0 do { $key =~ /^-/ } ? :
20 69 do { ref $key } ? :
89 0 defined(my $key = shift @colSpec) ? :
637 20 0 if (my($relType, @relSpec) = $self->known_rels($method, $colName, @args)) { }
652 28 86 if $col->{'cf_primary_key'}
669 0 33 if ($tab->{'not_configured'})
675 0 14 if (@not_configured)
690 7 33 unless $known_rels{$relType}
712 23 64 if $col->{'cf_primary_key'}
714 9 78 if $col->{'cf_indexed'}
719 3 0 if (not $pk_ok and $tab->{'pk'})
752 1 25 if (my $trigger = $tab->{'cf_trigger_after_delete'})
759 26 0 wantarray ? :
775 0 64 $col->{'cf_primary_key'} ? :
5 59 $col->{'cf_unique'} ? :
0 64 $col->{'cf_autoincrement'} ? :
780 23 64 do { $col->{'cf_primary_key'} if $col->{'cf_type'} =~ /^int/i } ? :
87 0 defined $col->{'cf_type'} ? :
782 35 52 if $col->{'cf_type'} =~ /^int/i
791 0 1 unless my $sub = $schema->can($schema->{'dbtype'} . '_sql_compound_trigger')
798 0 0 do { @$item == 1 } ? :
0 0 ref $item ? :
809 0 1 ref $item ? :
824 0 3 ref $method ? :
829 7 0 $wantarray ? :
832 3 0 wantarray ? :
847 1 1 unless &$to_find($value)
855 0 2 if $self->{'cf_verbose'}
861 1 2 unless my($rowid) = $sth->fetchrow_array
870 0 2 if $self->{'cf_verbose'}
883 0 3 if $self->{'cf_verbose'}
896 0 2 unless my YATT::Lite::WebMVC0::DBSchema::Table $tab = $self->{'table_dict'}{$tabName}
909 0 4 unless my YATT::Lite::WebMVC0::DBSchema::Table $tab = $self->{'table_dict'}{$tabName}
912 4 0 $resColList ? :
914 0 0 do { ref $keyColList eq 'SCALAR' } ? :
0 0 do { ref $keyColList eq 'ARRAY' } ? :
4 0 do { not ref $keyColList } ? :
4 0 defined $keyColList ? :
927 0 4 if ($group_by)
930 2 2 if ($order_by)
933 4 0 defined $where ? :
948 0 0 if (ref $_) { }
965 2 0 if (my YATT::Lite::WebMVC0::DBSchema::Column $pk = $tab->{'pk'}) { }
1017 0 0 if (my $sub = $pack->can('cf_list')) { }
1043 0 0 $as_utc ? :
1049 0 3 unless defined $_[0]
1051 0 0 ref $_[0] eq 'ARRAY' ? :
3 0 ref $_[0] eq 'HASH' ? :