diff --git a/lib/clients/scale3_clickhouse/client/client.ts b/lib/clients/scale3_clickhouse/client/client.ts index 033441dd..6cff26fd 100644 --- a/lib/clients/scale3_clickhouse/client/client.ts +++ b/lib/clients/scale3_clickhouse/client/client.ts @@ -65,9 +65,9 @@ export class ClickhouseBaseClient implements IBaseChClient { async update(query: string): Promise { try { - return await ( + return (await ( await this.client.query({ query: query, format: "JSONEachRow" }) - ).json(); + ).json()) as T; } catch (err) { throw new Error( `An error occurred while trying to update the resource ${err}` @@ -95,12 +95,12 @@ export class ClickhouseBaseClient implements IBaseChClient { async find(filter: SelectStatement): Promise { try { - return await ( + return (await ( await this.client.query({ query: filter.toString(), format: "JSONEachRow", }) - ).json(); + ).json()) as T; } catch (err) { throw new Error( `An error occurred while trying to find the resource ${err}`