Updated pixel/link endpoints. Added name to rawQuery.
This commit is contained in:
@@ -1,9 +1,11 @@
|
||||
import clickhouse from '@/lib/clickhouse';
|
||||
import { EVENT_TYPE, FILTER_COLUMNS, GROUPED_DOMAINS, SESSION_COLUMNS } from '@/lib/constants';
|
||||
import { FILTER_COLUMNS, GROUPED_DOMAINS, SESSION_COLUMNS } from '@/lib/constants';
|
||||
import { CLICKHOUSE, PRISMA, runQuery } from '@/lib/db';
|
||||
import prisma from '@/lib/prisma';
|
||||
import { QueryFilters } from '@/lib/types';
|
||||
|
||||
const FUNCTION_NAME = 'getPageviewExpandedMetrics';
|
||||
|
||||
export interface PageviewExpandedMetricsParameters {
|
||||
type: string;
|
||||
limit?: number | string;
|
||||
@@ -40,7 +42,6 @@ async function relationalQuery(
|
||||
{
|
||||
...filters,
|
||||
websiteId,
|
||||
eventType: column === 'event_name' ? EVENT_TYPE.customEvent : EVENT_TYPE.pageView,
|
||||
},
|
||||
{ joinSession: SESSION_COLUMNS.includes(type) },
|
||||
);
|
||||
@@ -89,6 +90,7 @@ async function relationalQuery(
|
||||
offset ${offset}
|
||||
`,
|
||||
queryParams,
|
||||
FUNCTION_NAME,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -103,7 +105,6 @@ async function clickhouseQuery(
|
||||
const { filterQuery, cohortQuery, queryParams } = parseFilters({
|
||||
...filters,
|
||||
websiteId,
|
||||
eventType: column === 'event_name' ? EVENT_TYPE.customEvent : EVENT_TYPE.pageView,
|
||||
});
|
||||
|
||||
let excludeDomain = '';
|
||||
@@ -164,6 +165,7 @@ async function clickhouseQuery(
|
||||
offset ${offset}
|
||||
`,
|
||||
{ ...queryParams, ...parameters },
|
||||
FUNCTION_NAME,
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
import clickhouse from '@/lib/clickhouse';
|
||||
import { EVENT_COLUMNS, EVENT_TYPE, FILTER_COLUMNS, SESSION_COLUMNS } from '@/lib/constants';
|
||||
import { EVENT_COLUMNS, FILTER_COLUMNS, SESSION_COLUMNS } from '@/lib/constants';
|
||||
import { CLICKHOUSE, PRISMA, runQuery } from '@/lib/db';
|
||||
import prisma from '@/lib/prisma';
|
||||
import { QueryFilters } from '@/lib/types';
|
||||
|
||||
const FUNCTION_NAME = 'getPageviewMetrics';
|
||||
|
||||
export interface PageviewMetricsParameters {
|
||||
type: string;
|
||||
limit?: number | string;
|
||||
@@ -36,7 +38,6 @@ async function relationalQuery(
|
||||
{
|
||||
...filters,
|
||||
websiteId,
|
||||
eventType: column === 'event_name' ? EVENT_TYPE.customEvent : EVENT_TYPE.pageView,
|
||||
},
|
||||
{ joinSession: SESSION_COLUMNS.includes(type) },
|
||||
);
|
||||
@@ -86,6 +87,7 @@ async function relationalQuery(
|
||||
offset ${offset}
|
||||
`,
|
||||
{ ...queryParams, ...parameters },
|
||||
FUNCTION_NAME,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -100,7 +102,6 @@ async function clickhouseQuery(
|
||||
const { filterQuery, cohortQuery, queryParams } = parseFilters({
|
||||
...filters,
|
||||
websiteId,
|
||||
eventType: column === 'event_name' ? EVENT_TYPE.customEvent : EVENT_TYPE.pageView,
|
||||
});
|
||||
|
||||
let sql = '';
|
||||
@@ -183,5 +184,5 @@ async function clickhouseQuery(
|
||||
`;
|
||||
}
|
||||
|
||||
return rawQuery(sql, { ...queryParams, ...parameters });
|
||||
return rawQuery(sql, { ...queryParams, ...parameters }, FUNCTION_NAME);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user