]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Support aiosqlite 0.22.0+
authorFederico Caselli <cfederico87@gmail.com>
Wed, 24 Dec 2025 13:02:17 +0000 (14:02 +0100)
committerMike Bayer <mike_mp@zzzcomputing.com>
Thu, 1 Jan 2026 18:01:44 +0000 (13:01 -0500)
commit3148eb99477ce7f7a8705d52629d5a2d9d648607
treef9c1ccccd3ef11d6633ffb1a6616161bb2d087df
parentf128d0c5266f72b15a806e547d79fb3f78e1573f
Support aiosqlite 0.22.0+

Fixed issue in the aiosqlite driver where SQLAlchemy's setting of
aiosqlite's worker thread to "daemon" stopped working because the aiosqlite
architecture moved the location of the worker thread in version 0.22.0.
This "daemon" flag is necessary so that a program is able to exit if the
SQLite connection itself was not explicitly closed, which is particularly
likely with SQLAlchemy as it maintains SQLite connections in a connection
pool.  While it's perfectly fine to call :meth:`.AsyncEngine.dispose`
before program exit, this is not historically or technically necessary for
any driver of any known backend, since a primary feature of relational
databases is durability.  The change also implements support for
"terminate" with aiosqlite when using version version 0.22.1 or greater,
which implements a sync ``.stop()`` method.

Fixes: #13039
Change-Id: I46efcbaab9dd028f673e113d5f6f2ceddfd133ca
(cherry picked from commit 380c234ce901416ca3c04453744f33d53cc4bd55)
doc/build/changelog/unreleased_20/13039.rst [new file with mode: 0644]
lib/sqlalchemy/dialects/sqlite/aiosqlite.py
test/ext/asyncio/test_engine.py