@@ -288,6 +288,16 @@ class Cursor:
288288 It can be used as an asynchronous iterator.
289289 """
290290
291+ cursor_name : str
292+ querystring : str
293+ parameters : Sequence [Any ]
294+ prepared : bool | None
295+ conn_dbname : str | None
296+ user : str | None
297+ host_addrs : list [str ]
298+ hosts : list [str ]
299+ ports : list [int ]
300+
291301 def __aiter__ (self : Self ) -> Self : ...
292302 async def __anext__ (self : Self ) -> QueryResult : ...
293303 async def __aenter__ (self : Self ) -> Self : ...
@@ -424,6 +434,12 @@ class Transaction:
424434 `.transaction()`.
425435 """
426436
437+ conn_dbname : str | None
438+ user : str | None
439+ host_addrs : list [str ]
440+ hosts : list [str ]
441+ ports : list [int ]
442+
427443 async def __aenter__ (self : Self ) -> Self : ...
428444 async def __aexit__ (
429445 self : Self ,
@@ -874,6 +890,12 @@ class Connection:
874890 It can be created only from connection pool.
875891 """
876892
893+ conn_dbname : str | None
894+ user : str | None
895+ host_addrs : list [str ]
896+ hosts : list [str ]
897+ ports : list [int ]
898+
877899 async def __aenter__ (self : Self ) -> Self : ...
878900 async def __aexit__ (
879901 self : Self ,
@@ -1284,60 +1306,6 @@ class ConnectionPool:
12841306 ### Parameters:
12851307 - `new_max_size`: new size for the connection pool.
12861308 """
1287- async def execute (
1288- self : Self ,
1289- querystring : str ,
1290- parameters : Sequence [Any ] | None = None ,
1291- prepared : bool = True ,
1292- ) -> QueryResult :
1293- """Execute the query.
1294-
1295- Querystring can contain `$<number>` parameters
1296- for converting them in the driver side.
1297-
1298- ### Parameters:
1299- - `querystring`: querystring to execute.
1300- - `parameters`: list of parameters to pass in the query.
1301- - `prepared`: should the querystring be prepared before the request.
1302- By default any querystring will be prepared.
1303-
1304- ### Example:
1305- ```python
1306- import asyncio
1307-
1308- from psqlpy import PSQLPool, QueryResult
1309-
1310- async def main() -> None:
1311- db_pool = PSQLPool()
1312- query_result: QueryResult = await psqlpy.execute(
1313- "SELECT username FROM users WHERE id = $1",
1314- [100],
1315- )
1316- dict_result: List[Dict[Any, Any]] = query_result.result()
1317- # you don't need to close the pool,
1318- # it will be dropped on Rust side.
1319- ```
1320- """
1321- async def fetch (
1322- self : Self ,
1323- querystring : str ,
1324- parameters : Sequence [Any ] | None = None ,
1325- prepared : bool = True ,
1326- ) -> QueryResult :
1327- """Fetch the result from database.
1328-
1329- It's the same as `execute` method, we made it because people are used
1330- to `fetch` method name.
1331-
1332- Querystring can contain `$<number>` parameters
1333- for converting them in the driver side.
1334-
1335- ### Parameters:
1336- - `querystring`: querystring to execute.
1337- - `parameters`: list of parameters to pass in the query.
1338- - `prepared`: should the querystring be prepared before the request.
1339- By default any querystring will be prepared.
1340- """
13411309 async def connection (self : Self ) -> Connection :
13421310 """Create new connection.
13431311
0 commit comments