summary refs log tree commit diff
path: root/synapse/storage/__init__.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2019-10-23 16:14:16 +0100
committerErik Johnston <erik@matrix.org>2019-10-23 16:15:03 +0100
commit73cf63784b90ea194eb867aafe3f39203b7ae029 (patch)
treeba5c7913ffa9aef3a1e80d91a48a9f877e16f2ac /synapse/storage/__init__.py
parentMove persist_events out from main data store. (diff)
downloadsynapse-73cf63784b90ea194eb867aafe3f39203b7ae029.tar.xz
Add DataStores and Storage classes.
Diffstat (limited to 'synapse/storage/__init__.py')
-rw-r--r--synapse/storage/__init__.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py
index a249ecd219..a58187a76f 100644
--- a/synapse/storage/__init__.py
+++ b/synapse/storage/__init__.py
@@ -27,7 +27,24 @@ data stores associated with them (e.g. the schema version tables), which are
 stored in `synapse.storage.schema`.
 """
 
-from synapse.storage.data_stores.main import DataStore  # noqa: F401
+from synapse.storage.data_stores import DataStores
+from synapse.storage.data_stores.main import DataStore
+from synapse.storage.persist_events import EventsPersistenceStore
+
+__all__ = ["DataStores", "DataStore"]
+
+
+class Storage(object):
+    """The high level interfaces for talking to various storage layers.
+    """
+
+    def __init__(self, hs, stores: DataStores):
+        # We include the main data store here mainly so that we don't have to
+        # rewrite all the existing code to split it into high vs low level
+        # interfaces.
+        self.main = stores.main
+
+        self.persistence = EventsPersistenceStore(hs, stores)
 
 
 def are_all_users_on_domain(txn, database_engine, domain):