cloudaxe-opencode/internal/db/sql/logs.sql

27 lines
367 B
MySQL
Raw Normal View History

2025-05-13 15:27:09 +00:00
-- name: CreateLog :one
2025-05-09 18:37:13 +00:00
INSERT INTO logs (
id,
session_id,
timestamp,
level,
message,
2025-05-13 18:08:43 +00:00
attributes
2025-05-09 18:37:13 +00:00
) VALUES (
?,
?,
?,
?,
?,
?
2025-05-13 15:27:09 +00:00
) RETURNING *;
2025-05-09 18:37:13 +00:00
-- name: ListLogsBySession :many
SELECT * FROM logs
WHERE session_id = ?
2025-05-14 18:06:09 +00:00
ORDER BY timestamp DESC;
2025-05-09 18:37:13 +00:00
-- name: ListAllLogs :many
SELECT * FROM logs
ORDER BY timestamp DESC
2025-05-13 15:27:09 +00:00
LIMIT ?;