Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
kegsay authored Oct 11, 2024
1 parent bbc96c3 commit cb51739
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

0 comments on commit cb51739

Please sign in to comment.