Address production-readiness review: clearer errors, safer votes, and ops hardening.
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.
This commit is contained in:
+11
-1
@@ -15,7 +15,17 @@ WHERE username = $1;
|
||||
-- name: ListUsers :many
|
||||
SELECT id, username, name, role, avatar_url, state, created_at
|
||||
FROM users
|
||||
ORDER BY created_at ASC
|
||||
WHERE (
|
||||
sqlc.arg(search) = ''
|
||||
OR username ILIKE '%' || sqlc.arg(search) || '%'
|
||||
OR name ILIKE '%' || sqlc.arg(search) || '%'
|
||||
)
|
||||
AND (
|
||||
sqlc.arg(cursor_created) = ''
|
||||
OR created_at < sqlc.arg(cursor_created)
|
||||
OR (created_at = sqlc.arg(cursor_created) AND id < sqlc.arg(cursor_id))
|
||||
)
|
||||
ORDER BY created_at DESC, id DESC
|
||||
LIMIT sqlc.arg(row_limit);
|
||||
|
||||
-- name: CountAdmins :one
|
||||
|
||||
Reference in New Issue
Block a user