mirror of
https://github.com/umami-software/umami.git
synced 2026-02-07 06:07:17 +01:00
Added more function names to queries.
This commit is contained in:
parent
cd6ad0add2
commit
da572864ac
25 changed files with 118 additions and 20 deletions
|
|
@ -4,6 +4,8 @@ import { runQuery, PRISMA, CLICKHOUSE } from '@/lib/db';
|
|||
import { QueryFilters } from '@/lib/types';
|
||||
import { EVENT_COLUMNS } from '@/lib/constants';
|
||||
|
||||
const FUNCTION_NAME = 'getWeeklyTraffic';
|
||||
|
||||
export async function getWeeklyTraffic(...args: [websiteId: string, filters: QueryFilters]) {
|
||||
return runQuery({
|
||||
[PRISMA]: () => relationalQuery(...args),
|
||||
|
|
@ -34,6 +36,7 @@ async function relationalQuery(websiteId: string, filters: QueryFilters) {
|
|||
order by 2
|
||||
`,
|
||||
queryParams,
|
||||
FUNCTION_NAME,
|
||||
).then(formatResults);
|
||||
}
|
||||
|
||||
|
|
@ -72,7 +75,7 @@ async function clickhouseQuery(websiteId: string, filters: QueryFilters) {
|
|||
`;
|
||||
}
|
||||
|
||||
return rawQuery(sql, queryParams).then(formatResults);
|
||||
return rawQuery(sql, queryParams, FUNCTION_NAME).then(formatResults);
|
||||
}
|
||||
|
||||
function formatResults(data: any) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue