summary refs log tree commit diff
path: root/synapse/storage/engines
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-09-30 11:58:36 +0100
committerErik Johnston <erik@matrix.org>2019-09-30 11:58:36 +0100
commit9267741a5f7732d7d16f8445edc68bc68b730601 (patch)
tree20d0d9defa96de6dc567aab3f2aff67b3058e41d /synapse/storage/engines
parentMerge pull request #6117 from matrix-org/erikj/fix_sample_config (diff)
downloadsynapse-9267741a5f7732d7d16f8445edc68bc68b730601.tar.xz
Fix `devices_last_seen` background update.
Fixes #6134.
Diffstat (limited to 'synapse/storage/engines')
-rw-r--r--synapse/storage/engines/postgres.py7
-rw-r--r--synapse/storage/engines/sqlite.py8
2 files changed, 15 insertions, 0 deletions
diff --git a/synapse/storage/engines/postgres.py b/synapse/storage/engines/postgres.py
index 289b6bc281..601617b21e 100644
--- a/synapse/storage/engines/postgres.py
+++ b/synapse/storage/engines/postgres.py
@@ -72,6 +72,13 @@ class PostgresEngine(object):
         """
         return True
 
+    @property
+    def supports_tuple_comparison(self):
+        """
+        Do we support comparing tuples, i.e. `(a, b) > (c, d)`?
+        """
+        return True
+
     def is_deadlock(self, error):
         if isinstance(error, self.module.DatabaseError):
             # https://www.postgresql.org/docs/current/static/errcodes-appendix.html
diff --git a/synapse/storage/engines/sqlite.py b/synapse/storage/engines/sqlite.py
index e9b9caa49a..ac92109366 100644
--- a/synapse/storage/engines/sqlite.py
+++ b/synapse/storage/engines/sqlite.py
@@ -38,6 +38,14 @@ class Sqlite3Engine(object):
         """
         return self.module.sqlite_version_info >= (3, 24, 0)
 
+    @property
+    def supports_tuple_comparison(self):
+        """
+        Do we support comparing tuples, i.e. `(a, b) > (c, d)`? This requires
+        SQLite 3.15+.
+        """
+        return self.module.sqlite_version_info >= (3, 15, 0)
+
     def check_database(self, txn):
         pass