diff options
author | Erik Johnston <erik@matrix.org> | 2019-10-30 14:58:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-30 14:58:44 +0100 |
commit | b7fe62b7660eb5836878d888937bcb327659cfd2 (patch) | |
tree | 5e0beaa14d2e9abc82116a7a07740abf2508177b /synapse/storage/__init__.py | |
parent | Merge pull request #6291 from matrix-org/erikj/fix_cache_descriptor (diff) | |
parent | Merge branch 'develop' of github.com:matrix-org/synapse into erikj/split_out_... (diff) | |
download | synapse-b7fe62b7660eb5836878d888937bcb327659cfd2.tar.xz |
Merge pull request #6240 from matrix-org/erikj/split_out_persistence_store
Move persist_events out from main data store.
Diffstat (limited to 'synapse/storage/__init__.py')
-rw-r--r-- | synapse/storage/__init__.py | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py index a249ecd219..a6429d17ed 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 EventsPersistenceStorage + +__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 = EventsPersistenceStorage(hs, stores) def are_all_users_on_domain(txn, database_engine, domain): |