11import pickle
22from typing import Any , Final , Literal , Optional , TypeVar , cast
33
4- from psqlpy import PSQLPool
4+ from psqlpy import ConnectionPool
55from psqlpy .exceptions import RustPSQLDriverPyBaseError
66from taskiq import AsyncResultBackend , TaskiqResult
77
@@ -33,23 +33,23 @@ def __init__(
3333
3434 :param dsn: connection string to PostgreSQL.
3535 :param keep_results: flag to not remove results from Redis after reading.
36- :param connect_kwargs: additional arguments for nats `PSQLPool ` class.
36+ :param connect_kwargs: additional arguments for nats `ConnectionPool ` class.
3737 """
3838 self .dsn : Final = dsn
3939 self .keep_results : Final = keep_results
4040 self .table_name : Final = table_name
4141 self .field_for_task_id : Final = field_for_task_id
4242 self .connect_kwargs : Final = connect_kwargs
4343
44- self ._database_pool : PSQLPool
44+ self ._database_pool : ConnectionPool
4545
4646 async def startup (self ) -> None :
4747 """Initialize the result backend.
4848
4949 Construct new connection pool
5050 and create new table for results if not exists.
5151 """
52- self ._database_pool = PSQLPool (
52+ self ._database_pool = ConnectionPool (
5353 dsn = self .dsn ,
5454 ** self .connect_kwargs ,
5555 )
@@ -68,7 +68,7 @@ async def startup(self) -> None:
6868
6969 async def shutdown (self ) -> None :
7070 """Close the connection pool."""
71- await self ._database_pool .close ()
71+ self ._database_pool .close ()
7272
7373 async def set_result (
7474 self ,
0 commit comments