Database configuration utils


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.


Initialise the database object