Loader/DBI/SQLite.pm

filter: Statementstmt 100% 21 / 21 Branchbran 100% 6 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 4 / 4 Podpod 0.0% 0 / 1 totaltotal 96.8% 31 / 32 CC 4 SCAR 10.0
CC
4
Cov
100%
tables
4.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
« Loader/DBI/Pg.pm ↑ Summary Loader/DBI.pm »
1 package DBIx::Skinny::Schema::Loader::DBI::SQLite;
2 12 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 12 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 12 ▶use base qw/DBIx::Skinny::Schema::Loader::DBI/;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 12 ▶sub tables {
Subroutine tables: called CC=4 SCAR=13.9
Pod undocumented
8 12 my $self = shift;
9 12 my $sth = $self->{ dbh }->prepare("SELECT * FROM sqlite_master");
10 12 $sth->execute;
11 12 my @tables;
12 12 ▶ while ( my $row = $sth->fetchrow_hashref ) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $row = $sth->fetchrow_hashref) 108 12 120
13 108 ▶ next unless lc( $row->{type} ) eq 'table';
Branch: 1 branch
BranchTrueFalseTotal
unless lc $row->{"type"} eq "table" 24 84 108
14 84 ▶ next if $row->{tbl_name} =~ /^sqlite_/;
Branch: 1 branch
BranchTrueFalseTotal
if $row->{"tbl_name"} =~ /^sqlite_/ 12 72 84
15 72 push @tables, $row->{tbl_name};
16 }
17 12 $sth->finish;
18 12 my @sorted = sort @tables;
19 12 return \@sorted;
20 }
21  
22 12 1;
« Loader/DBI/Pg.pm ↑ Summary Loader/DBI.pm »