After having worked a fair but with SQLAlchemy lately, I'm not sure if I like it. It feels very hacky, and "alchemy" is very appropriate because it explodes a lot.
I guess it's still a decent tool, because who likes to deal with databases anyway.
I prefer to work with data processing/analysis or GUI code over backend code, but all of it beats working with web frontend.
@veronica #sqlalchemy has been nothing but trouble in our team. Lazy loading makes you have more transactions that last longer and also leads to the n+1 query problem. And I hate the query constructor to me it’s harder to understand than plain old SQL. We’re stripping it off to get back down to the #psycopg2 layer.
@YesJustWolf I fear there are a lot og design requirements and decisions that are going to come back and bite us when this goes to production.
@YesJustWolf @veronica Do you know that you can specify eager loading at the query level to avoid this problem?
@YesJustWolf @veronica oh, and if you know that you will always need to eager load that relationship, you can specify that on the relationship itself, so that you don't risk forgetting to do that on any future queries.
It also supports different types of eager loading (join, select in), depending on your use case.