Something went wrong. Try again.
(READ ONLY) Margin is an open annotation layer for the internet. Powered by the AT Protocol.
margin.at
extension web atproto comments
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233-- name: CreateLike :execINSERT INTO likes (uri, author_did, subject_uri, created_at, indexed_at)VALUES ($1, $2, $3, $4, $5)ON CONFLICT(uri) DO NOTHING;
-- name: DeleteLike :execDELETE FROM likes WHERE uri = $1;
-- name: GetLikesByAuthor :manySELECT uri, author_did, subject_uri, created_at, indexed_atFROM likesWHERE author_did = $1ORDER BY created_at DESC;
-- name: GetLikeCount :oneSELECT COUNT(*) FROM likes WHERE subject_uri = $1;
-- name: GetLikeByUserAndSubject :oneSELECT uri, author_did, subject_uri, created_at, indexed_atFROM likesWHERE author_did = $1 AND subject_uri = $2;
-- name: GetLikeCounts :manySELECT subject_uri, COUNT(*)FROM likesWHERE subject_uri = ANY($1::text[])GROUP BY subject_uri;
-- name: GetViewerLikes :manySELECT subject_uriFROM likesWHERE author_did = $1 AND subject_uri = ANY($2::text[]);