mirror of
https://mau.dev/maunium/synapse.git
synced 2024-08-23 10:45:48 +00:00
Fix to work with SQLite
This commit is contained in:
parent
1d9e109820
commit
99c7fbfef7
@ -19,6 +19,7 @@ from synapse.api.errors import StoreError
|
|||||||
|
|
||||||
from ._base import SQLBaseStore
|
from ._base import SQLBaseStore
|
||||||
from synapse.util.caches.descriptors import cachedInlineCallbacks
|
from synapse.util.caches.descriptors import cachedInlineCallbacks
|
||||||
|
from .engines import PostgresEngine
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
import logging
|
import logging
|
||||||
@ -202,10 +203,16 @@ class RoomStore(SQLBaseStore):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def _store_event_search_txn(self, txn, event, key, value):
|
def _store_event_search_txn(self, txn, event, key, value):
|
||||||
sql = (
|
if isinstance(self.database_engine, PostgresEngine):
|
||||||
"INSERT INTO event_search (event_id, room_id, key, vector)"
|
sql = (
|
||||||
" VALUES (?,?,?,to_tsvector('english', ?))"
|
"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,))
|
txn.execute(sql, (event.event_id, event.room_id, key, value,))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user