mirror of
https://github.com/umami-software/umami.git
synced 2026-02-20 04:25:39 +01:00
Implement Cockroachdb interaction
This commit is contained in:
parent
38c9da4e55
commit
33422d8a6c
3 changed files with 22 additions and 6 deletions
|
|
@ -6,6 +6,10 @@ const del = require('del');
|
|||
function getDatabaseType(url = process.env.DATABASE_URL) {
|
||||
const type = process.env.DATABASE_TYPE || (url && url.split(':')[0]);
|
||||
|
||||
if (process.env.COCKROACH_DB) {
|
||||
return 'cockroachdb';
|
||||
}
|
||||
|
||||
if (type === 'postgres') {
|
||||
return 'postgresql';
|
||||
}
|
||||
|
|
@ -15,7 +19,7 @@ function getDatabaseType(url = process.env.DATABASE_URL) {
|
|||
|
||||
const databaseType = getDatabaseType();
|
||||
|
||||
if (!databaseType || !['mysql', 'postgresql'].includes(databaseType)) {
|
||||
if (!databaseType || !['mysql', 'postgresql', 'cockroachdb'].includes(databaseType)) {
|
||||
throw new Error('Missing or invalid database');
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue