From b258e260b62b5a625aa0eef62927592f956812ed Mon Sep 17 00:00:00 2001 From: William Stam Date: Thu, 6 Jul 2023 14:02:05 +0200 Subject: [PATCH] Added: cursor.description (currently available as cursor._cursor.description so this is just a shortcut) Added: cursor.fetchmany() --- cx_Oracle_async/cursors.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/cx_Oracle_async/cursors.py b/cx_Oracle_async/cursors.py index bcd0f0b..aeaa480 100644 --- a/cx_Oracle_async/cursors.py +++ b/cx_Oracle_async/cursors.py @@ -20,6 +20,10 @@ def __init__(self , cursor : Cursor, loop : 'ProactorEventLoop' , thread_pool : self._loop = loop self._thread_pool = thread_pool + @property + def description(self): + return self._cursor.description + async def execute(self , sql , *args , **kwargs): if kwargs: return await self._loop.run_in_executor( @@ -38,8 +42,12 @@ async def fetchall(self): # block mainly happens when fetch triggered. return await self._loop.run_in_executor(self._thread_pool , self._cursor.fetchall) + async def fetchmany(self, *args, **kwargs): + # block mainly happens when fetch triggered. + return await self._loop.run_in_executor(self._thread_pool, self._cursor.fetchmany, *args, **kwargs) + async def var(self, args): return await self._loop.run_in_executor(self._thread_pool , self._cursor.var, args) async def callproc(self, *args , **kwargs): - return await self._loop.run_in_executor(self._thread_pool , self._cursor.callproc, *args , **kwargs) + return await self._loop.run_in_executor(self._thread_pool , self._cursor.callproc, *args , **kwargs) \ No newline at end of file