From f1007771997bd0401516eda87a7e0ac92f269680 Mon Sep 17 00:00:00 2001
From: adamdottv <2363879+adamdottv@users.noreply.github.com>
Date: Fri, 9 May 2025 13:37:13 -0500
Subject: wip: logging improvements

---
 internal/db/sql/logs.sql | 28 ++++++++++++++++++++++++++++
 1 file changed, 28 insertions(+)
 create mode 100644 internal/db/sql/logs.sql

(limited to 'internal/db/sql/logs.sql')

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
-- 
cgit v1.2.3

