diff --git a/packages/db/src/clickhouse-client.ts b/packages/db/src/clickhouse-client.ts index 5b8b67a1..eed2ff07 100644 --- a/packages/db/src/clickhouse-client.ts +++ b/packages/db/src/clickhouse-client.ts @@ -43,8 +43,8 @@ export const originalCh = createClient({ ...CLICKHOUSE_OPTIONS, }); -const cleanQuery = (query: string) => - query.replace(/\n/g, '').replace(/\s+/g, ' ').trim(); +const cleanQuery = (query?: string) => + query ? query.replace(/\n/g, '').replace(/\s+/g, ' ').trim() : undefined; export const ch = new Proxy(originalCh, { get(target, property, receiver) {