The setup:
-
A library uses SQLAlchemy (openly)
-
Want to write a Flask webapp, using the sessionmaker exposed by the library (say, some module
database
that looks like this):engine = create_engine("....") Session = sessionmaker(bind=engine)
It might be possible to use Flask-SQLAlchemy here, but this is simpler. The code snippet is extracted from sections of Flask-SQLAlchemy.