mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 08:26:01 -04:00
Add database config class (#6513)
This encapsulates config for a given database and is the way to get new connections.
This commit is contained in:
parent
91ccfe9f37
commit
2284eb3a53
19 changed files with 286 additions and 208 deletions
|
@ -26,7 +26,6 @@ from synapse.config.homeserver import HomeServerConfig
|
|||
from synapse.metrics.background_process_metrics import run_as_background_process
|
||||
from synapse.server import HomeServer
|
||||
from synapse.storage import DataStore
|
||||
from synapse.storage.prepare_database import prepare_database
|
||||
|
||||
logger = logging.getLogger("update_database")
|
||||
|
||||
|
@ -77,12 +76,8 @@ if __name__ == "__main__":
|
|||
# Instantiate and initialise the homeserver object.
|
||||
hs = MockHomeserver(config)
|
||||
|
||||
db_conn = hs.get_db_conn()
|
||||
# Update the database to the latest schema.
|
||||
prepare_database(db_conn, hs.database_engine, config=config)
|
||||
db_conn.commit()
|
||||
|
||||
# setup instantiates the store within the homeserver object.
|
||||
# Setup instantiates the store within the homeserver object and updates the
|
||||
# DB.
|
||||
hs.setup()
|
||||
store = hs.get_datastore()
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue