mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 21:44:52 -04:00
Store full JSON of events in db
This commit is contained in:
parent
dbc98c4e43
commit
ec2b5d8c28
3 changed files with 49 additions and 55 deletions
|
@ -155,6 +155,25 @@ class DataStore(RoomMemberStore, RoomStore,
|
|||
if hasattr(event, "outlier"):
|
||||
outlier = event.outlier
|
||||
|
||||
event_dict = {
|
||||
k: v
|
||||
for k, v in event.get_full_dict().items()
|
||||
if k not in [
|
||||
"redacted",
|
||||
"redacted_because",
|
||||
]
|
||||
}
|
||||
|
||||
self._simple_insert_txn(
|
||||
txn,
|
||||
table="event_json",
|
||||
values={
|
||||
"event_id": event.event_id,
|
||||
"json": json.dumps(event_dict, separators=(',', ':')),
|
||||
},
|
||||
or_replace=True,
|
||||
)
|
||||
|
||||
vals = {
|
||||
"topological_ordering": event.depth,
|
||||
"event_id": event.event_id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue