QuesmaOrg / quesma

Programmable database gateway
https://quesma.com
Other
108 stars 6 forks source link

`_count` endpoint doesn't work for non-default database #985

Open avelanarius opened 1 week ago

avelanarius commented 1 week ago

ClickHouse/Hydrolix backend connector supports a database config option, which is prepended to table names (e.g. if table name is logs and database is my_company, then SQL queries will access my_company.logs). The _search endpoint properly respects that option, however the _count endpoint doesn't take that into account:

quesma/quesma/quesma.go:156 > quesma request failed: clickhouse: query row failed: code: 60, message: Table _local.siem does not exist opaque_id= path=/siem/_count reason="Failed request." request_id=01932603-9a36-71e7-9019-2ca1117745f2