lockserver/db/queries/lock_log.sql
Finn 4627ae91b3
All checks were successful
/ build-container (push) Successful in 8m0s
add readme and limit log entry counts displayed
2024-11-24 16:36:18 -08:00

11 lines
413 B
SQL

-- name: AddLogEntry :exec
INSERT INTO lock_log (lock, state, code) VALUES (?, ?, ?);
-- name: GetLogForLock :many
SELECT * FROM lock_log WHERE lock = ? ORDER BY timestamp DESC;
-- name: GetLogForSlot :many
SELECT * FROM lock_log WHERE lock = ? AND code = ? ORDER BY timestamp DESC LIMIT 100;
-- name: GetLastLogForSlot :many
SELECT * FROM lock_log WHERE lock = ? AND code = ? ORDER BY timestamp DESC LIMIT 1;