summary refs log tree commit diff
path: root/synapse/storage/search.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2015-10-16 14:37:14 +0100
committerErik Johnston <erik@matrix.org>2015-10-16 14:37:14 +0100
commitedb998ba23cf74de624963f61ca9c897260a3e7e (patch)
tree0a8c9d46006b07b58ddf5682e7a49bf94d3c8dbe /synapse/storage/search.py
parentdocstring (diff)
downloadsynapse-edb998ba23cf74de624963f61ca9c897260a3e7e.tar.xz
Explicitly check for Sqlite3Engine
Diffstat (limited to '')
-rw-r--r--synapse/storage/search.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/synapse/storage/search.py b/synapse/storage/search.py
index 6c10f9631e..dd012fa565 100644
--- a/synapse/storage/search.py
+++ b/synapse/storage/search.py
@@ -16,7 +16,7 @@
 from twisted.internet import defer
 
 from _base import SQLBaseStore
-from synapse.storage.engines import PostgresEngine
+from synapse.storage.engines import PostgresEngine, Sqlite3Engine
 
 
 class SearchStore(SQLBaseStore):
@@ -56,11 +56,14 @@ class SearchStore(SQLBaseStore):
                 " FROM plainto_tsquery('english', ?) as query, event_search"
                 " WHERE vector @@ query"
             )
-        else:
+        elif isinstance(self.database_engine, Sqlite3Engine):
             sql = (
                 "SELECT 0 as rank, event_id FROM event_search"
                 " WHERE value MATCH ?"
             )
+        else:
+            # This should be unreachable.
+            raise Exception("Unrecognized database engine")
 
         for clause in clauses:
             sql += " AND " + clause