blib/lib/auto/share/dist/Amon2/flavor/Basic/lib/__PATH__.pm untested

filter: Statementstmt 0.0% 0 / 31 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 8 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 45 CC 2 SCAR 10.6
CC
2
Cov
0%
db
6.0
BEGIN
2.0
BEGIN
2.0
CRAP 2.9
1 package <% $module %>;
2 use strict;
3 use warnings;
4 use utf8;
5 our $VERSION='0.01';
6 use 5.008001;
7 use <% $module %>::DB::Schema;
8 use <% $module %>::DB;
9  
10 use parent qw/Amon2/;
11 # Enable project local mode.
12 __PACKAGE__->make_local_context();
13  
14 my $schema = <% $module %>::DB::Schema->instance;
15  
16 sub db {
17 my $c = shift;
18 if (!exists $c->{db}) {
19 my $conf = $c->config->{DBI}
20 or die "Missing configuration about DBI";
21 $c->{db} = <% $module %>::DB->new(
22 schema => $schema,
23 connect_info => [@$conf],
24 # I suggest to enable following lines if you are using mysql.
25 # on_connect_do => [
26 # 'SET SESSION sql_mode=STRICT_TRANS_TABLES;',
27 # ],
28 );
29 }
30 $c->{db};
31 }
32  
33 1;
34 __END__