diff options
author | Federico Caselli <cfederico87@gmail.com> | 2021-02-06 15:17:20 +0100 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-03-24 11:45:39 -0400 |
commit | 502be87a0b5c7bfa28db62b4af867457cd29a5fa (patch) | |
tree | cd54dda88546e34cca1a019fd40e89d91ee703ca /lib/sqlalchemy/dialects/mysql/aiomysql.py | |
parent | 021f2ab7f5e03be3b6a5ad7f2c0e22bd93b83b18 (diff) | |
download | sqlalchemy-502be87a0b5c7bfa28db62b4af867457cd29a5fa.tar.gz |
Add support for aiosqlite
Added support for the aiosqlite database driver for use with the
SQLAlchemy asyncio extension.
Fixes: #5920
Change-Id: Id11a320516a44e886a6f518d2866a0f992413e55
Diffstat (limited to 'lib/sqlalchemy/dialects/mysql/aiomysql.py')
-rw-r--r-- | lib/sqlalchemy/dialects/mysql/aiomysql.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/sqlalchemy/dialects/mysql/aiomysql.py b/lib/sqlalchemy/dialects/mysql/aiomysql.py index cab6df499..c8c7c0f97 100644 --- a/lib/sqlalchemy/dialects/mysql/aiomysql.py +++ b/lib/sqlalchemy/dialects/mysql/aiomysql.py @@ -82,6 +82,13 @@ class AsyncAdapt_aiomysql_cursor: return self._cursor.lastrowid def close(self): + # note we aren't actually closing the cursor here, + # we are just letting GC do it. to allow this to be async + # we would need the Result to change how it does "Safe close cursor". + # MySQL "cursors" don't actually have state to be "closed" besides + # exhausting rows, which we already have done for sync cursor. + # another option would be to emulate aiosqlite dialect and assign + # cursor only if we are doing server side cursor operation. self._rows[:] = [] def execute(self, operation, parameters=None): |