summaryrefslogtreecommitdiffhomepage
path: root/internal/db/sql/logs.sql
blob: 1a0655f7e87c1e970bb0412b7b404d76b88957cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
-- name: CreateLog :exec
INSERT INTO logs (
    id,
    session_id,
    timestamp,
    level,
    message,
    attributes,
    created_at
) VALUES (
    ?,
    ?,
    ?,
    ?,
    ?,
    ?,
    ?
);

-- name: ListLogsBySession :many
SELECT * FROM logs
WHERE session_id = ?
ORDER BY timestamp ASC;

-- name: ListAllLogs :many
SELECT * FROM logs
ORDER BY timestamp DESC
LIMIT ?;