Detect when postgres is used instead of postgresql.
This commit is contained in:
@@ -4,10 +4,15 @@ import { subMinutes } from 'date-fns';
|
||||
import { MYSQL, POSTGRESQL, MYSQL_DATE_FORMATS, POSTGRESQL_DATE_FORMATS } from 'lib/constants';
|
||||
|
||||
export function getDatabase() {
|
||||
return (
|
||||
const type =
|
||||
process.env.DATABASE_TYPE ||
|
||||
(process.env.DATABASE_URL && process.env.DATABASE_URL.split(':')[0])
|
||||
);
|
||||
(process.env.DATABASE_URL && process.env.DATABASE_URL.split(':')[0]);
|
||||
|
||||
if (type === 'postgres') {
|
||||
return 'postgresql';
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
export function getDateQuery(db, field, unit, timezone) {
|
||||
|
||||
Reference in New Issue
Block a user