Distinguish auth/lookup failures, make votes idempotent on visible questions, bound shutdown, page admin users, LRU throttle, trusted-proxy CIDRs, avatar cleanup, versioned migrations, and session cleanup logging.
19 lines
418 B
SQL
19 lines
418 B
SQL
-- name: GetSession :one
|
|
SELECT data
|
|
FROM sessions
|
|
WHERE token = $1 AND expiry > now();
|
|
|
|
-- name: UpsertSession :exec
|
|
INSERT INTO sessions (token, data, expiry)
|
|
VALUES ($1, $2, $3)
|
|
ON CONFLICT (token) DO UPDATE
|
|
SET data = excluded.data, expiry = excluded.expiry;
|
|
|
|
-- name: DeleteSession :exec
|
|
DELETE FROM sessions
|
|
WHERE token = $1;
|
|
|
|
-- name: DeleteExpiredSessions :execrows
|
|
DELETE FROM sessions
|
|
WHERE expiry <= now();
|