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.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121-- name: CreateBlock :execINSERT INTO blocks (actor_did, subject_did, created_at) VALUES ($1, $2, $3)ON CONFLICT(actor_did, subject_did) DO NOTHING;
-- name: DeleteBlock :execDELETE FROM blocks WHERE actor_did = $1 AND subject_did = $2;
-- name: GetBlocks :manySELECT id, actor_did, subject_did, created_at FROM blocks WHERE actor_did = $1 ORDER BY created_at DESC;
-- name: IsBlocked :oneSELECT EXISTS(SELECT 1 FROM blocks WHERE actor_did = $1 AND subject_did = $2);
-- name: IsBlockedEither :oneSELECT EXISTS(SELECT 1 FROM blocks WHERE (actor_did = $1 AND subject_did = $2) OR (actor_did = $2 AND subject_did = $1));
-- name: GetBlockedDIDs :manySELECT subject_did FROM blocks WHERE actor_did = $1;
-- name: GetBlockedByDIDs :manySELECT actor_did FROM blocks WHERE subject_did = $1;
-- name: CreateMute :execINSERT INTO mutes (actor_did, subject_did, created_at) VALUES ($1, $2, $3)ON CONFLICT(actor_did, subject_did) DO NOTHING;
-- name: DeleteMute :execDELETE FROM mutes WHERE actor_did = $1 AND subject_did = $2;
-- name: GetMutes :manySELECT id, actor_did, subject_did, created_at FROM mutes WHERE actor_did = $1 ORDER BY created_at DESC;
-- name: IsMuted :oneSELECT EXISTS(SELECT 1 FROM mutes WHERE actor_did = $1 AND subject_did = $2);
-- name: GetMutedDIDs :manySELECT subject_did FROM mutes WHERE actor_did = $1;
-- name: CreateReport :oneINSERT INTO moderation_reports (reporter_did, subject_did, subject_uri, reason_type, reason_text, status, created_at)VALUES ($1, $2, $3, $4, $5, 'pending', $6)RETURNING id;
-- name: GetReports :manySELECT id, reporter_did, subject_did, subject_uri, reason_type, reason_text, status, created_at, resolved_at, resolved_byFROM moderation_reportsORDER BY created_at DESC LIMIT $1 OFFSET $2;
-- name: GetReportsByStatus :manySELECT id, reporter_did, subject_did, subject_uri, reason_type, reason_text, status, created_at, resolved_at, resolved_byFROM moderation_reportsWHERE status = $1ORDER BY created_at DESC LIMIT $2 OFFSET $3;
-- name: GetReport :oneSELECT id, reporter_did, subject_did, subject_uri, reason_type, reason_text, status, created_at, resolved_at, resolved_by FROM moderation_reports WHERE id = $1;
-- name: ResolveReport :execUPDATE moderation_reports SET status = $1, resolved_at = $2, resolved_by = $3 WHERE id = $4;
-- name: CreateModerationAction :execINSERT INTO moderation_actions (report_id, actor_did, action, comment, created_at) VALUES ($1, $2, $3, $4, $5);
-- name: GetReportActions :manySELECT id, report_id, actor_did, action, comment, created_at FROM moderation_actions WHERE report_id = $1 ORDER BY created_at DESC;
-- name: GetReportCount :oneSELECT COUNT(*) FROM moderation_reports;
-- name: GetReportCountByStatus :oneSELECT COUNT(*) FROM moderation_reports WHERE status = $1;
-- name: CreateContentLabel :execINSERT INTO content_labels (src, uri, val, neg, created_by, created_at) VALUES ($1, $2, $3, 0, $4, $5);
-- name: DeleteSelfLabels :execDELETE FROM content_labels WHERE src = $1 AND uri = $2 AND created_by = $3;
-- name: NegateContentLabel :execUPDATE content_labels SET neg = 1 WHERE id = $1;
-- name: DeleteContentLabel :execDELETE FROM content_labels WHERE id = $1;
-- name: GetContentLabelsForURIs :manySELECT id, src, uri, val, neg, created_by, created_at FROM content_labelsWHERE uri = ANY($1::text[]) AND neg = 0ORDER BY created_at DESC;
-- name: GetContentLabelsForURIsBySrc :manySELECT id, src, uri, val, neg, created_by, created_at FROM content_labelsWHERE uri = ANY($1::text[]) AND neg = 0 AND src = ANY($2::text[])ORDER BY created_at DESC;
-- name: GetAllContentLabels :manySELECT id, src, uri, val, neg, created_by, created_at FROM content_labels ORDER BY created_at DESC LIMIT $1 OFFSET $2;
-- name: MarkTakenDown :execINSERT INTO taken_down_uris (uri, taken_down_at) VALUES ($1, $2)ON CONFLICT(uri) DO NOTHING;
-- name: IsTakenDown :oneSELECT EXISTS(SELECT 1 FROM taken_down_uris WHERE uri = $1);
-- name: BanAccount :execINSERT INTO banned_accounts (did, reason, banned_by, banned_at)VALUES ($1, $2, $3, $4)ON CONFLICT(did) DO UPDATE SET reason = EXCLUDED.reason, banned_by = EXCLUDED.banned_by, banned_at = EXCLUDED.banned_at;
-- name: UnbanAccount :execDELETE FROM banned_accounts WHERE did = $1;
-- name: IsBanned :oneSELECT EXISTS(SELECT 1 FROM banned_accounts WHERE did = $1);
-- name: GetBannedAccounts :manySELECT did, reason, banned_by, banned_at FROM banned_accounts ORDER BY banned_at DESC;
-- name: GetBannedDIDs :manySELECT did FROM banned_accounts;