diff options
author | Erik Johnston <erik@matrix.org> | 2015-10-16 14:37:14 +0100 |
---|---|---|
committer | Erik Johnston <erik@matrix.org> | 2015-10-16 14:37:14 +0100 |
commit | edb998ba23cf74de624963f61ca9c897260a3e7e (patch) | |
tree | 0a8c9d46006b07b58ddf5682e7a49bf94d3c8dbe /synapse/storage | |
parent | docstring (diff) | |
download | synapse-edb998ba23cf74de624963f61ca9c897260a3e7e.tar.xz |
Explicitly check for Sqlite3Engine
Diffstat (limited to 'synapse/storage')
-rw-r--r-- | synapse/storage/search.py | 7 |
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 |