lockserver/db/queries/lock_log.sql

12 lines
413 B
MySQL
Raw Normal View History

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