summary refs log tree commit diff
path: root/synapse/storage/engines
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-10-10 16:41:36 +0100
committerGitHub <noreply@github.com>2019-10-10 16:41:36 +0100
commit83d86106a8637dc1d9ffd44840c057b10aa87287 (patch)
treebc62be567a509f6a273b4f3ded979065ca8e5cbb /synapse/storage/engines
parentMerge pull request #6186 from matrix-org/erikj/disable_sql_bytes (diff)
parentFix SQLite take 2 (diff)
downloadsynapse-83d86106a8637dc1d9ffd44840c057b10aa87287.tar.xz
Merge pull request #6156 from matrix-org/erikj/postgres_any
Use Postgres ANY for selecting many values.
Diffstat (limited to 'synapse/storage/engines')
-rw-r--r--synapse/storage/engines/postgres.py6
-rw-r--r--synapse/storage/engines/sqlite.py6
2 files changed, 12 insertions, 0 deletions
diff --git a/synapse/storage/engines/postgres.py b/synapse/storage/engines/postgres.py
index d670286fa5..b7c4eda338 100644
--- a/synapse/storage/engines/postgres.py
+++ b/synapse/storage/engines/postgres.py
@@ -86,6 +86,12 @@ class PostgresEngine(object):
         """
         return True
 
+    @property
+    def supports_using_any_list(self):
+        """Do we support using `a = ANY(?)` and passing a list
+        """
+        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 ac92109366..ddad17dc5a 100644
--- a/synapse/storage/engines/sqlite.py
+++ b/synapse/storage/engines/sqlite.py
@@ -46,6 +46,12 @@ class Sqlite3Engine(object):
         """
         return self.module.sqlite_version_info >= (3, 15, 0)
 
+    @property
+    def supports_using_any_list(self):
+        """Do we support using `a = ANY(?)` and passing a list
+        """
+        return False
+
     def check_database(self, txn):
         pass