File Coverage

blib/lib/DBIx/Connector/Driver/SQLite.pm
Criterion Covered Total %
statement 9 22 40.9
branch 0 6 0.0
condition 0 3 0.0
subroutine 3 7 42.8
pod 3 3 100.0
total 15 41 36.5


line stmt bran cond sub pod time code
1 2     2   3154 use strict; use warnings;
  2     2   23  
  2         61  
  2         11  
  2         4  
  2         89  
2              
3             package DBIx::Connector::Driver::SQLite;
4              
5 2     2   13 use DBIx::Connector::Driver;
  2         3  
  2         688  
6              
7             our $VERSION = '0.57';
8             our @ISA = qw( DBIx::Connector::Driver );
9              
10             sub _connect {
11 0     0     my ($self, $dbh, $dsn, $username, $password, $attrs) = @_;
12              
13 0           my ( $maj, $min, $rel ) = split /[.]/, $dbh->{sqlite_version};
14 0   0       $self->{_sqlite_is_new_enough} = ( $maj <=> 3 || $min <=> 6 || $rel <=> 8 ) != -1;
15 0           return $dbh;
16             }
17              
18             sub savepoint {
19 0     0 1   my ($self, $dbh, $name) = @_;
20 0 0         return unless $self->{_sqlite_is_new_enough};
21 0           $dbh->do("SAVEPOINT $name");
22             }
23              
24             sub release {
25 0     0 1   my ($self, $dbh, $name) = @_;
26 0 0         return unless $self->{_sqlite_is_new_enough};
27 0           $dbh->do("RELEASE SAVEPOINT $name");
28             }
29              
30             sub rollback_to {
31 0     0 1   my ($self, $dbh, $name) = @_;
32 0 0         return unless $self->{_sqlite_is_new_enough};
33 0           $dbh->do("ROLLBACK TO SAVEPOINT $name");
34             }
35              
36             1;
37              
38             __END__