mirror of
https://github.com/umami-software/umami.git
synced 2026-02-21 13:05:36 +01:00
feat: support mongodb connection
This commit is contained in:
parent
586529a5ca
commit
bb30b43a8e
9 changed files with 370 additions and 30 deletions
|
|
@ -9,6 +9,8 @@ function getDatabaseType(url = process.env.DATABASE_URL) {
|
|||
|
||||
if (type === 'postgres') {
|
||||
return 'postgresql';
|
||||
} else if (type === 'mongodb+srv') {
|
||||
return 'mongodb';
|
||||
}
|
||||
|
||||
return type;
|
||||
|
|
@ -16,7 +18,7 @@ function getDatabaseType(url = process.env.DATABASE_URL) {
|
|||
|
||||
const databaseType = getDatabaseType();
|
||||
|
||||
if (!databaseType || !['mysql', 'postgresql'].includes(databaseType)) {
|
||||
if (!databaseType || !['mysql', 'postgresql', 'mongodb'].includes(databaseType)) {
|
||||
throw new Error('Missing or invalid database');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue