mirror of
https://github.com/umami-software/umami.git
synced 2026-02-12 00:27:11 +01:00
use uuid
This commit is contained in:
parent
246e4e5f4f
commit
17041efaae
73 changed files with 491 additions and 874 deletions
|
|
@ -24,7 +24,7 @@ async function relationalQuery(websiteId, { startDate, endDate, column, table, f
|
|||
from ${table}
|
||||
${` join website on ${table}.website_id = website.website_id`}
|
||||
${joinSession}
|
||||
where website.website_uuid='${websiteId}'
|
||||
where website.website_id='${websiteId}'
|
||||
and ${table}.created_at between $1 and $2
|
||||
${pageviewQuery}
|
||||
${joinSession && sessionQuery}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ async function relationalQuery(websiteId, start_at, end_at, column, table, filte
|
|||
from ${table}
|
||||
${` join website on ${table}.website_id = website.website_id`}
|
||||
${joinSession}
|
||||
where website.website_uuid='${websiteId}'
|
||||
where website.website_id='${websiteId}'
|
||||
and ${table}.created_at between $1 and $2
|
||||
and ${table}.url like '%?%'
|
||||
${pageviewQuery}
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ async function relationalQuery(
|
|||
join website
|
||||
on pageview.website_id = website.website_id
|
||||
${joinSession}
|
||||
where website.website_uuid='${websiteId}'
|
||||
where website.website_id='${websiteId}'
|
||||
and pageview.created_at between $1 and $2
|
||||
${pageviewQuery}
|
||||
${sessionQuery}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ async function relationalQuery(websites, start_at) {
|
|||
return prisma.client.pageview.findMany({
|
||||
where: {
|
||||
website: {
|
||||
websiteUuid: {
|
||||
id: {
|
||||
in: websites,
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -10,9 +10,13 @@ export async function savePageView(...args) {
|
|||
});
|
||||
}
|
||||
|
||||
async function relationalQuery({ websiteId }, { session: { id: sessionId }, url, referrer }) {
|
||||
async function relationalQuery(
|
||||
websiteId,
|
||||
{ pageViewId, session: { id: sessionId }, url, referrer },
|
||||
) {
|
||||
return prisma.client.pageview.create({
|
||||
data: {
|
||||
id: pageViewId,
|
||||
websiteId,
|
||||
sessionId,
|
||||
url: url?.substring(0, URL_LENGTH),
|
||||
|
|
@ -22,12 +26,12 @@ async function relationalQuery({ websiteId }, { session: { id: sessionId }, url,
|
|||
}
|
||||
|
||||
async function clickhouseQuery(
|
||||
{ websiteUuid: websiteId },
|
||||
{ session: { country, sessionUuid, ...sessionArgs }, url, referrer },
|
||||
websiteId,
|
||||
{ session: { country, id: sessionId, ...sessionArgs }, url, referrer },
|
||||
) {
|
||||
const { getDateFormat, sendMessage } = kafka;
|
||||
const params = {
|
||||
session_uuid: sessionUuid,
|
||||
session_id: sessionId,
|
||||
website_id: websiteId,
|
||||
created_at: getDateFormat(new Date()),
|
||||
url: url?.substring(0, URL_LENGTH),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue