summary refs log tree commit diff
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2018-05-08 10:11:45 +0100
committerErik Johnston <erik@matrix.org>2018-05-08 13:48:45 +0100
commit790328a93cba3e2fd415ba1a33384e9136719055 (patch)
treea5eacf145ecb81871168412855a57bc419301107
parentMerge pull request #3007 from matrix-org/rav/warn_on_logcontext_fail (diff)
downloadsynapse-erikj/sqlite_min_version.tar.xz
Require SQLite3 version 3.15 or above github/erikj/sqlite_min_version erikj/sqlite_min_version
This is primarily to allow tuple comparisons in queries, though a better
query optimiser and other improvements mean that using newer versions of
sqlite is highly recommended anyway.
-rw-r--r--synapse/storage/engines/__init__.py2
-rw-r--r--synapse/storage/engines/sqlite3_engine.py (renamed from synapse/storage/engines/sqlite3.py)6
2 files changed, 7 insertions, 1 deletions
diff --git a/synapse/storage/engines/__init__.py b/synapse/storage/engines/__init__.py
index 8c868ece75..dab042bce0 100644
--- a/synapse/storage/engines/__init__.py
+++ b/synapse/storage/engines/__init__.py
@@ -15,7 +15,7 @@
 
 from ._base import IncorrectDatabaseSetup
 from .postgres import PostgresEngine
-from .sqlite3 import Sqlite3Engine
+from .sqlite3_engine import Sqlite3Engine
 
 import importlib
 import platform
diff --git a/synapse/storage/engines/sqlite3.py b/synapse/storage/engines/sqlite3_engine.py
index 60f0fa7fb3..f359874581 100644
--- a/synapse/storage/engines/sqlite3.py
+++ b/synapse/storage/engines/sqlite3_engine.py
@@ -15,6 +15,7 @@
 
 from synapse.storage.prepare_database import prepare_database
 
+import sqlite3
 import struct
 import threading
 
@@ -25,6 +26,11 @@ class Sqlite3Engine(object):
     def __init__(self, database_module, database_config):
         self.module = database_module
 
+        if sqlite3.sqlite_version_info < (3, 15, 0):
+            raise RuntimeError(
+                "SQLite3 version is too old, Synapse requires 3.15 or later",
+            )
+
         # The current max state_group, or None if we haven't looked
         # in the DB yet.
         self._current_state_group_id = None