File Coverage

blib/lib/Schedule/LongSteps/Storage/AutoDBIx/Schema.pm
Criterion Covered Total %
statement 9 9 100.0
branch n/a
condition n/a
subroutine 3 3 100.0
pod n/a
total 12 12 100.0


line stmt bran cond sub pod time code
1             package Schedule::LongSteps::Storage::AutoDBIx::Schema;
2             $Schedule::LongSteps::Storage::AutoDBIx::Schema::VERSION = '0.023';
3 1     1   6 use strict;
  1         3  
  1         29  
4 1     1   5 use warnings;
  1         2  
  1         35  
5 1     1   4 use base qw/DBIx::Class::Schema/;
  1         2  
  1         434  
6              
7             __PACKAGE__->load_classes({ 'Schedule::LongSteps::Storage::AutoDBIx::Schema::Result' => [ 'LongstepProcess' ] });
8              
9             sub connection{
10             my ($class, @args ) = @_;
11             unless( ( ref $args[0] || '' ) eq 'CODE' ){
12             defined( $args[3] ) or ( $args[3] = {} );
13             $args[3]->{AutoCommit} = 1;
14             $args[3]->{RaiseError} = 1;
15             $args[3]->{mysql_enable_utf8} = 1;
16             ## Only for mysql DSNs
17             $args[3]->{on_connect_do} = ["SET SESSION sql_mode = 'TRADITIONAL'"];
18             }
19             my $self = $class->next::method(@args);
20             return $self;
21             }
22             1;
23             __END__
24              
25             =head1 NAME
26              
27             Schedule::LongSteps::Storage::AutoDBIx::Schema - A built-in DBIx::Class Schema for the AutoDBIx storage
28              
29             =head2 connection
30              
31             See superclass L<DBIx::Class::Schema>
32              
33             =cut