summaryrefslogtreecommitdiff
path: root/lib/Travelynx.pm
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2019-04-22 13:42:41 +0200
committerDaniel Friesel <derf@finalrewind.org>2019-04-22 13:42:41 +0200
commit812be4f0cbeb74db379a2c931ceb2c88bd9fabf7 (patch)
treebf2f0628941e3df5ebcbd37b85aa18b51667d6c8 /lib/Travelynx.pm
parentc65232904fb0bd8e0294e3f76aeee27f32da85ee (diff)
Finish transition from DBI to Mojo::Pg
Diffstat (limited to 'lib/Travelynx.pm')
-rwxr-xr-xlib/Travelynx.pm18
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(