ParseException/SQLite.pm

filter: Statementstmt 36.3% 8 / 22 Branchbran 0.0% 0 / 8 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 3 / 5 Podpod 0.0% 0 / 2 totaltotal 29.7% 11 / 37 CC 5 SCAR 28.5
CC
5
Cov
27%
error_handler
30.0
capabilities
2.0
BEGIN
1.0
CRAP 17.2
« ParseException/Pg.pm ↑ Summary ParseException.pm »
1 package DBIx::ParseException::SQLite;
2 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 $DBIx::ParseException::SQLite::VERSION = '0.001000_03';
4 }
5  
6 1 ▶use DBIx::Exceptions;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 0 ▶sub capabilities { $_[0] }
Subroutine capabilities: not called CC=1 SCAR=6.9
Pod undocumented
9  
10 0 ▶sub error_handler {
Subroutine error_handler: not called CC=5 SCAR=34.0
Pod undocumented
11 0 my $string = shift;
12 0 my @args = ( original => $string );
13 0 my $class = 'DBIx::Exception';
14  
15 0 ▶ if (my ($column) = $string =~ /^DBD::SQLite::st \s+ execute \s+ failed: \s+ (?:constraint \s+ failed \s+)?
Branch: 4 branches
BranchTrueFalseTotal
if (my($column) = $string =~ /^DBD::SQLite::st \s+ execute \s+ failed: \s+ (?:constraint \s+ failed \s+)? column \s+ (.*) \s+ is \s+ not \s+ unique/mix) { } 0 0 0
elsif ($string =~ /^DBD::SQLite::db \s+ prepare \s+ failed: \s+ near \s+ "(.*)": \s+ syntax \s+ error/mix) { } 0 0 0
elsif ($string =~ /^DBD::SQLite::db \s+ prepare \s+ failed: \s+ no \s+ such \s+ table: \s+ (.*)/mix) { } 0 0 0
elsif ($string =~ /^DBD::SQLite::db \s+ prepare \s+ failed: \s+ table \s+ (.*) \s+ has \s+ no \s+ column \s+ named \s+ (.*)/mix) { } 0 0 0
16 column \s+ (.*) \s+ is \s+ not \s+ unique/ixm) {
17 0 $class .= '::NotUnique';
18 0 push @args, ( column => $column );
19 } elsif ($string =~ /^DBD::SQLite::db \s+ prepare \s+ failed: \s+ near \s+
20 "(.*)": \s+ syntax \s+ error/ixm) {
21 0 $class .= '::Syntax';
22 0 push @args, ( near => $1 );
23 } elsif ($string =~ /^DBD::SQLite::db \s+ prepare \s+ failed: \s+ no \s+
24 such \s+ table: \s+ (.*)/ixm) {
25 0 $class .= '::NoSuchTable';
26 0 push @args, ( table => $1 );
27 } elsif ($string =~ /^DBD::SQLite::db \s+ prepare \s+ failed: \s+ table \s+
28 (.*) \s+ has \s+ no \s+ column \s+ named \s+ (.*)/ixm) {
29 0 $class .= '::NoSuchColumn';
30 0 push @args, ( table => $1, column => $2 );
31 }
32  
33 0 $class->throw(@args);
34 }
35  
36 1 ▶use constant {
Subroutine BEGIN: called CC=1 SCAR=0.0
37 1 can_unique_constraint => 1,
38 can_unique_constraint_column => 1,
39  
40 can_syntax => 1,
41 can_syntax_near => 1,
42  
43 can_no_such_table => 1,
44 can_no_such_table_table => 1,
45  
46 can_no_such_column => 1,
47 can_no_such_column_table => 1,
48 can_no_such_column_column => 1,
49 1 };
50  
51 1 1;
52 # vim: ts=2 tw=2 expandtab
53  
54 __END__
« ParseException/Pg.pm ↑ Summary ParseException.pm »