mirror of
https://github.com/kremalicious/umami.git
synced 2025-01-11 13:44:01 +01:00
fix parseFilters
This commit is contained in:
parent
aa8057f9fe
commit
1c26581cd1
@ -1,15 +1,14 @@
|
||||
import { getDatabase, parseFilters, rawQuery } from 'lib/db';
|
||||
import { MYSQL, POSTGRESQL } from 'lib/constants';
|
||||
import { getDatabase, parseFilters, rawQuery, runAnalyticsQuery } from 'lib/db';
|
||||
import { MYSQL, POSTGRESQL, CLICKHOUSE, RELATIONAL } from 'lib/constants';
|
||||
|
||||
export function getPageviewParams(
|
||||
param,
|
||||
website_id,
|
||||
start_at,
|
||||
end_at,
|
||||
column,
|
||||
table,
|
||||
filters = {},
|
||||
) {
|
||||
export async function getPageviewParams(...args) {
|
||||
return runAnalyticsQuery({
|
||||
[`${RELATIONAL}`]: () => relationalQuery(...args),
|
||||
[`${CLICKHOUSE}`]: () => clickhouseQuery(...args),
|
||||
});
|
||||
}
|
||||
|
||||
function relationalQuery(param, website_id, start_at, end_at, column, table, filters = {}) {
|
||||
const params = [param, website_id, start_at, end_at];
|
||||
const { pageviewQuery, sessionQuery, eventQuery, joinSession } = parseFilters(
|
||||
table,
|
||||
@ -43,3 +42,7 @@ export function getPageviewParams(
|
||||
params,
|
||||
);
|
||||
}
|
||||
|
||||
function clickhouseQuery() {
|
||||
return Promise.reject(new Error('Not implemented.'));
|
||||
}
|
||||
|
@ -64,6 +64,7 @@ async function clickhouseQuery(
|
||||
const params = [website_id];
|
||||
const { pageviewQuery, sessionQuery, joinSession } = parseFilters(
|
||||
'pageview',
|
||||
null,
|
||||
filters,
|
||||
params,
|
||||
sessionKey,
|
||||
|
@ -47,6 +47,7 @@ async function clickhouseQuery(website_id, start_at, end_at, field, filters = {}
|
||||
const params = [website_id];
|
||||
const { pageviewQuery, sessionQuery, joinSession } = parseFilters(
|
||||
'pageview',
|
||||
null,
|
||||
filters,
|
||||
params,
|
||||
'session_uuid',
|
||||
|
@ -59,6 +59,7 @@ async function clickhouseQuery(website_id, start_at, end_at, filters = {}) {
|
||||
const params = [website_id];
|
||||
const { pageviewQuery, sessionQuery, joinSession } = parseFilters(
|
||||
'pageview',
|
||||
null,
|
||||
filters,
|
||||
params,
|
||||
'session_uuid',
|
||||
|
Loading…
Reference in New Issue
Block a user