mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-03 14:34:47 -04:00
Require SQLite >= 3.27.0 (#13760)
This commit is contained in:
parent
69fa29700e
commit
f2d2481e56
9 changed files with 103 additions and 205 deletions
|
@ -48,14 +48,6 @@ class Sqlite3Engine(BaseDatabaseEngine[sqlite3.Connection]):
|
|||
def single_threaded(self) -> bool:
|
||||
return True
|
||||
|
||||
@property
|
||||
def can_native_upsert(self) -> bool:
|
||||
"""
|
||||
Do we support native UPSERTs? This requires SQLite3 3.24+, plus some
|
||||
more work we haven't done yet to tell what was inserted vs updated.
|
||||
"""
|
||||
return sqlite3.sqlite_version_info >= (3, 24, 0)
|
||||
|
||||
@property
|
||||
def supports_using_any_list(self) -> bool:
|
||||
"""Do we support using `a = ANY(?)` and passing a list"""
|
||||
|
@ -70,12 +62,11 @@ class Sqlite3Engine(BaseDatabaseEngine[sqlite3.Connection]):
|
|||
self, db_conn: sqlite3.Connection, allow_outdated_version: bool = False
|
||||
) -> None:
|
||||
if not allow_outdated_version:
|
||||
version = sqlite3.sqlite_version_info
|
||||
# Synapse is untested against older SQLite versions, and we don't want
|
||||
# to let users upgrade to a version of Synapse with broken support for their
|
||||
# sqlite version, because it risks leaving them with a half-upgraded db.
|
||||
if version < (3, 22, 0):
|
||||
raise RuntimeError("Synapse requires sqlite 3.22 or above.")
|
||||
if sqlite3.sqlite_version_info < (3, 27, 0):
|
||||
raise RuntimeError("Synapse requires sqlite 3.27 or above.")
|
||||
|
||||
def check_new_database(self, txn: Cursor) -> None:
|
||||
"""Gets called when setting up a brand new database. This allows us to
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue