diff options
author | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-12-04 16:26:44 -0500 |
---|---|---|
committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2020-12-10 17:11:46 -0500 |
commit | 5f333762db4b72c604e44f20f86d171dc249b741 (patch) | |
tree | 9d70447db467bce735a1aaeadae89d290c60dffe /lib/sqlalchemy/ext/asyncio/result.py | |
parent | c736eef8b35841af89ec19469aa496585efd3865 (diff) | |
download | sqlalchemy-5f333762db4b72c604e44f20f86d171dc249b741.tar.gz |
add aiomysql support
This is a re-gerrit of the original gerrit
merged in Ia8ad3efe3b50ce75a3bed1e020e1b82acb5f2eda
Reverted due to ongoing issues.
Fixes: #5747
Change-Id: I2b57e76b817eed8f89457a2146b523a1cab656a8
Diffstat (limited to 'lib/sqlalchemy/ext/asyncio/result.py')
-rw-r--r-- | lib/sqlalchemy/ext/asyncio/result.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/sqlalchemy/ext/asyncio/result.py b/lib/sqlalchemy/ext/asyncio/result.py index 7f8a707d5..9c7e0420f 100644 --- a/lib/sqlalchemy/ext/asyncio/result.py +++ b/lib/sqlalchemy/ext/asyncio/result.py @@ -17,7 +17,14 @@ if util.TYPE_CHECKING: from ...engine.result import Row -class AsyncResult(FilterResult): +class AsyncCommon(FilterResult): + async def close(self): + """Close this result.""" + + await greenlet_spawn(self._real_result.close) + + +class AsyncResult(AsyncCommon): """An asyncio wrapper around a :class:`_result.Result` object. The :class:`_asyncio.AsyncResult` only applies to statement executions that @@ -370,7 +377,7 @@ class AsyncResult(FilterResult): return AsyncMappingResult(self._real_result) -class AsyncScalarResult(FilterResult): +class AsyncScalarResult(AsyncCommon): """A wrapper for a :class:`_asyncio.AsyncResult` that returns scalar values rather than :class:`_row.Row` values. @@ -500,7 +507,7 @@ class AsyncScalarResult(FilterResult): return await greenlet_spawn(self._only_one_row, True, True, False) -class AsyncMappingResult(FilterResult): +class AsyncMappingResult(AsyncCommon): """A wrapper for a :class:`_asyncio.AsyncResult` that returns dictionary values rather than :class:`_engine.Row` values. |