chore: populate connectionlog count using a separate query (#18629)

This is the third PR for moving connection events out of the audit log.

This PR populates `count` on `ConnectionLogResponse` using a separate query, to preemptively mitigate the issue described in #17689. It's structurally identical to a portion of https://github.com/coder/coder/pull/18600, but for the connection log instead of the audit log.
       
Future PRs:
- Implement a table in the Web UI for viewing connection logs.
- Write a query to delete old events from the audit log, call it from dbpurge.
- Write documentation for the endpoint / feature
This commit is contained in:
Ethan
2025-07-15 15:03:30 +10:00
committed by GitHub
parent 7a339a1ffe
commit 7c077d39c5
15 changed files with 552 additions and 11 deletions
+1 -1
View File
@@ -318,7 +318,7 @@ func hasEmptyResponse(values []reflect.Value) bool {
}
}
// Special case for int64, as it's the return type for count query.
// Special case for int64, as it's the return type for count queries.
if r.Kind() == reflect.Int64 {
if r.Int() == 0 {
return true