I am trying to use SQLAlchemy not in a view function (I was doing something like this with Flask-APSheduler). I know that there were already a lot of topics related to this