File Coverage

blib/lib/App/JESP/Driver/SQLite.pm
Criterion Covered Total %
statement 8 8 100.0
branch 1 2 50.0
condition n/a
subroutine 2 2 100.0
pod 1 1 100.0
total 12 13 92.3


line stmt bran cond sub pod time code
1             package App::JESP::Driver::SQLite;
2             $App::JESP::Driver::SQLite::VERSION = '0.015';
3 2     2   1867 use Moose;
  2         4  
  2         16  
4             extends qw/App::JESP::Driver/;
5              
6             =head1 NAME
7              
8             App::JESP::Driver::SQLite - SQLite driver. Subclasses App::JESP::Driver
9              
10             =cut
11              
12             =head2 apply_sql
13              
14             Specific version that allows multiple statements in SQLite.
15             See superclass.
16              
17             =cut
18              
19             sub apply_sql{
20 5     5 1 14 my ($self, $sql) = @_;
21             # note that we reuse the same dbh as the application.
22 5         165 my $dbh = $self->jesp()->dbix_simple()->dbh();
23 5         89 local $dbh->{sqlite_allow_multiple_statements} = 1;
24 5         105 my $ret = $dbh->do( $sql );
25 5 50       1103 return defined($ret) ? $ret : confess( $dbh->errstr() );
26             }
27              
28             __PACKAGE__->meta->make_immutable();
29             1;