Romani/Driver/mysql.pm untested

filter: Statementstmt 0.0% 0 / 19 Branchbran 0.0% 0 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 34 CC 4 SCAR 23.0
CC
4
Cov
0%
apply_limit
20.0
connect_dbi
2.0
create_id_generator
2.0
CRAP 10.0
1  
2 package DBIx::Romani::Driver::mysql;
3 use base qw(DBIx::Romani::Driver);
4  
5 use DBIx::Romani::Driver::mysql::IdGenerator;
6 use strict;
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 die "Unimplemented.";
13 }
14  
15 sub apply_limit
16 {
17 my ($self, $sql, $offset, $limit) = @_;
18  
19 if ( $limit > 0 )
20 {
21 $sql .= " LIMIT " . $limit;
22 if ( $offset > 0 )
23 {
24 $sql .= " OFFSET " . $offset;
25 }
26 }
27 elsif ( $offset > 0 )
28 {
29 $sql .= " LIMIT " . $offset . ", 18446744073709551615";
30 }
31  
32 return $sql;
33 }
34  
35 sub create_id_generator
36 {
37 my ($self, $conn) = @_;
38 return DBIx::Romani::Driver::mysql::IdGenerator->new( $conn );
39 }
40  
41 1;
42