2024-04-09 04:25:36 +00:00
|
|
|
-- 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
|
2024-11-25 00:36:18 +00:00
|
|
|
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;
|