Re-write CH queries to use query params.

This commit is contained in:
Brian Cao committed 2023-01-12 00:02:12 -08:00
1 parent b4bd988e4e
commit 1eb9e10d94
12 files changed
+81 -100

No files matched your search

+2 -2
View File
@@ -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));