summary refs log tree commit diff
path: root/synapse
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-10-16 16:58:00 +0100
committerErik Johnston <erik@matrix.org>2015-10-16 16:58:00 +0100
commit46d39343d976a933c3f2dfd19e5e552c01c93bf4 (patch)
treefe103e30bfca67ba8e98e126c06a1ad5276a0798 /synapse
parentTyping (diff)
downloadsynapse-46d39343d976a933c3f2dfd19e5e552c01c93bf4.tar.xz
Explicitly check for Sqlite3Engine
Diffstat (limited to 'synapse')
-rw-r--r--synapse/storage/room.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/synapse/storage/room.py b/synapse/storage/room.py
index 0527cee05d..13441fcdce 100644
--- a/synapse/storage/room.py
+++ b/synapse/storage/room.py
@@ -19,7 +19,7 @@ from synapse.api.errors import StoreError
 
 from ._base import SQLBaseStore
 from synapse.util.caches.descriptors import cachedInlineCallbacks
-from .engines import PostgresEngine
+from .engines import PostgresEngine, Sqlite3Engine
 
 import collections
 import logging
@@ -208,11 +208,14 @@ class RoomStore(SQLBaseStore):
                 "INSERT INTO event_search (event_id, room_id, key, vector)"
                 " VALUES (?,?,?,to_tsvector('english', ?))"
             )
-        else:
+        elif isinstance(self.database_engine, Sqlite3Engine):
             sql = (
                 "INSERT INTO event_search (event_id, room_id, key, value)"
                 " VALUES (?,?,?,?)"
             )
+        else:
+            # This should be unreachable.
+            raise Exception("Unrecognized database engine")
 
         txn.execute(sql, (event.event_id, event.room_id, key, value,))