summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorPaul "LeoNerd" Evans <paul@matrix.org>2015-03-11 17:08:57 +0000
committerPaul "LeoNerd" Evans <paul@matrix.org>2015-03-11 17:08:57 +0000
commit099e4b88d8053fbe5a661706a92a50e2c25f4dd6 (patch)
tree4b970847fae6525a9a77025fa412bb9773eb84d3 /synapse
parentAgain, underscore, not hyphen (diff)
downloadsynapse-099e4b88d8053fbe5a661706a92a50e2c25f4dd6.tar.xz
Add a description to storage layer's _execute_and_decode()
Diffstat (limited to 'synapse')
-rw-r--r--synapse/storage/__init__.py4
-rw-r--r--synapse/storage/_base.py3
-rw-r--r--synapse/storage/appservice.py2
-rw-r--r--synapse/storage/feedback.py2
-rw-r--r--synapse/storage/keys.py4
5 files changed, 9 insertions, 6 deletions
diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py
index 14a788c194..e3bf014d41 100644
--- a/synapse/storage/__init__.py
+++ b/synapse/storage/__init__.py
@@ -450,7 +450,7 @@ class DataStore(RoomMemberStore, RoomStore,
         else:
             args = (room_id, )
 
-        results = yield self._execute_and_decode(sql, *args)
+        results = yield self._execute_and_decode("get_current_state", sql, *args)
 
         events = yield self._parse_events(results)
         defer.returnValue(events)
@@ -475,7 +475,7 @@ class DataStore(RoomMemberStore, RoomStore,
         sql += " OR s.type = 'm.room.aliases')"
         args = (room_id,)
 
-        results = yield self._execute_and_decode(sql, *args)
+        results = yield self._execute_and_decode("get_current_state", sql, *args)
 
         events = yield self._parse_events(results)
 
diff --git a/synapse/storage/_base.py b/synapse/storage/_base.py
index 3725c9795d..a4e1d66e28 100644
--- a/synapse/storage/_base.py
+++ b/synapse/storage/_base.py
@@ -279,7 +279,8 @@ class SQLBaseStore(object):
 
         return self.runInteraction("_execute", interaction)
 
-    def _execute_and_decode(self, query, *args):
+    def _execute_and_decode(self, desc, query, *args):
+        # TODO: for now ignore desc
         return self._execute(self.cursor_to_dict, query, *args)
 
     # "Simple" SQL API methods that operate on a single table with no JOINs,
diff --git a/synapse/storage/appservice.py b/synapse/storage/appservice.py
index e30265750a..850676ce6c 100644
--- a/synapse/storage/appservice.py
+++ b/synapse/storage/appservice.py
@@ -296,7 +296,7 @@ class ApplicationServiceStore(SQLBaseStore):
         #   }
         # ]
         services = {}
-        results = yield self._execute_and_decode(sql)
+        results = yield self._execute_and_decode("_populate_cache", sql)
         for res in results:
             as_token = res["token"]
             if as_token not in services:
diff --git a/synapse/storage/feedback.py b/synapse/storage/feedback.py
index fcf011b234..8eab769b71 100644
--- a/synapse/storage/feedback.py
+++ b/synapse/storage/feedback.py
@@ -37,7 +37,7 @@ class FeedbackStore(SQLBaseStore):
             "WHERE feedback.target_event_id = ? "
         )
 
-        rows = yield self._execute_and_decode(sql, event_id)
+        rows = yield self._execute_and_decode("get_feedback_for_event", sql, event_id)
 
         defer.returnValue(
             [
diff --git a/synapse/storage/keys.py b/synapse/storage/keys.py
index 1f244019fc..153d5b4dd9 100644
--- a/synapse/storage/keys.py
+++ b/synapse/storage/keys.py
@@ -85,7 +85,9 @@ class KeyStore(SQLBaseStore):
             " AND key_id in (" + ",".join("?" for key_id in key_ids) + ")"
         )
 
-        rows = yield self._execute_and_decode(sql, server_name, *key_ids)
+        rows = yield self._execute_and_decode("get_server_verify_keys", sql,
+            server_name, *key_ids
+        )
 
         keys = []
         for row in rows: