mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 15:17:23 +01:00
Added parseDateRangeQuery function.
This commit is contained in:
parent
09af33c77e
commit
1648707fc7
9 changed files with 48 additions and 80 deletions
|
|
@ -9,18 +9,18 @@ export async function getSessions(...args: [websiteId: string, startAt: Date]) {
|
|||
});
|
||||
}
|
||||
|
||||
async function relationalQuery(websiteId: string, startAt: Date) {
|
||||
async function relationalQuery(websiteId: string, startDate: Date) {
|
||||
return prisma.client.session.findMany({
|
||||
where: {
|
||||
websiteId,
|
||||
createdAt: {
|
||||
gte: startAt,
|
||||
gte: startDate,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
async function clickhouseQuery(websiteId: string, startAt: Date) {
|
||||
async function clickhouseQuery(websiteId: string, startDate: Date) {
|
||||
const { rawQuery } = clickhouse;
|
||||
|
||||
return rawQuery(
|
||||
|
|
@ -42,11 +42,11 @@ async function clickhouseQuery(websiteId: string, startAt: Date) {
|
|||
city
|
||||
from website_event
|
||||
where website_id = {websiteId:UUID}
|
||||
and created_at >= {startAt:DateTime}
|
||||
and created_at >= {startDate:DateTime}
|
||||
`,
|
||||
{
|
||||
websiteId,
|
||||
startAt,
|
||||
startDate,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue