add initial stuff

This commit is contained in:
Kujtim Hoxha
2025-03-23 19:19:08 +01:00
parent 796bbf4d66
commit 8daa6e774a
36 changed files with 1779 additions and 143 deletions

View File

@@ -0,0 +1,43 @@
-- sqlfluff:dialect:sqlite
-- name: CreateSession :one
INSERT INTO sessions (
id,
title,
message_count,
tokens,
cost,
updated_at,
created_at
) VALUES (
?,
?,
?,
?,
?,
strftime('%s', 'now'),
strftime('%s', 'now')
) RETURNING *;
-- name: GetSessionByID :one
SELECT *
FROM sessions
WHERE id = ? LIMIT 1;
-- name: ListSessions :many
SELECT *
FROM sessions
ORDER BY created_at DESC;
-- name: UpdateSession :one
UPDATE sessions
SET
title = ?,
tokens = ?,
cost = ?
WHERE id = ?
RETURNING *;
-- name: DeleteSession :exec
DELETE FROM sessions
WHERE id = ?;