fix CH query

This commit is contained in:
Brian Cao 2022-08-29 13:32:30 -07:00
parent b6cd9f305b
commit 92acd8c1a7

View File

@ -43,7 +43,7 @@ async function clickhouseQuery(
unit = 'day', unit = 'day',
filters = {}, filters = {},
) { ) {
const { rawQuery, getDateQuery, getBetweenDates } = prisma; const { rawQuery, getDateQuery, getBetweenDates, getFilterQuery } = clickhouse;
const params = [website_id]; const params = [website_id];
return rawQuery( return rawQuery(
@ -54,7 +54,7 @@ async function clickhouseQuery(
from event from event
where website_id= $1 where website_id= $1
and ${getBetweenDates('created_at', start_at, end_at)} and ${getBetweenDates('created_at', start_at, end_at)}
${clickhouse.getFilterQuery('event', filters, params)} ${getFilterQuery('event', filters, params)}
group by x, t group by x, t
order by t`, order by t`,
params, params,