db = SQLAlchemy(app)
print db.engine.connect()
print db.session.connection()
# <sqlalchemy.engine.base.Connection object at 0x7fb9daf01ad0>
# <sqlalchemy.engine.base.Connection object at 0x7fb9da0edcd0>
print db.engine.connect().connection.connection
print db.session.connection().connection.connection
# <_mysql.connection open to '*' at 2b30c30>
# <_mysql.connection open to '*' at 2b1ab80>
为什么engine.connect()不等于session.connection()?此代码使用Flask-SQLAlchemy。