|
|
|
@ -25,9 +25,10 @@ sub startup {
|
|
|
|
|
return $cap; |
|
|
|
|
}); |
|
|
|
|
$self->app->attr(db => sub { |
|
|
|
|
my $config = $self->app->config->{db} || []; |
|
|
|
|
my $c = $self->app->config->{db} || {}; |
|
|
|
|
require DBIx::Simple; |
|
|
|
|
my $dbh = DBIx::Simple->new(@{ $config }); |
|
|
|
|
my %opts = (AutoCommit => 1, RaiseError => 1, sqlite_see_if_its_a_number => 1); |
|
|
|
|
my $dbh = DBIx::Simple->new($c->{dsn}, $c->{user}, $c->{pass}, \%opts); |
|
|
|
|
return $dbh; |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|