diff options
author | Daniel Friesel <derf@finalrewind.org> | 2019-04-22 13:42:41 +0200 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2019-04-22 13:42:41 +0200 |
commit | 812be4f0cbeb74db379a2c931ceb2c88bd9fabf7 (patch) | |
tree | bf2f0628941e3df5ebcbd37b85aa18b51667d6c8 /lib/Travelynx.pm | |
parent | c65232904fb0bd8e0294e3f76aeee27f32da85ee (diff) |
Finish transition from DBI to Mojo::Pg
Diffstat (limited to 'lib/Travelynx.pm')
-rwxr-xr-x | lib/Travelynx.pm | 18 |
1 files changed, 0 insertions, 18 deletions
diff --git a/lib/Travelynx.pm b/lib/Travelynx.pm index 576e715..fd59cc0 100755 --- a/lib/Travelynx.pm +++ b/lib/Travelynx.pm @@ -6,7 +6,6 @@ use Mojolicious::Plugin::Authentication; use Cache::File; use Crypt::Eksblowfish::Bcrypt qw(bcrypt en_base64); use DateTime; -use DBI; use Encode qw(decode encode); use Geo::Distance; use JSON; @@ -148,23 +147,6 @@ sub startup { } ); - $self->attr( - dbh => sub { - my ($self) = @_; - my $config = $self->app->config; - - my $dbname = $config->{db}->{database}; - my $host = $config->{db}->{host} // 'localhost'; - my $port = $config->{db}->{port} // 5432; - my $user = $config->{db}->{user}; - my $pw = $config->{db}->{password}; - - return DBI->connect( - "dbi:Pg:dbname=${dbname};host=${host};port=${port}", - $user, $pw, { AutoCommit => 1 } ); - } - ); - $self->helper( sendmail => sub { state $sendmail = Travelynx::Helper::Sendmail->new( |