2 ms·
Does this do what you are looking for? https://docs.sqlalchemy.org/en/20/orm/session_transaction.html#using-savepoint https://docs.sqlalchemy.org/en/20/orm/ses
by jayknight 2y ago
Does this do what you are looking for?
https://docs.sqlalchemy.org/en/20/orm/session_transaction.html#using-savepoint https://docs.sqlalchemy.org/en/20/orm/session_transaction.ht...
It's the backing DBMS that will enforce atomicity. Postgres and sqlite allow the semantics of nested transactions with SAVEPOINTs (I don't know about other RDBMSes).
- btdmaster 2y agoI see, that's very cool! It was more about getting it to do the nested update bit though, as in being able to do session.update on the Car with semantics that it will update the Driver connected to the Car, rather than point to a new driver. It seems though this needs to be done by fiddling through ORM internals though, as I could not find any that would implement this kind of PATCH semantics.