Schedule-LongSteps

 view release on metacpan or  search on metacpan

lib/Schedule/LongSteps/Storage/AutoDBIx/Schema.pm  view on Meta::CPAN

use base qw/DBIx::Class::Schema/;

__PACKAGE__->load_classes({ 'Schedule::LongSteps::Storage::AutoDBIx::Schema::Result' => [ 'LongstepProcess' ] });

sub connection{
    my ($class, @args ) = @_;
    unless( ( ref $args[0] || '' ) eq 'CODE' ){
        defined( $args[3] ) or ( $args[3] = {} );
        $args[3]->{AutoCommit} = 1;
        $args[3]->{RaiseError} = 1;
        $args[3]->{mysql_enable_utf8} = 1;
        ## Only for mysql DSNs
        $args[3]->{on_connect_do} = ["SET SESSION sql_mode = 'TRADITIONAL'"];
    }
    my $self = $class->next::method(@args);
    return $self;
}
1;
__END__

=head1 NAME

t/fullblown.t  view on Meta::CPAN

    package MyApp::Schema;
    use base qw/DBIx::Class::Schema/;
    __PACKAGE__->load_classes({ 'MyApp::Schema::Result' => [ 'Process', 'Patient' ] });

    sub connection{
        my ($class, @args ) = @_;
        unless( ( ref $args[0] || '' ) eq 'CODE' ){
            defined( $args[3] ) or ( $args[3] = {} );
            $args[3]->{AutoCommit} = 1;
            $args[3]->{RaiseError} = 1;
            $args[3]->{mysql_enable_utf8} = 1;
            ## Only for mysql DSNs
            $args[3]->{on_connect_do} = ["SET SESSION sql_mode = 'TRADITIONAL'"];
        }
        my $self = $class->next::method(@args);
        return $self;
    }
    1;
}

#



( run in 0.251 second using v1.01-cache-2.11-cpan-00829025b61 )