mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 23:27:12 +01:00
Insights report filters.
This commit is contained in:
parent
acbffed2ce
commit
5039349d57
7 changed files with 138 additions and 87 deletions
|
|
@ -45,7 +45,7 @@ async function relationalQuery(
|
|||
and website_event.created_at between {{startDate}} and {{endDate}}
|
||||
and website_event.event_type = {{eventType}}
|
||||
${filterQuery}
|
||||
group by ${fields.map(({ name }) => name).join(',')}
|
||||
${parseGroupBy(fields)}
|
||||
order by 1 desc, 2 desc
|
||||
limit 500
|
||||
`,
|
||||
|
|
@ -78,7 +78,7 @@ async function clickhouseQuery(
|
|||
and created_at between {startDate:DateTime} and {endDate:DateTime}
|
||||
and event_type = {eventType:UInt32}
|
||||
${filterQuery}
|
||||
group by ${fields.map(({ name }) => name).join(',')}
|
||||
${parseGroupBy(fields)}
|
||||
order by 1 desc, 2 desc
|
||||
limit 500
|
||||
`,
|
||||
|
|
@ -98,3 +98,10 @@ function parseFields(fields) {
|
|||
|
||||
return query.join(',\n');
|
||||
}
|
||||
|
||||
function parseGroupBy(fields) {
|
||||
if (!fields.length) {
|
||||
return '';
|
||||
}
|
||||
return `group by ${fields.map(({ name }) => name).join(',')}`;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue