mirror of
https://github.com/memohai/Memoh.git
synced 2026-04-25 07:00:48 +09:00
bcda6f6fe6
- Replace all "Load More" / "Show More" buttons with Pagination components in model-list, bot-compaction, and bot-heartbeat views - Convert backend log APIs (compaction, heartbeat, schedule) from cursor-based (before+limit) to offset+limit pagination with total_count - Update SQL queries to use OFFSET+LIMIT and add COUNT queries - Add shared parseOffsetLimit helper in handler_helpers.go - Regenerate sqlc, Swagger docs, and TypeScript SDK - Clean up unused i18n keys (loadMore, showMore, history.loadMore)
29 lines
974 B
SQL
29 lines
974 B
SQL
-- name: CreateHeartbeatLog :one
|
|
INSERT INTO bot_heartbeat_logs (bot_id, session_id, started_at)
|
|
VALUES ($1, sqlc.narg(session_id)::uuid, now())
|
|
RETURNING id, bot_id, session_id, status, result_text, error_message, usage, started_at, completed_at;
|
|
|
|
-- name: CompleteHeartbeatLog :one
|
|
UPDATE bot_heartbeat_logs
|
|
SET status = $2,
|
|
result_text = $3,
|
|
error_message = $4,
|
|
usage = $5,
|
|
model_id = $6,
|
|
completed_at = now()
|
|
WHERE id = $1
|
|
RETURNING id, bot_id, session_id, status, result_text, error_message, usage, model_id, started_at, completed_at;
|
|
|
|
-- name: ListHeartbeatLogsByBot :many
|
|
SELECT id, bot_id, session_id, status, result_text, error_message, usage, started_at, completed_at
|
|
FROM bot_heartbeat_logs
|
|
WHERE bot_id = $1
|
|
ORDER BY started_at DESC
|
|
LIMIT $2 OFFSET $3;
|
|
|
|
-- name: CountHeartbeatLogsByBot :one
|
|
SELECT count(*) FROM bot_heartbeat_logs WHERE bot_id = $1;
|
|
|
|
-- name: DeleteHeartbeatLogsByBot :exec
|
|
DELETE FROM bot_heartbeat_logs WHERE bot_id = $1;
|