feat: session specific logs

This commit is contained in:
adamdottv 2025-05-14 13:06:09 -05:00
commit 3982be4310
No known key found for this signature in database
GPG key ID: 9CB48779AF150E75
15 changed files with 178 additions and 195 deletions

View file

@ -101,7 +101,7 @@ func (q *Queries) ListAllLogs(ctx context.Context, limit int64) ([]Log, error) {
const listLogsBySession = `-- name: ListLogsBySession :many
SELECT id, session_id, timestamp, level, message, attributes, created_at, updated_at FROM logs
WHERE session_id = ?
ORDER BY timestamp ASC
ORDER BY timestamp DESC
`
func (q *Queries) ListLogsBySession(ctx context.Context, sessionID sql.NullString) ([]Log, error) {

View file

@ -18,7 +18,7 @@ INSERT INTO logs (
-- name: ListLogsBySession :many
SELECT * FROM logs
WHERE session_id = ?
ORDER BY timestamp ASC;
ORDER BY timestamp DESC;
-- name: ListAllLogs :many
SELECT * FROM logs