scoped_session(sessionmaker()) or plain sessionmaker() in sqlalchemy?

前端 未结 4 733
南笙
南笙 2021-01-31 08:12

I am using SQlAlchemy in my web project. What should I use - scoped_session(sessionmaker()) or plain sessionmaker() - and why? Or should I use somethin

4条回答
  •  遥遥无期
    2021-01-31 08:42

    FYI, when using flask-sqlalchemy, the session object provided is by default a scoped session object.

    http://flask-sqlalchemy.pocoo.org/2.3/quickstart/#road-to-enlightenment

提交回复
热议问题