News for hackers. Stuff that matters.
Re:Is ORM still an anti-pattern? by Ygg2 on Tuesday June 27, 2023 @04:48PM (#36498423)
There are two approaches.

ActiveRecord approach. Objects aren't kept in cache calling update like that won't update other object in memory. Each time you call select you get a different object.

Hibernate approach. Object are kept in cache and running update will update existing objects in memory because each select returns the same object.

SqlAlchemy does permit both.

Re:Is ORM still an anti-pattern? by amluto on Tuesday June 27, 2023 @05:14PM (#36498765)
The only one I gave experience with is SqlAlchemy (1.x). You certainly can do a query builder update and get current subsequent data out of ORM objects, but it’s really easy to mess up, at least in my experience.
Re:Is ORM still an anti-pattern? by Ygg2 on Wednesday June 28, 2023 @06:48AM (#36504709)
I meant if you use SqlAlchemy Core you get out mostly ActiveRecord behavior. If you use SqlAlchemy ORM you get latter behavior.