line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Class::DBI::MSAccess; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
27184
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
32
|
|
4
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
3
|
use base qw(Class::DBI); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
1342
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our $VERSION = '0.10.2'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub _auto_increment_value { |
11
|
0
|
|
|
0
|
|
|
my ($self) = @_; |
12
|
0
|
|
|
|
|
|
my $dbh = $self->db_Main; |
13
|
|
|
|
|
|
|
|
14
|
0
|
|
|
|
|
|
my ($id) = $dbh->selectrow_array('SELECT @@IDENTITY'); |
15
|
0
|
0
|
|
|
|
|
$self->_croak("Can't get last insert id") if !defined $id; |
16
|
0
|
|
|
|
|
|
return $id; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub _insert_row { |
20
|
0
|
|
|
0
|
|
|
my ( $self, $data ) = @_; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# delegate to Class::DBI for multiple column primary keys |
23
|
0
|
|
|
|
|
|
my @primary_columns = $self->primary_columns(); |
24
|
0
|
0
|
|
|
|
|
return $self->SUPER::_insert_row($data) if @primary_columns > 1; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
# delegate to Class::DBI for explicitly specified primary keys |
27
|
0
|
|
|
|
|
|
my $primary_column = $primary_columns[0]; |
28
|
0
|
0
|
|
|
|
|
return $self->SUPER::_insert_row($data) |
29
|
|
|
|
|
|
|
if defined $data->{$primary_column}; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# remove the name of the primary key column |
32
|
0
|
|
|
|
|
|
delete $data->{$primary_column}; |
33
|
0
|
|
|
|
|
|
return $self->SUPER::_insert_row($data); |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |