Store full JSON of events in db

This commit is contained in:
Erik Johnston 2014-12-01 16:21:17 +00:00
parent dbc98c4e43
commit ec2b5d8c28
3 changed files with 49 additions and 55 deletions

View file

@ -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,