Data Schema & Mappings
Otso keeps the storage model deliberately small. All items are stored as events with normalized content and optional media references.
Minimal schemas
Section titled “Minimal schemas”Table | Key fields | Purpose |
---|---|---|
events | id , kind , source , created_at , content | Append‑only log of everything Otso learns or does. |
media | id , event_id , url , alt | References to local or remote media assets. |
tags | event_id , name | Free‑form tagging for search and organization. |
Mapping examples
Section titled “Mapping examples”GitHub
Section titled “GitHub”commit
→entry
withcontent.text
,url
, andauthor
.issue
/discussion
→entry
with labels mapped to tags.
Mastodon
Section titled “Mastodon”status
→note
with HTML content, media attachments and visibility flag.
Bluesky
Section titled “Bluesky”post
→note
with AT URI asexternal_id
and facets mapped to tags.
Query snippets
Section titled “Query snippets”List the latest public notes:
SELECT content->>'text', created_atFROM eventsWHERE kind = 'note' AND visibility = 'public'ORDER BY created_at DESCLIMIT 20;
Fetch media for a given event:
SELECT m.url, m.altFROM media mJOIN events e ON m.event_id = e.idWHERE e.id = $1;