File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -458,7 +458,7 @@ class Transaction:
458458 connection = await db_pool.connection()
459459 transaction = connection.transaction()
460460 await transaction.begin()
461- value: Any | None = await transaction.execute (
461+ value: Any = await transaction.fetch_val (
462462 "SELECT username FROM users WHERE id = $1",
463463 [100],
464464 )
@@ -788,11 +788,10 @@ class Connection:
788788 db_pool = PSQLPool()
789789
790790 connection = await db_pool.connection()
791- query_result : SingleQueryResult = await connection.fetch_row(
792- "SELECT username FROM users WHERE id = $ 1",
793- [100 ],
791+ fetched_row : SingleQueryResult = await connection.fetch_row(
792+ "SELECT * FROM users LIMIT 1",
793+ [],
794794 )
795- dict_result: Dict[Any, Any] = query_result.result()
796795 ```
797796 """
798797 async def fetch_val (
@@ -822,7 +821,7 @@ class Connection:
822821 async def main() -> None:
823822 db_pool = PSQLPool()
824823 connection = await db_pool.connection()
825- value: Any = await connection.execute( # some value or None
824+ value: Any = await connection.fetch_val(
826825 "SELECT username FROM users WHERE id = $1",
827826 [100],
828827 )
You can’t perform that action at this time.
0 commit comments