From cb51739f892aa1371bac78c56c81842adffb78d8 Mon Sep 17 00:00:00 2001 From: Kegan Dougal <7190048+kegsay@users.noreply.github.com> Date: Fri, 11 Oct 2024 14:20:35 +0100 Subject: [PATCH] Update README.md --- README.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/README.md b/README.md index 9eca3b0..e41387f 100644 --- a/README.md +++ b/README.md @@ -25,3 +25,19 @@ yarn run start ``` Then provide a new-line delimited JSON file which contains events to render in the full federation format (with `prev_events`, etc). +To get such a file _for Synapse installations on Postgres_, run the following (assuming `matrix` is the name of your DB): +``` +$ psql matrix +matrix=> \t +Tuples only is on. +matrix=> \o the-file.ndjson +matrix=> select jsonb_insert(json::JSONB, '{event_id}', ('"' || event_id || '"')::JSONB) from event_json where event_id in + (select event_id from events where + room_id='!THE_ROOM_ID' and + stream_ordering < (select stream_ordering from events where event_id='$LATEST_EVENT_ID') and + stream_ordering > (select stream_ordering from events where event_id='$EARLIEST_EVENT_ID') + order by stream_ordering asc + ); +``` +You can drop the `stream_ordering` clauses if the room is small and you want to see the entire thing. The file created by these +commands can be dropped **as-is** into TARDIS.