lockserver/db/queries/lock_code_slots.sql

9 lines
368 B
MySQL
Raw Normal View History

-- name: UpsertCodeSlot :exec
INSERT INTO lock_code_slots (lock, slot, code, enabled, name) VALUES (?, ?, ?, ?, "") ON CONFLICT (lock, slot) DO UPDATE SET code=excluded.code, enabled=excluded.enabled;
-- name: GetLockCodeBySlot :one
SELECT * FROM lock_code_slots WHERE lock = ? AND slot = ?;
-- name: GetLockCodes :many
SELECT * FROM lock_code_slots WHERE lock = ?;