summaryrefslogtreecommitdiffhomepage
path: root/internal/db/sql/logs.sql
diff options
context:
space:
mode:
Diffstat (limited to 'internal/db/sql/logs.sql')
-rw-r--r--internal/db/sql/logs.sql28
1 files changed, 28 insertions, 0 deletions
diff --git a/internal/db/sql/logs.sql b/internal/db/sql/logs.sql
new file mode 100644
index 000000000..1a0655f7e
--- /dev/null
+++ b/internal/db/sql/logs.sql
@@ -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 ?; \ No newline at end of file