Something went wrong. Try again.
(READ ONLY) Margin is an open annotation layer for the internet. Powered by the AT Protocol.
margin.at
Something went wrong. Try again.
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455-- name: GetProfile :oneSELECT uri, author_did, display_name, avatar, bio, website, links_json, created_at, indexed_atFROM profiles WHERE author_did = $1;
-- name: GetProfilesByDIDs :manySELECT uri, author_did, display_name, bio, avatar, website, links_json, created_at, indexed_atFROM profiles WHERE author_did = ANY($1::text[]);
-- name: UpsertProfile :execINSERT INTO profiles (uri, author_did, display_name, avatar, bio, website, links_json, created_at, indexed_at)VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9)ON CONFLICT(uri) DO UPDATE SET display_name = EXCLUDED.display_name, avatar = EXCLUDED.avatar, bio = EXCLUDED.bio, website = EXCLUDED.website, links_json = EXCLUDED.links_json, indexed_at = EXCLUDED.indexed_at;
-- name: DeleteProfile :execDELETE FROM profiles WHERE uri = $1;
-- name: GetPreferences :oneSELECT uri, author_did, external_link_skipped_hostnames, subscribed_labelers, label_preferences, disable_external_link_warning, enable_community_bookmarks, created_at, indexed_at, cidFROM preferences WHERE author_did = $1;
-- name: UpsertPreferences :execINSERT INTO preferences ( uri, author_did, external_link_skipped_hostnames, subscribed_labelers, label_preferences, disable_external_link_warning, enable_community_bookmarks, created_at, indexed_at, cid) VALUES ($1, $2, $3, $4, $5, $6, $7, $8, $9, $10)ON CONFLICT(uri) DO UPDATE SET external_link_skipped_hostnames = EXCLUDED.external_link_skipped_hostnames, subscribed_labelers = EXCLUDED.subscribed_labelers, label_preferences = EXCLUDED.label_preferences, disable_external_link_warning = EXCLUDED.disable_external_link_warning, enable_community_bookmarks = EXCLUDED.enable_community_bookmarks, indexed_at = EXCLUDED.indexed_at, cid = EXCLUDED.cid;
-- name: DeletePreferences :execDELETE FROM preferences WHERE uri = $1;
-- name: GetPreferenceURIs :manySELECT uri FROM preferences WHERE author_did = $1 AND uri IS NOT NULL AND uri != '';
-- name: DeleteAPIKeyByURI :execDELETE FROM api_keys WHERE uri = $1;
-- name: GetAPIKeyURIs :manySELECT uri FROM api_keys WHERE owner_did = $1 AND uri IS NOT NULL AND uri != '';