<story><title>Migrating to SQLAlchemy 2.0</title><url>https://docs.sqlalchemy.org/en/14/changelog/migration_20.html</url></story><parent_chain></parent_chain><comment><author>parhamn</author><text>I’ve seen quite a few shops which effectively hit every python db&amp;#x2F;networking&amp;#x2F;pooling foot gun you could possibly encounter while using  SQLAlchemy.&lt;p&gt;People cargo cult the flask intro tutorial and have no clue how session binding works, where the transactions are, how committing works, etc because it’s all tucked away in magical middleware and singletons. As the code base grows so does the mess of blocking txns, accidental cross joins, pool exhaustion, and so on.&lt;p&gt;It’s a great tool from a technical expressiveness perspective but terribly full of operational foot guns. Beware and use Django until you’re sure you AND your team know what you’re doing.</text></comment>
<story><title>Migrating to SQLAlchemy 2.0</title><url>https://docs.sqlalchemy.org/en/14/changelog/migration_20.html</url></story><parent_chain></parent_chain><comment><author>avolcano</author><text>One of the most interesting 1.4&amp;#x2F;2.0 changes is first-class asyncio support, not just for core (the query builder) but for the ORM layer as well: &lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;docs.sqlalchemy.org&amp;#x2F;en&amp;#x2F;14&amp;#x2F;changelog&amp;#x2F;migration_14.html#change-3414&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;docs.sqlalchemy.org&amp;#x2F;en&amp;#x2F;14&amp;#x2F;changelog&amp;#x2F;migration_14.htm...&lt;/a&gt;&lt;p&gt;As this notes, there&amp;#x27;s several changes you have to make to your assumptions around the ORM interface. SQLAlchemy, for better or worse, supports &amp;quot;lazy loading&amp;quot; of relationships on attribute access - that is, simply accessing `user.friends` would trigger a query to select a user&amp;#x27;s friends. This kind of magic is at odds with async&amp;#x2F;await execution models, where you would instead need to run something like `await user.get_friends()` for non-blocking i&amp;#x2F;o.&lt;p&gt;It looks like they&amp;#x27;ve done some good work in making the ORM layer work reasonably well with these limitations (&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;docs.sqlalchemy.org&amp;#x2F;en&amp;#x2F;14&amp;#x2F;orm&amp;#x2F;extensions&amp;#x2F;asyncio.html#preventing-implicit-io-when-using-asyncsession&quot; rel=&quot;nofollow&quot;&gt;https:&amp;#x2F;&amp;#x2F;docs.sqlalchemy.org&amp;#x2F;en&amp;#x2F;14&amp;#x2F;orm&amp;#x2F;extensions&amp;#x2F;asyncio.htm...&lt;/a&gt;), but I wonder if removing &amp;quot;helpful magic&amp;quot; like this will push more people to stick with the query-builder, rather than the ORM.</text></comment>