SQLAlchemy and Falcon - session initialization

后端 未结 2 1308
醉梦人生
醉梦人生 2021-02-07 13:45

I\'m wondering where the best place would be to create a scoped session for use in falcon.

From reading the flask-sqlalchemy code, it, in a round about way, does somethi

2条回答
  •  难免孤独
    2021-02-07 14:20

    There is a package on pypi, falcon-sqla, that provides a middleware to manage SQLAlchemy sessions with Falcon.

    It uses the request context object to add a different session to each http request, avoiding the need to use a scoped session.

提交回复
热议问题