fix CH return.
This commit is contained in:
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]();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user