line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
package DBIx::Romani::Driver::sqlite; |
3
|
1
|
|
|
1
|
|
6
|
use base qw(DBIx::Romani::Driver); |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
610
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
704
|
use DBIx::Romani::Driver::sqlite::IdGenerator; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
29
|
|
6
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
188
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
# TODO: this function will take a "Roma-style" DSN or hash, and make |
9
|
|
|
|
|
|
|
# a DBI connection returning a dbh. |
10
|
|
|
|
|
|
|
sub connect_dbi |
11
|
|
|
|
|
|
|
{ |
12
|
0
|
|
|
0
|
0
|
|
die "Unimplemented."; |
13
|
|
|
|
|
|
|
} |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub apply_limit |
16
|
|
|
|
|
|
|
{ |
17
|
0
|
|
|
0
|
0
|
|
my ($self, $sql, $offset, $limit) = @_; |
18
|
|
|
|
|
|
|
|
19
|
0
|
0
|
|
|
|
|
if ( $limit > 0 ) |
|
|
0
|
|
|
|
|
|
20
|
|
|
|
|
|
|
{ |
21
|
0
|
|
|
|
|
|
$sql .= " LIMIT " . $limit; |
22
|
0
|
0
|
|
|
|
|
if ( $offset > 0 ) |
23
|
|
|
|
|
|
|
{ |
24
|
0
|
|
|
|
|
|
$sql .= " OFFSET " . $offset; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
elsif ( $offset > 0 ) |
28
|
|
|
|
|
|
|
{ |
29
|
0
|
|
|
|
|
|
$sql .= " LIMIT -1 OFFSET " . $offset; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
0
|
|
|
|
|
|
return $sql; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub create_id_generator |
36
|
|
|
|
|
|
|
{ |
37
|
0
|
|
|
0
|
0
|
|
my ($self, $conn) = @_; |
38
|
0
|
|
|
|
|
|
return DBIx::Romani::Driver::sqlite::IdGenerator->new( $conn ); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
1; |
42
|
|
|
|
|
|
|
|