File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed
python/ql/test/library-tests/frameworks/aiopg Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change
1
+ import python
2
+ import experimental.meta.ConceptsTest
Original file line number Diff line number Diff line change
1
+ import aiopg
2
+
3
+ # Only a cursor can execute sql.
4
+ async def test_cursor ():
5
+ # Create connection directly
6
+ conn = await aiopg .connect ()
7
+ cur = await conn .cursor ()
8
+ await cur .execute ("sql" ) # $ MISSING: getSql="sql"
9
+
10
+ # Create connection via pool
11
+ async with aiopg .create_pool () as pool :
12
+ # Create Cursor via Connection
13
+ async with pool .acquire () as conn :
14
+ cur = await conn .cursor ()
15
+ await cur .execute ("sql" ) # $ MISSING: getSql="sql"
16
+
17
+ # Create Cursor directly
18
+ async with pool .cursor () as cur :
19
+ await cur .execute ("sql" ) # $ MISSING: getSql="sql"
You can’t perform that action at this time.
0 commit comments