Change8

Migrating to SQLAlchemy rel_2_0_38

Version rel_2_0_38 introduces 1 breaking change. This guide details how to update your code.

Released: 2/6/2025

1
Breaking Changes
3
Migration Steps
6
Affected Symbols

⚠️ Check Your Code

If you use any of these symbols, you need to read this guide:

sqlalchemy.engine.Engine.execution_optionssqlalchemy.sql.FromClause.csqlalchemy.sql.expression.in_sqlalchemy.dialects.postgresql.asyncpg.AsyncPGConnection.transactionsqlalchemy.dialects.mysql._mysql.Insert.on_duplicate_key_updatesqlalchemy.dialects.sqlite.aiosqlite.AsyncAdaptedQueuePool

Breaking Changes

Issue #1

The default connection pool for the aiosqlite dialect was changed from NullPool to AsyncAdaptedQueuePool, which may break code that relied on NullPool behavior. To fix, explicitly specify NullPool (e.g., poolclass=NullPool) or adjust your pool usage accordingly.

Migration Steps

  1. 1
    If your application relies on the aiosqlite dialect using NullPool, explicitly set poolclass=NullPool when creating the engine.
  2. 2
    Review any custom pool configurations for aiosqlite to ensure they are compatible with AsyncAdaptedQueuePool.
  3. 3
    No other migration steps are required for this release.

Release Summary

SQLAlchemy 2.0.38 introduces a new asyncio.shield() safeguard for asyncpg termination, fixes several bugs across engines and dialects, and changes the default aiosqlite pool, which may require a migration step.

Need More Details?

View the full release notes and all changes for SQLAlchemy rel_2_0_38.

View Full Changelog