Romani/Driver/mysql/IdGenerator.pm untested

filter: Statementstmt 0.0% 0 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 25 CC 1 SCAR 6.9
CC
1
Cov
0%
is_before_insert
2.0
is_after_insert
2.0
get_id_method
2.0
CRAP 2.0
1  
2 package DBIx::Romani::Driver::mysql::IdGenerator;
3 use base qw(DBIx::Romani::IdGenerator);
4  
5 use strict;
6  
7 sub is_before_insert
8 {
9 return 0;
10 }
11  
12 sub is_after_insert
13 {
14 return 1;
15 }
16  
17 sub get_id_method
18 {
19 return "auto_increment";
20 }
21  
22 sub get_id
23 {
24 my $self = shift;
25  
26 my $rs;
27 $rs = $self->get_conn()->execute_query('SELECT LAST_INSERT_ID() as last_insert_id');
28 $rs->next();
29  
30 my $row = $rs->get_row();
31 return $row->{last_insert_id};
32 }
33  
34 1;
35