blib/lib/DBIO/Storage/DBI/IdentityInsert.pm

filter: Statementstmt 66.6% 14 / 21 Branchbran 0.0% 0 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 80.0% 4 / 5 Podpod n/a totaltotal 64.2% 18 / 28 CC 2 SCAR 9.8
CC
2
Cov
61%
_prep_for_execute
6.0
BEGIN
1.0
BEGIN
1.0
CRAP 2.7
« blib/lib/DBIO/Schema/ModelCompiler.pm ↑ Summary blib/lib/DBIO/Test/Schema/Artwork.pm »
1 package DBIO::Storage::DBI::IdentityInsert;
2 # ABSTRACT: Storage Component for Sybase ASE and MSSQL for Identity Inserts / Updates
3  
4 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 our $VERSION = '0.900007';
8  
9 3 ▶use base 'DBIO::Storage::DBI';
Subroutine BEGIN: called CC=1 SCAR=0.0
10 3 ▶use mro 'c3';
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12  
13  
14 # SET IDENTITY_X only works as part of a statement scope. We can not
15 # $dbh->do the $sql and the wrapping set()s individually. Hence the
16 # sql mangling. The newlines are important.
17 0 ▶sub _prep_for_execute {
Subroutine _prep_for_execute: not called CC=2 SCAR=17.9
18 0 my $self = shift;
19  
20 0 ▶ return $self->next::method(@_) unless $self->_autoinc_supplied_for_op;
Branch: 1 branch
BranchTrueFalseTotal
unless $self->_autoinc_supplied_for_op 0 0 0
21  
22 0 my ($op, $ident) = @_;
23  
24 0 my $table = $self->sql_maker->_quote($ident->name);
25 0 $op = uc $op;
26  
27 0 my ($sql, $bind) = $self->next::method(@_);
28  
29 0 return (<<EOS, $bind);
30 SET IDENTITY_$op $table ON
31 $sql
32 SET IDENTITY_$op $table OFF
33 EOS
34  
35 }
36  
37 3 1;
38  
39 __END__
« blib/lib/DBIO/Schema/ModelCompiler.pm ↑ Summary blib/lib/DBIO/Test/Schema/Artwork.pm »