File Coverage

blib/lib/DBIx/Class/Row/SQLA2Support.pm
Criterion Covered Total %
statement 18 18 100.0
branch n/a
condition 1 2 50.0
subroutine 5 5 100.0
pod 2 2 100.0
total 26 27 96.3


line stmt bran cond sub pod time code
1             package DBIx::Class::Row::SQLA2Support;
2 5     5   584978 use strict;
  5         12  
  5         178  
3 5     5   22 use warnings;
  5         55  
  5         258  
4 5     5   45 use parent 'DBIx::Class::Row';
  5         36  
  5         62  
5              
6             sub new {
7 3     3 1 24657 my ($class, $attrs) = @_;
8 3   50     15 my $sqla2_passthru = delete $attrs->{-sqla2} || {};
9 3         20 my $new = $class->next::method($attrs);
10 3         424 $new->{_sqla2_attrs} = $sqla2_passthru;
11              
12 3         12 return $new;
13             }
14              
15             sub insert {
16 3     3 1 49 my ($self, @args) = @_;
17 3         9 my $extras = delete $self->{_sqla2_attrs};
18             # this should allow relations to fail if they don't have a on_conflict defined
19 3         11 local $self->result_source->storage->sql_maker->{_sqla2_insert_attrs} = $extras;
20 3         417 $self->next::method(@args);
21             }
22              
23             1