blib/lib/DBIx/DBO/DBD/SQLite.pm

filter: Statementstmt 100% 24 / 24 Branchbran 50.0% 3 / 6 Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 100% 7 / 7 Podpod n/a totaltotal 78.2% 36 / 46 SCAR 18.3
CC
6
Cov
81%
_get_table_schema
5.9
BEGIN
2.1
BEGIN
1.0
CRAP 6.3
« Build ↑ Summary _build/lib/MyModuleBuilder.pm »
1 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use DBD::SQLite 1.31;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶BEGIN { die 'DBD::SQLite version 1.31 required (but not version 1.38_01)' if $DBD::SQLite::VERSION eq '1.38_01' }
Subroutine BEGIN: called CC=2 SCAR=7.6
Branch: 1 branch
BranchTrueFalseTotal
if $DBD::SQLite::VERSION eq "1.38_01" 0 1 1
6  
7 package # hide from PAUSE
8 DBIx::DBO::DBD::SQLite;
9 1 ▶use Carp 'croak';
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 sub _get_table_schema {
12 9 ▶ my($class, $me, $schema, $table) = @_;
Subroutine _get_table_schema: called CC=5 SCAR=17.8
13  
14 9 my $q_schema = $schema;
15 9 my $q_table = $table;
16 9 ▶ $q_schema =~ s/([\\_%])/\\$1/g if defined $q_schema;
Branch: 1 branch
BranchTrueFalseTotal
if defined $q_schema 0 9 9
17 9 $q_table =~ s/([\\_%])/\\$1/g;
18  
19 # Try just these types
20 9 my $info = $me->rdbh->table_info(undef, $q_schema, $q_table,
21 'TABLE,VIEW,GLOBAL TEMPORARY,LOCAL TEMPORARY,SYSTEM TABLE', {Escape => '\\'})->fetchall_arrayref;
22 9 ▶ croak 'Invalid table: '.$class->_qi($me, $schema, $table) unless $info and @$info == 1 and $info->[0][2] eq $table;
Branch: 1 branch
BranchTrueFalseTotal
unless $info and @$info == 1 and $info->[0][2] eq $table 0 9 9
Condition33%2/6
$info and @$info == 1 and $info->[0][2] eq $table
!ll&&!rl&&r
009
$info and @$info == 1
!ll&&!rl&&r
009
MC/DC0%0/3
$info and @$info == 1 and $info->[0][2] eq $table
$info @$info == 1 $info->[0][2] eq $table
Truth table25%1/4
A and B and C
A= $infoB= @$info == 1C= $info->[0][2] eq $table
ABCresult
0XX0
10X0
1100
1111
23 9 return $info->[0][1];
24 }
25  
26 sub _save_last_insert_id {
27 7 ▶ my($class, $me, $sth) = @_;
Subroutine _save_last_insert_id: called CC=1 SCAR=0.0
28 7 $sth->{Database}->last_insert_id(undef, @$me{qw(Schema Name)}, undef);
29 }
30  
31 1 1;
« Build ↑ Summary _build/lib/MyModuleBuilder.pm »