mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 08:37:13 +01:00
template multiple queries for filtering
This commit is contained in:
parent
3494ae46b7
commit
cb4368e12c
4 changed files with 66 additions and 14 deletions
|
|
@ -51,12 +51,29 @@ async function clickhouseQuery(
|
|||
const columnQuery = unit === 'minute' ? 'count(*)' : 'sum(views)';
|
||||
|
||||
return rawQuery(
|
||||
// `
|
||||
// select
|
||||
// ${getDateStringSQL('g.t', unit)} as x,
|
||||
// g.y as y
|
||||
// from (
|
||||
// select
|
||||
// ${getDateSQL('created_at', unit, timezone)} as t,
|
||||
// count(*) as y
|
||||
// from website_event
|
||||
// where website_id = {websiteId:UUID}
|
||||
// and created_at between {startDate:DateTime64} and {endDate:DateTime64}
|
||||
// and event_type = {eventType:UInt32}
|
||||
// ${filterQuery}
|
||||
// group by t
|
||||
// ) as g
|
||||
// order by t
|
||||
// `,
|
||||
`
|
||||
select
|
||||
${getDateStringSQL('g.t', unit)} as x,
|
||||
${getDateStringSQL('g.t', unit)} as x,
|
||||
g.y as y
|
||||
from (
|
||||
select
|
||||
select
|
||||
${getDateSQL('created_at', unit, timezone)} as t,
|
||||
${columnQuery} as y
|
||||
from ${table} website_event
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue