The default way of using sqlalchemy models is calling globally:
db = SQLAlchemy()
db.init_app(app)
I don't see a way to get the "app" globally with functions-framework. sqlalchemy doesn't allow us registering it after a request is made. The desired use case is a simple:
result = SomeTable.query.all()
More information about using Flask-SqlAlchemy is here.