lockserver/db/queries/lock_code_slots.sql
Finn 054008eb1f Initial commit
Connects to zwave-js, syncs all locks and codeslots with database, and records an event log. No support for updating code slots.
2024-04-08 21:25:36 -07:00

8 lines
368 B
SQL

-- 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 = ?;