mirror of
https://github.com/umami-software/umami.git
synced 2026-02-15 10:05:36 +01:00
Added more function names to queries.
This commit is contained in:
parent
cd6ad0add2
commit
da572864ac
25 changed files with 118 additions and 20 deletions
|
|
@ -2,6 +2,8 @@ import prisma from '@/lib/prisma';
|
|||
import clickhouse from '@/lib/clickhouse';
|
||||
import { runQuery, PRISMA, CLICKHOUSE } from '@/lib/db';
|
||||
|
||||
const FUNCTION_NAME = 'getWebsiteSession';
|
||||
|
||||
export async function getWebsiteSession(...args: [websiteId: string, sessionId: string]) {
|
||||
return runQuery({
|
||||
[PRISMA]: () => relationalQuery(...args),
|
||||
|
|
@ -56,6 +58,7 @@ async function relationalQuery(websiteId: string, sessionId: string) {
|
|||
group by id, distinct_id, website_id, browser, os, device, screen, language, country, region, city;
|
||||
`,
|
||||
{ websiteId, sessionId },
|
||||
FUNCTION_NAME,
|
||||
).then(result => result?.[0]);
|
||||
}
|
||||
|
||||
|
|
@ -105,5 +108,6 @@ async function clickhouseQuery(websiteId: string, sessionId: string) {
|
|||
group by id, websiteId, distinctId, browser, os, device, screen, language, country, region, city;
|
||||
`,
|
||||
{ websiteId, sessionId },
|
||||
FUNCTION_NAME,
|
||||
).then(result => result?.[0]);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue