This repository was archived by the owner on Aug 19, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Expand file tree Collapse file tree 2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -150,6 +150,9 @@ def __iter__(self) -> typing.Iterator:
150
150
def __len__ (self ) -> int :
151
151
return len (self ._row )
152
152
153
+ def __getattr__ (self , name : str ) -> typing .Any :
154
+ return self ._mapping .get (name )
155
+
153
156
154
157
class PostgresConnection (ConnectionBackend ):
155
158
def __init__ (self , database : PostgresBackend , dialect : Dialect ):
Original file line number Diff line number Diff line change @@ -1206,3 +1206,19 @@ async def test_postcompile_queries(database_url):
1206
1206
results = await database .fetch_all (query = query )
1207
1207
1208
1208
assert len (results ) == 0
1209
+
1210
+
1211
+ @pytest .mark .parametrize ("database_url" , DATABASE_URLS )
1212
+ @mysql_versions
1213
+ @async_adapter
1214
+ async def test_result_named_access (database_url ):
1215
+ async with Database (database_url ) as database :
1216
+ query = notes .insert ()
1217
+ values = {"text" : "example1" , "completed" : True }
1218
+ await database .execute (query , values )
1219
+
1220
+ query = notes .select ().where (notes .c .text == "example1" )
1221
+ result = await database .fetch_one (query = query )
1222
+
1223
+ assert result .text == "example1"
1224
+ assert result .completed is True
You can’t perform that action at this time.
0 commit comments