summary refs log tree commit diff
path: root/synapse/storage/state.py
diff options
context:
space:
mode:
authorMark Haines <mjark@negativecurvature.net>2015-05-05 18:30:35 +0100
committerMark Haines <mjark@negativecurvature.net>2015-05-05 18:30:35 +0100
commitecb26beda5582df286d5d21a91013b9cdb730e07 (patch)
treeadffd54138cb4d537edb45f2d715e26a391edb76 /synapse/storage/state.py
parentUse buffer(...) when inserting into bytea column (diff)
parentAnd use buffer(...) there as well (diff)
downloadsynapse-ecb26beda5582df286d5d21a91013b9cdb730e07.tar.xz
Merge pull request #137 from matrix-org/erikj/executemany
executemany support
Diffstat (limited to 'synapse/storage/state.py')
-rw-r--r--synapse/storage/state.py16
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,