summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/ext/asyncio/result.py
diff options
context:
space:
mode:
authorMike Bayer <mike_mp@zzzcomputing.com>2020-12-04 16:26:44 -0500
committerMike Bayer <mike_mp@zzzcomputing.com>2020-12-08 08:46:49 -0500
commitdc60de7c105234b6144cd7c24411abbc3363406e (patch)
tree843ff7166813d6c24e1d927dd7af13ce1cfbcf64 /lib/sqlalchemy/ext/asyncio/result.py
parent0d7c12735b0a871205c23904320a6f42384df1e8 (diff)
downloadsqlalchemy-dc60de7c105234b6144cd7c24411abbc3363406e.tar.gz
add aiomysql support
Fixes: #5747 Change-Id: Ia8ad3efe3b50ce75a3bed1e020e1b82acb5f2eda
Diffstat (limited to 'lib/sqlalchemy/ext/asyncio/result.py')
-rw-r--r--lib/sqlalchemy/ext/asyncio/result.py13
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.