Skip to content
Snippets Groups Projects
Commit 99c7fbfe authored by Erik Johnston's avatar Erik Johnston
Browse files

Fix to work with SQLite

parent 1d9e1098
No related branches found
No related tags found
No related merge requests found
......@@ -19,6 +19,7 @@ from synapse.api.errors import StoreError
from ._base import SQLBaseStore
from synapse.util.caches.descriptors import cachedInlineCallbacks
from .engines import PostgresEngine
import collections
import logging
......@@ -202,10 +203,16 @@ class RoomStore(SQLBaseStore):
)
def _store_event_search_txn(self, txn, event, key, value):
sql = (
"INSERT INTO event_search (event_id, room_id, key, vector)"
" VALUES (?,?,?,to_tsvector('english', ?))"
)
if isinstance(self.database_engine, PostgresEngine):
sql = (
"INSERT INTO event_search (event_id, room_id, key, vector)"
" VALUES (?,?,?,to_tsvector('english', ?))"
)
else:
sql = (
"INSERT INTO event_search (event_id, room_id, key, value)"
" VALUES (?,?,?,?)"
)
txn.execute(sql, (event.event_id, event.room_id, key, value,))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment