mirror of
https://github.com/umami-software/umami.git
synced 2026-02-04 04:37:11 +01:00
Feat/um 49 query builder api (#1573)
* add uuid to event. add indexes * eventdata api * add event data * remove test data * update list
This commit is contained in:
parent
9c36dc485e
commit
ba31f48f1a
32 changed files with 690 additions and 64 deletions
|
|
@ -11,7 +11,7 @@ export async function getPageviewMetrics(...args) {
|
|||
|
||||
async function relationalQuery(websiteId, { startDate, endDate, column, table, filters = {} }) {
|
||||
const { rawQuery, parseFilters } = prisma;
|
||||
const params = [websiteId, startDate, endDate];
|
||||
const params = [startDate, endDate];
|
||||
const { pageviewQuery, sessionQuery, eventQuery, joinSession } = parseFilters(
|
||||
table,
|
||||
column,
|
||||
|
|
@ -25,7 +25,7 @@ async function relationalQuery(websiteId, { startDate, endDate, column, table, f
|
|||
${` join website on ${table}.website_id = website.website_id`}
|
||||
${joinSession}
|
||||
where website.website_uuid='${websiteId}'
|
||||
and ${table}.created_at between $2 and $3
|
||||
and ${table}.created_at between $1 and $2
|
||||
${pageviewQuery}
|
||||
${joinSession && sessionQuery}
|
||||
${eventQuery}
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ export async function getPageviewParams(...args) {
|
|||
|
||||
async function relationalQuery(websiteId, start_at, end_at, column, table, filters = {}) {
|
||||
const { parseFilters, rawQuery } = prisma;
|
||||
const params = [websiteId, start_at, end_at];
|
||||
const params = [start_at, end_at];
|
||||
const { pageviewQuery, sessionQuery, eventQuery, joinSession } = parseFilters(
|
||||
table,
|
||||
column,
|
||||
|
|
@ -25,7 +25,7 @@ async function relationalQuery(websiteId, start_at, end_at, column, table, filte
|
|||
${` join website on ${table}.website_id = website.website_id`}
|
||||
${joinSession}
|
||||
where website.website_uuid='${websiteId}'
|
||||
and ${table}.created_at between $2 and $3
|
||||
and ${table}.created_at between $1 and $2
|
||||
and ${table}.url like '%?%'
|
||||
${pageviewQuery}
|
||||
${joinSession && sessionQuery}
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ async function relationalQuery(
|
|||
},
|
||||
) {
|
||||
const { getDateQuery, parseFilters, rawQuery } = prisma;
|
||||
const params = [websiteId, start_at, end_at];
|
||||
const params = [start_at, end_at];
|
||||
const { pageviewQuery, sessionQuery, joinSession } = parseFilters(
|
||||
'pageview',
|
||||
null,
|
||||
|
|
@ -38,7 +38,7 @@ async function relationalQuery(
|
|||
on pageview.website_id = website.website_id
|
||||
${joinSession}
|
||||
where website.website_uuid='${websiteId}'
|
||||
and pageview.created_at between $2 and $3
|
||||
and pageview.created_at between $1 and $2
|
||||
${pageviewQuery}
|
||||
${sessionQuery}
|
||||
group by 1`,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue