File Coverage

blib/lib/Deeme/Backend/SQLite.pm
Criterion Covered Total %
statement 19 19 100.0
branch 1 2 50.0
condition n/a
subroutine 6 6 100.0
pod 1 1 100.0
total 27 28 96.4


line stmt bran cond sub pod time code
1             package Deeme::Backend::SQLite;
2              
3             our $VERSION = '0.03';
4 2     2   85643 use Deeme::Obj 'Deeme::Backend';
  2         7  
  2         16  
5 2     2   7721 use DBI;
  2         20160  
  2         142  
6             require DBD::SQLite;
7 2     2   1805 use Deeme::Utils qw(_serialize _deserialize);
  2         4127  
  2         230  
8 2     2   13 use Carp 'croak';
  2         6  
  2         84  
9 2     2   1875 use Deeme::Backend::DBI;
  2         5363  
  2         22  
10              
11             has [qw(database _connection username password options)];
12              
13             sub new {
14 1     1 1 3344 my $self = shift;
15 1         13 $self = $self->SUPER::new(@_);
16 1 50       38 croak "No database string defined, database option missing"
17             if ( !$self->database );
18 1         33 return Deeme::Backend::DBI->new(
19             database => [
20             "dbi:SQLite:dbname=" . $self->database,
21             $self->username, $self->password, $self->options
22             ]
23             );
24             }
25             1;
26              
27             __END__