added missing pg_or_sqlite sub

This commit is contained in:
Finn 2017-12-18 15:08:15 +00:00
parent 713fee37d6
commit b7493af6c6

View file

@ -244,4 +244,19 @@ sub post_leaderboards_paged {
});
}
sub pg_or_sqlite {
my ( $c, $pg_sql, $sqlite_sql ) = @_;
my $driver = $c->schema->storage->dbh->{Driver}->{Name};
if ( $driver eq 'Pg' ) {
return \$pg_sql;
} elsif ( $driver eq 'SQLite' ) {
return \$sqlite_sql;
} else {
$c->app->log->warn('Unknown Driver Used');
return undef;
}
}
1;