Fix null and string return types from getWebsiteStats

This commit is contained in:
Francis Cao 2025-11-09 21:37:35 -08:00
parent c44f6f8c9c
commit f30724629c

View file

@ -36,11 +36,11 @@ async function relationalQuery(
return rawQuery(
`
select
sum(t.c) as "pageviews",
cast(coalesce(sum(t.c), 0) as bigint) as "pageviews",
count(distinct t.session_id) as "visitors",
count(distinct t.visit_id) as "visits",
sum(case when t.c = 1 then 1 else 0 end) as "bounces",
sum(${getTimestampDiffSQL('t.min_time', 't.max_time')}) as "totaltime"
coalesce(sum(case when t.c = 1 then 1 else 0 end), 0) as "bounces",
cast(coalesce(sum(${getTimestampDiffSQL('t.min_time', 't.max_time')}), 0) as bigint) as "totaltime"
from (
select
website_event.session_id,