diff options
author | Erik Johnston <erik@matrix.org> | 2015-05-05 15:13:25 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-05-05 15:13:25 +0100 |
commit | 43c2e8deae5f7e2b339ab5c131391231886cad09 (patch) | |
tree | ff147eb249c9a77d151fdf552af8850a116ff4af /synapse/storage/state.py | |
parent | Don't call 'encode_parameter' no-op (diff) | |
download | synapse-43c2e8deae5f7e2b339ab5c131391231886cad09.tar.xz |
Add support for using executemany
Diffstat (limited to 'synapse/storage/state.py')
-rw-r--r-- | synapse/storage/state.py | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/synapse/storage/state.py b/synapse/storage/state.py index 7e55e8bed6..dbc0e49c1f 100644 --- a/synapse/storage/state.py +++ b/synapse/storage/state.py @@ -104,18 +104,20 @@ class StateStore(SQLBaseStore): }, ) - for state in state_events.values(): - self._simple_insert_txn( - txn, - table="state_groups_state", - values={ + self._simple_insert_many_txn( + txn, + table="state_groups_state", + values=[ + { "state_group": state_group, "room_id": state.room_id, "type": state.type, "state_key": state.state_key, "event_id": state.event_id, - }, - ) + } + for state in state_events.values() + ], + ) self._simple_insert_txn( txn, |