3 ms·
> versus having to keep printing str(query_statement) to analyze sqlalchemy thinks it should do versus what it really should do. ORM generally aren’t meant to
by le-mark 5y ago
> versus having to keep printing str(query_statement) to analyze sqlalchemy thinks it should do versus what it really should do.
ORM generally aren’t meant to totally replace sql, it’s an anti pattern. There was a quote by Gavin king explicitly calling this out; ORM for crud operations on object hierarchies, sql for everything else (reporting, adhoc queries etc). I try to educate this whenever I can but so many teams resist it.
- dorgo 5y agoORMs assume that they are the only access point to the database and cache result sets based on that. Disable the cache or keep in mind that bugs can happen due to that behaviour.
- le-mark 5y agoCaching is orthogonal to ORMs; https://old.reddit.com/r/programming/comments/2cnw8x/what_orms_have_taught_me_just_learn_sql/cjheyec/ https://old.reddit.com/r/programming/comments/2cnw8x/what_or...
- ghusbands 5y agoNo it's not, and that link isn't relevant. Some ORMs do have caching layers and when you use those ORMs you have to know how to invalidate the appropriate caches when you update without going through them.