v3 prisma queries update

This commit is contained in:
Francis Cao 2025-10-27 11:48:35 -07:00
parent 61b667c587
commit 2ffde37f5b
21 changed files with 119 additions and 108 deletions

View file

@ -30,15 +30,15 @@ async function relationalQuery(websiteId: string, filters: QueryFilters) {
return rawQuery(
`
WITH prefix AS (
select case when utm_medium LIKE 'p%' OR
utm_medium LIKE '%ppc%' OR
utm_medium LIKE '%retargeting%' OR
utm_medium LIKE '%paid%' then 'paid' else 'organic' end prefix,
referrer_domain,
url_query,
utm_medium,
utm_source,
session_id
select case when website_event.utm_medium LIKE 'p%' OR
website_event.utm_medium LIKE '%ppc%' OR
website_event.utm_medium LIKE '%retargeting%' OR
website_event.utm_medium LIKE '%paid%' then 'paid' else 'organic' end prefix,
website_event.referrer_domain,
website_event.url_query,
website_event.utm_medium,
website_event.utm_source,
website_event.session_id
from website_event
${cohortQuery}
${joinSessionQuery}