flexmeasures.data.config

Database configuration utils

Functions

flexmeasures.data.config.commit_and_start_new_session(app: Flask)

Use this when a script wants to save a state before continuing Not tested well, just a starting point - not recommended anyway for any logic used by views or tasks. Maybe session.flush() can help you there.

flexmeasures.data.config.configure_db_for(app: Flask)

Call this to configure the database and the tools we use on it for the Flask app. This should only be called once in the app’s lifetime.

flexmeasures.data.config.init_db()

Initialise the database object