mirror of
https://github.com/umami-software/umami.git
synced 2026-02-11 08:07:12 +01:00
Merge branch 'dev' into feat/um-66-update-clickhouse-schema-uuid
This commit is contained in:
commit
ec6454aead
65 changed files with 436 additions and 441 deletions
|
|
@ -9,9 +9,9 @@ export async function getPageviewMetrics(...args) {
|
|||
});
|
||||
}
|
||||
|
||||
async function relationalQuery(website_id, { startDate, endDate, column, table, filters = {} }) {
|
||||
async function relationalQuery(websiteId, { startDate, endDate, column, table, filters = {} }) {
|
||||
const { rawQuery, parseFilters } = prisma;
|
||||
const params = [website_id, startDate, endDate];
|
||||
const params = [websiteId, startDate, endDate];
|
||||
const { pageviewQuery, sessionQuery, eventQuery, joinSession } = parseFilters(
|
||||
table,
|
||||
column,
|
||||
|
|
@ -34,9 +34,9 @@ async function relationalQuery(website_id, { startDate, endDate, column, table,
|
|||
);
|
||||
}
|
||||
|
||||
async function clickhouseQuery(website_uuid, { startDate, endDate, column, filters = {} }) {
|
||||
async function clickhouseQuery(websiteId, { startDate, endDate, column, filters = {} }) {
|
||||
const { rawQuery, parseFilters, getBetweenDates } = clickhouse;
|
||||
const params = [website_uuid];
|
||||
const params = [websiteId];
|
||||
const { pageviewQuery, sessionQuery, eventQuery } = parseFilters(column, filters, params);
|
||||
|
||||
return rawQuery(
|
||||
|
|
|
|||
|
|
@ -8,9 +8,9 @@ export async function getPageviewParams(...args) {
|
|||
});
|
||||
}
|
||||
|
||||
async function relationalQuery(website_id, start_at, end_at, column, table, filters = {}) {
|
||||
async function relationalQuery(websiteId, start_at, end_at, column, table, filters = {}) {
|
||||
const { parseFilters, rawQuery } = prisma;
|
||||
const params = [website_id, start_at, end_at];
|
||||
const params = [websiteId, start_at, end_at];
|
||||
const { pageviewQuery, sessionQuery, eventQuery, joinSession } = parseFilters(
|
||||
table,
|
||||
column,
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ export async function getPageviewStats(...args) {
|
|||
}
|
||||
|
||||
async function relationalQuery(
|
||||
website_id,
|
||||
websiteId,
|
||||
{
|
||||
start_at,
|
||||
end_at,
|
||||
|
|
@ -22,7 +22,7 @@ async function relationalQuery(
|
|||
},
|
||||
) {
|
||||
const { getDateQuery, parseFilters, rawQuery } = prisma;
|
||||
const params = [website_id, start_at, end_at];
|
||||
const params = [websiteId, start_at, end_at];
|
||||
const { pageviewQuery, sessionQuery, joinSession } = parseFilters(
|
||||
'pageview',
|
||||
null,
|
||||
|
|
@ -45,11 +45,11 @@ async function relationalQuery(
|
|||
}
|
||||
|
||||
async function clickhouseQuery(
|
||||
website_uuid,
|
||||
websiteId,
|
||||
{ start_at, end_at, timezone = 'UTC', unit = 'day', count = '*', filters = {} },
|
||||
) {
|
||||
const { parseFilters, rawQuery, getDateStringQuery, getDateQuery, getBetweenDates } = clickhouse;
|
||||
const params = [website_uuid];
|
||||
const params = [websiteId];
|
||||
const { pageviewQuery, sessionQuery } = parseFilters(null, filters, params);
|
||||
|
||||
return rawQuery(
|
||||
|
|
|
|||
|
|
@ -13,11 +13,11 @@ async function relationalQuery(websites, start_at) {
|
|||
return prisma.client.pageview.findMany({
|
||||
where: {
|
||||
website: {
|
||||
website_id: {
|
||||
id: {
|
||||
in: websites,
|
||||
},
|
||||
},
|
||||
created_at: {
|
||||
createdAt: {
|
||||
gte: start_at,
|
||||
},
|
||||
},
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@ export async function savePageView(...args) {
|
|||
});
|
||||
}
|
||||
|
||||
async function relationalQuery(website_id, { session: { session_id }, url, referrer }) {
|
||||
async function relationalQuery(websiteId, { session: { sessionId }, url, referrer }) {
|
||||
return prisma.client.pageview.create({
|
||||
data: {
|
||||
website_id,
|
||||
session_id,
|
||||
websiteId,
|
||||
sessionId,
|
||||
url: url?.substring(0, URL_LENGTH),
|
||||
referrer: referrer?.substring(0, URL_LENGTH),
|
||||
},
|
||||
|
|
@ -22,12 +22,13 @@ async function relationalQuery(website_id, { session: { session_id }, url, refer
|
|||
}
|
||||
|
||||
async function clickhouseQuery(
|
||||
website_uuid,
|
||||
{ session: { country, ...sessionArgs }, url, referrer },
|
||||
websiteId,
|
||||
{ session: { country, sessionUuid, ...sessionArgs }, url, referrer },
|
||||
) {
|
||||
const { getDateFormat, sendMessage } = kafka;
|
||||
const params = {
|
||||
website_id: website_uuid,
|
||||
session_uuid: sessionUuid,
|
||||
website_id: websiteId,
|
||||
created_at: getDateFormat(new Date()),
|
||||
url: url?.substring(0, URL_LENGTH),
|
||||
referrer: referrer?.substring(0, URL_LENGTH),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue