mirror of
https://github.com/umami-software/umami.git
synced 2025-12-08 05:12:36 +01:00
fix CH return.
This commit is contained in:
parent
af7c6f73b0
commit
f189035a73
16 changed files with 40 additions and 34 deletions
12
lib/db.js
12
lib/db.js
|
|
@ -277,14 +277,22 @@ export async function rawQueryClickhouse(query, params = [], debug = false) {
|
|||
return clickhouse.query(formattedQuery).toPromise();
|
||||
}
|
||||
|
||||
export async function findUnique(data) {
|
||||
if (data.length > 1) {
|
||||
throw `${data.length} records found when expecting 1.`;
|
||||
}
|
||||
|
||||
return data[0] ?? null;
|
||||
}
|
||||
|
||||
export async function runAnalyticsQuery(queries) {
|
||||
const db = getAnalyticsDatabase();
|
||||
|
||||
if (db === POSTGRESQL || db === MYSQL) {
|
||||
return queries[`${RELATIONAL}`]();
|
||||
return queries[RELATIONAL]();
|
||||
}
|
||||
|
||||
if (db === CLICKHOUSE) {
|
||||
return queries[`${CLICKHOUSE}`]();
|
||||
return queries[CLICKHOUSE]();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue