Skip to content

Instantly share code, notes, and snippets.

@anonfloppa
Created July 22, 2022 16:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonfloppa/459948579fb049830081d9ae0b302566 to your computer and use it in GitHub Desktop.
Save anonfloppa/459948579fb049830081d9ae0b302566 to your computer and use it in GitHub Desktop.
A query to list all uploaded media to a room in particular
select
event_json.json::json->'content'->>'body' as filename,
event_json.json::json->'content'->>'url' as url
from events
left outer join event_json on
events.event_id=event_json.event_id
left outer join room_stats_state on
room_stats_state.room_id=events.room_id
where event_json.json::json->'content'->>'url'<>'' and events.room_id='ROOM ID' limit 1000;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment