Loader/DBI/Pg.pm

filter: Statementstmt 38.4% 10 / 26 Branchbran n/a Conditioncond 0.0% 0 / 4 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 60.0% 3 / 5 Podpod 0.0% 0 / 2 totaltotal 33.3% 13 / 39 CC 4 SCAR 18.5
CC
4
Cov
33%
tables
12.0
table_columns
6.0
BEGIN
1.0
CRAP 6.4
« Loader.pm ↑ Summary Loader/DBI/SQLite.pm »
1 package DBIx::Skinny::Schema::Loader::DBI::Pg;
2 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 2 ▶use base qw/DBIx::Skinny::Schema::Loader::DBI/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 0 ▶sub tables {
Subroutine tables: not called CC=3 SCAR=24.8
Pod undocumented
8 0 my $self = shift;
9 0 ▶ my $schema = $self->{ schema } || 'public';
Condition0%0/2
$self->{'schema'} || 'public'
l!l
00
MC/DC0%0/1
$self->{'schema'} || 'public'
$self->{'schema'}
Truth table0%0/2
A
A= $self->{'schema'}
Aresult
11
00
10 0 my $sth = $self->{ dbh }->table_info('', $schema, undef, undef);
11 0 my @tables;
12 0 for my $rel (@{ $sth->fetchall_arrayref({}) }) {
13 0 push @tables, $rel->{TABLE_NAME};
14 }
15 0 return \@tables;
16 }
17  
18 0 ▶sub table_columns {
Subroutine table_columns: not called CC=2 SCAR=17.9
Pod undocumented
19 0 my ($self, $table) = @_;
20 0 ▶ my $schema = $self->{ schema } || 'public';
Condition0%0/2
$self->{'schema'} || 'public'
l!l
00
MC/DC0%0/1
$self->{'schema'} || 'public'
$self->{'schema'}
Truth table0%0/2
A
A= $self->{'schema'}
Aresult
11
00
21 0 my $sth = $self->{ dbh }->prepare("select * from $schema.$table where 1 = 0");
22 0 $sth->execute;
23 0 my $retval = \@{$sth->{NAME_lc}};
24 0 $sth->finish;
25 0 return $retval;
26 }
27  
28 2 1;
« Loader.pm ↑ Summary Loader/DBI/SQLite.pm »