mirror of
https://mau.dev/maunium/synapse.git
synced 2024-10-01 01:36:05 -04:00
Explicitly check for Sqlite3Engine
This commit is contained in:
parent
f2d698cb52
commit
46d39343d9
@ -19,7 +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
|
from .engines import PostgresEngine, Sqlite3Engine
|
||||||
|
|
||||||
import collections
|
import collections
|
||||||
import logging
|
import logging
|
||||||
@ -208,11 +208,14 @@ class RoomStore(SQLBaseStore):
|
|||||||
"INSERT INTO event_search (event_id, room_id, key, vector)"
|
"INSERT INTO event_search (event_id, room_id, key, vector)"
|
||||||
" VALUES (?,?,?,to_tsvector('english', ?))"
|
" VALUES (?,?,?,to_tsvector('english', ?))"
|
||||||
)
|
)
|
||||||
else:
|
elif isinstance(self.database_engine, Sqlite3Engine):
|
||||||
sql = (
|
sql = (
|
||||||
"INSERT INTO event_search (event_id, room_id, key, value)"
|
"INSERT INTO event_search (event_id, room_id, key, value)"
|
||||||
" VALUES (?,?,?,?)"
|
" VALUES (?,?,?,?)"
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
# This should be unreachable.
|
||||||
|
raise Exception("Unrecognized database engine")
|
||||||
|
|
||||||
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