mirror of
https://github.com/anomalyco/opencode.git
synced 2026-05-02 14:30:29 +00:00
wip: logging improvements
This commit is contained in:
parent
f41b7bbd0a
commit
f100777199
41 changed files with 848 additions and 438 deletions
28
internal/db/sql/logs.sql
Normal file
28
internal/db/sql/logs.sql
Normal file
|
|
@ -0,0 +1,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 ?;
|
||||
Loading…
Add table
Add a link
Reference in a new issue