I'm pretty new in Python and SQLAlchemy, so basically I changed from:
session = Session()
session.query(SOMETHING_HERE).filter()
to
session = Session()
nested_session = session.begin_nested()
nested_session.query(SOMETHING_HERE).filter()
in order to use SAVEPOINTS. But I'm getting the error:
AttributeError: 'SessionTransaction' object has no attribute 'query'
I did a deep dive in the documentation, like these:
https://docs.sqlalchemy.org/en/13/orm/session_api.html#sqlalchemy.orm.session.SessionTransaction
https://docs.sqlalchemy.org/en/13/orm/session_transaction.html
But it did not help me.
Questions: Am I able to use begin_nested to run query with filter like that or I need to change the approach? Is this a version issue (sql alchemy for example)?