blib/lib/DBIx/Connector/Driver/SQLite.pm

filter: Statementstmt 45.8% 11 / 24 Branchbran 0.0% 0 / 8 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 42.8% 3 / 7 Podpod 100% 3 / 3 totaltotal 33.3% 17 / 51 CC 7 SCAR 22.1
CC
7
Cov
29%
_connect
20.0
savepoint
6.0
release
6.0
CRAP 9.2
↑ Summary blib/lib/DBIx/Connector.pm »
1 package DBIx::Connector::Driver::SQLite;
2  
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use base 'DBIx::Connector::Driver';
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 our $VERSION = '0.55';
7  
8 sub _connect {
9 0 ▶ my ($self, $dbh, $dsn, $username, $password, $attrs) = @_;
Subroutine _connect: not called CC=4 SCAR=30.0
10  
11 0 my ($x, $y, $z) = split /[.]/ => $dbh->{sqlite_version};
12 0 ▶ $self->{_sqlite_is_new_enough} = ($x >= 3 && $y >= 6 && $z >= 8) ? 1 : 0;
Branch: 1 branch
BranchTrueFalseTotal
$x >= 3 && $y >= 6 && $z >= 8 ? : 0 0 0
Condition0%0/6
$x >= 3 and $y >= 6 and $z >= 8
!ll&&!rl&&r
000
$x >= 3 and $y >= 6
!ll&&!rl&&r
000
MC/DC0%0/3
$x >= 3 and $y >= 6 and $z >= 8
$x >= 3 $y >= 6 $z >= 8
Truth table0%0/4
A and B and C
A= $x >= 3B= $y >= 6C= $z >= 8
ABCresult
0XX0
10X0
1100
1111
13 0 return $dbh;
14 }
15  
16 sub savepoint {
17 0 ▶ my ($self, $dbh, $name) = @_;
Subroutine savepoint: not called CC=2 SCAR=17.9
Pod documented
18 0 ▶ return unless $self->{_sqlite_is_new_enough};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"_sqlite_is_new_enough"} 0 0 0
19 0 $dbh->do("SAVEPOINT $name");
20 }
21  
22 sub release {
23 0 ▶ my ($self, $dbh, $name) = @_;
Subroutine release: not called CC=2 SCAR=17.9
Pod documented
24 0 ▶ return unless $self->{_sqlite_is_new_enough};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"_sqlite_is_new_enough"} 0 0 0
25 0 $dbh->do("RELEASE SAVEPOINT $name");
26 }
27  
28 sub rollback_to {
29 0 ▶ my ($self, $dbh, $name) = @_;
Subroutine rollback_to: not called CC=2 SCAR=17.9
Pod documented
30 0 ▶ return unless $self->{_sqlite_is_new_enough};
Branch: 1 branch
BranchTrueFalseTotal
unless $self->{"_sqlite_is_new_enough"} 0 0 0
31 0 $dbh->do("ROLLBACK TO SAVEPOINT $name");
32 }
33  
34 2 1;
35 __END__
36  
37 =head1 Name
38  
39 DBIx::Connector::Driver::SQLite - SQLite-specific connection interface
40  
41 =head1 Description
42  
43 This subclass of L<DBIx::Connector::Driver|DBIx::Connector::Driver> provides
44 SQLite-specific implementations of the following methods:
45  
46 =over
47  
48 =item C<savepoint>
49  
50 =item C<release>
51  
52 =item C<rollback_to>
53  
54 =back
55  
56 Note that they only work with SQLite 3.6.8 or higher; older versions of SQLite
57 will fallback on the exception-throwing implementation of these methods in
58 L<DBIx::Connector::Driver|DBIx::Connector::Driver>.
59  
60 =head1 Authors
61  
62 This module was written and is maintained by:
63  
64 =over
65  
66 =item David E. Wheeler <david@kineticode.com>
67  
68 =back
69  
70 =head1 Copyright and License
71  
72 Copyright (c) 2009-2013 David E. Wheeler. Some Rights Reserved.
73  
74 This module is free software; you can redistribute it and/or modify it under
75 the same terms as Perl itself.
76  
77 =cut
↑ Summary blib/lib/DBIx/Connector.pm »