-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
864ba66
commit 62f3276
Showing
8 changed files
with
242 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
-- name: CreateRecentPostLabel :exec | ||
INSERT INTO recent_post_labels(actor_did, rkey, label) | ||
VALUES ($1, $2, $3); | ||
-- name: DeleteRecentPostLabel :exec | ||
DELETE FROM recent_post_labels | ||
WHERE actor_did = $1 | ||
AND rkey = $2 | ||
AND label = $3; | ||
-- name: ListRecentPostLabels :many | ||
SELECT label | ||
FROM recent_post_labels | ||
WHERE actor_did = $1 | ||
AND rkey = $2 | ||
ORDER BY label ASC; | ||
-- name: ListRecentPostsByLabelHot :many | ||
SELECT l.actor_did, | ||
l.rkey | ||
FROM recent_post_labels l | ||
JOIN recent_posts_with_score rp ON l.actor_did = rp.actor_did | ||
AND l.rkey = rp.rkey | ||
WHERE label = $1 | ||
AND score < coalesce(sqlc.narg('score')::float, 100000) | ||
ORDER BY score DESC | ||
LIMIT $2; | ||
-- name: TrimRecentPostLabels :exec | ||
DELETE FROM recent_post_labels | ||
WHERE rkey < $1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.