diff --git a/utils_v2/database/async_mysql_v2.py b/utils_v2/database/async_mysql_v2.py index 37a2286..29d5efb 100644 --- a/utils_v2/database/async_mysql_v2.py +++ b/utils_v2/database/async_mysql_v2.py @@ -154,6 +154,21 @@ class AsyncMySQL: # Done here: return False if self.__pool is None else True + async def disconnect(self) -> bool: + + try: + + # Try to close the pool and wait for the process to complete: + self.__pool.close() + await self.__pool.wait_closed() + + # In case of any exception: + except Exception as exception: + self.__printer(exception) + + # Done here: + return False if self.__pool is None else True + async def ensure_connection(self): """ @@ -361,7 +376,7 @@ class AsyncMySQL: async def execute_many( self, query: str, - data: List[tuple], + data: List[tuple | List], commit: bool = True, return_exception: bool = False ):