mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 00:27:11 +01:00
Updated Clickhouse number handling. Removed number formatting.
This commit is contained in:
parent
caa9da9166
commit
04e0b33622
15 changed files with 23 additions and 145 deletions
|
|
@ -18,9 +18,9 @@ async function relationalQuery(websiteId: string) {
|
|||
select count(distinct session_id) x
|
||||
from website_event
|
||||
where website_id = {{websiteId::uuid}}
|
||||
and created_at >= {{startAt}}
|
||||
and created_at >= {{startDate}}
|
||||
`,
|
||||
{ websiteId, startAt: subMinutes(new Date(), 5) },
|
||||
{ websiteId, startDate: subMinutes(new Date(), 5) },
|
||||
);
|
||||
|
||||
return result[0] ?? null;
|
||||
|
|
@ -35,14 +35,10 @@ async function clickhouseQuery(websiteId: string): Promise<{ x: number }> {
|
|||
count(distinct session_id) x
|
||||
from website_event
|
||||
where website_id = {websiteId:UUID}
|
||||
and created_at >= {startAt:DateTime64}
|
||||
and created_at >= {startDate:DateTime64}
|
||||
`,
|
||||
{ websiteId, startAt: subMinutes(new Date(), 5) },
|
||||
).then(a => {
|
||||
return Object.values(a).map(a => {
|
||||
return { x: Number(a.x) };
|
||||
});
|
||||
});
|
||||
{ websiteId, startDate: subMinutes(new Date(), 5) },
|
||||
);
|
||||
|
||||
return result[0] ?? null;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue