mirror of
https://github.com/umami-software/umami.git
synced 2026-02-09 15:17:23 +01:00
Re-write CH queries to use query params.
This commit is contained in:
parent
b4bd988e4e
commit
1eb9e10d94
12 changed files with 81 additions and 100 deletions
|
|
@ -18,7 +18,7 @@ async function relationalQuery(where: Prisma.SessionWhereUniqueInput) {
|
|||
|
||||
async function clickhouseQuery({ id: sessionId }: { id: string }) {
|
||||
const { rawQuery, findFirst } = clickhouse;
|
||||
const params = [sessionId];
|
||||
const params = { sessionId };
|
||||
|
||||
return rawQuery(
|
||||
`select
|
||||
|
|
@ -33,7 +33,7 @@ async function clickhouseQuery({ id: sessionId }: { id: string }) {
|
|||
language,
|
||||
country
|
||||
from event
|
||||
where session_id = $1
|
||||
where session_id = {sessionId:UUID}
|
||||
limit 1`,
|
||||
params,
|
||||
).then(result => findFirst(result));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue