mirror of
https://github.com/umami-software/umami.git
synced 2026-02-16 02:25:35 +01:00
v3 prisma queries update
This commit is contained in:
parent
61b667c587
commit
2ffde37f5b
21 changed files with 119 additions and 108 deletions
|
|
@ -69,14 +69,14 @@ async function relationalQuery(
|
|||
|
||||
const eventQuery = `WITH events AS (
|
||||
select distinct
|
||||
session_id,
|
||||
max(created_at) max_dt
|
||||
website_event.session_id,
|
||||
max(website_event.created_at) max_dt
|
||||
from website_event
|
||||
${cohortQuery}
|
||||
${joinSessionQuery}
|
||||
where website_id = {{websiteId::uuid}}
|
||||
and created_at between {{startDate}} and {{endDate}}
|
||||
and ${column} = {{step}}
|
||||
where website_event.website_id = {{websiteId::uuid}}
|
||||
and website_event.created_at between {{startDate}} and {{endDate}}
|
||||
and website_event.${column} = {{step}}
|
||||
${filterQuery}
|
||||
group by 1),`;
|
||||
|
||||
|
|
@ -234,14 +234,14 @@ async function relationalQuery(
|
|||
`
|
||||
select
|
||||
count(*) as "pageviews",
|
||||
count(distinct session_id) as "visitors",
|
||||
count(distinct visit_id) as "visits"
|
||||
count(distinct website_event.session_id) as "visitors",
|
||||
count(distinct website_event.visit_id) as "visits"
|
||||
from website_event
|
||||
${joinSessionQuery}
|
||||
${cohortQuery}
|
||||
where website_id = {{websiteId::uuid}}
|
||||
and created_at between {{startDate}} and {{endDate}}
|
||||
and ${column} = {{step}}
|
||||
where website_event.website_id = {{websiteId::uuid}}
|
||||
and website_event.created_at between {{startDate}} and {{endDate}}
|
||||
and website_event.${column} = {{step}}
|
||||
${filterQuery}
|
||||
`,
|
||||
queryParams,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue