This repository was archived by the owner on Aug 19, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -802,3 +802,26 @@ async def test_iterate_outside_transaction_with_temp_table(database_url):
802
802
iterate_results .append (result )
803
803
804
804
assert len (iterate_results ) == 5
805
+
806
+
807
+ @pytest .mark .parametrize ("database_url" , DATABASE_URLS )
808
+ @pytest .mark .parametrize ("select_query" , [notes .select (), "SELECT * FROM notes" ])
809
+ @async_adapter
810
+ async def test_column_names (database_url , select_query ):
811
+ """
812
+ Test that the basic `execute()`, `execute_many()`, `fetch_all()``, and
813
+ `fetch_one()` interfaces are all supported (using SQLAlchemy core).
814
+ """
815
+ async with Database (database_url ) as database :
816
+ async with database .transaction (force_rollback = True ):
817
+ # insert values
818
+ query = notes .insert ()
819
+ values = {"text" : "example1" , "completed" : True }
820
+ await database .execute (query , values )
821
+ # fetch results
822
+ results = await database .fetch_all (query = select_query )
823
+ assert len (results ) == 1
824
+
825
+ assert sorted (results [0 ].keys ()) == ["completed" , "id" , "text" ]
826
+ assert results [0 ]["text" ] == "example1"
827
+ assert results [0 ]["completed" ] == True
You can’t perform that action at this time.
0 commit comments