docs: query comments say what each query selects and why, not how it came to be (#6277)
Rewrites the internal/db/queries comments to rule 32 and regenerates dbq, whose doc comments and embedded SQL carry them. The bugs behind the tiered mixes, the md5 order seed, the score bands and the round-robin arms are restated as the constraint each one enforces; counts from one library and stale cross-references are gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -41,7 +41,8 @@ DELETE FROM sessions WHERE id = $1;
|
||||
DELETE FROM sessions WHERE token_hash = $1;
|
||||
|
||||
-- name: DeleteSessionForUser :execrows
|
||||
-- Scoped by user_id, not just id (rule #47). Keyed on the id alone, any
|
||||
-- Scoped by user_id, not just id: household data is per-user. Keyed on the
|
||||
-- id alone, any
|
||||
-- household member could revoke another member's session by guessing a uuid.
|
||||
-- execrows lets the handler answer 404 rather than a false 204 when the row
|
||||
-- isn't theirs.
|
||||
|
||||
Reference in New Issue
Block a user