feat(query): include session totals and stable framework names
This commit is contained in:
@@ -51,7 +51,7 @@ func (d *DB) GetSummary(ctx context.Context) (*Summary, error) {
|
||||
WITH session_groups AS (
|
||||
SELECT
|
||||
session_id,
|
||||
COALESCE(MAX(source_framework), 'unknown') AS framework,
|
||||
COALESCE((ARRAY_AGG(source_framework ORDER BY CASE WHEN type = 'session.start' THEN 0 ELSE 1 END, ts) FILTER (WHERE source_framework IS NOT NULL))[1], 'unknown') AS framework,
|
||||
MAX(ts) AS last_event_at,
|
||||
BOOL_OR(type = 'session.start') AS has_start,
|
||||
BOOL_OR(type = 'session.end') AS has_end
|
||||
|
||||
Reference in New Issue
Block a user