Closed esadek closed 3 months ago
This looks like a bug indeed. Feel free to open a PR. Given that it requires a secondary query to ClickHouse, we may want to have the total only be shown if it’s needed and add a flag / query param for it.
Can't null
just be changed to results.length
?
The total is meant to reflect the total amount of results to be used with pagination (e.g. calculating total number of pages to show an end user).
@christianmat I would like to open a PR for this
@tuminzee go for it :)
const totalQuery = `SELECT count() FROM events ${whereClause}`
const total = await this.clickhouse.queryResults(totalQuery, workspace.databaseName)
total: total?.[0]?.count ?? 0,
I am working through the quickstart and am getting
total": null
when using the Get Events API. The docs say "If null, the total is unknown" but I don't think this should be the case since ClickHouse contains only one event.