@@ -14,7 +14,10 @@ private import semmle.python.ApiGraphs
14
14
private module Aiopg {
15
15
private import semmle.python.internal.Awaited
16
16
17
- /** A `ConectionPool` is created when the result of `aiopg.create_pool()` is awaited. */
17
+ /**
18
+ * A `ConectionPool` is created when the result of `aiopg.create_pool()` is awaited.
19
+ * See https://aiopg.readthedocs.io/en/stable/core.html#pool
20
+ */
18
21
API:: Node connectionPool ( ) {
19
22
result = API:: moduleImport ( "aiopg" ) .getMember ( "create_pool" ) .getReturn ( ) .getAwaited ( )
20
23
}
@@ -23,6 +26,7 @@ private module Aiopg {
23
26
* A `Connection` is created when
24
27
* - the result of `aiopg.connect()` is awaited.
25
28
* - the result of calling `aquire` on a `ConnectionPool` is awaited.
29
+ * See https://aiopg.readthedocs.io/en/stable/core.html#connection
26
30
*/
27
31
API:: Node connection ( ) {
28
32
result = API:: moduleImport ( "aiopg" ) .getMember ( "connect" ) .getReturn ( ) .getAwaited ( )
@@ -34,14 +38,18 @@ private module Aiopg {
34
38
* A `Cursor` is created when
35
39
* - the result of calling `cursor` on a `ConnectionPool` is awaited.
36
40
* - the result of calling `cursor` on a `Connection` is awaited.
41
+ * See https://aiopg.readthedocs.io/en/stable/core.html#cursor
37
42
*/
38
43
API:: Node cursor ( ) {
39
44
result = connectionPool ( ) .getMember ( "cursor" ) .getReturn ( ) .getAwaited ( )
40
45
or
41
46
result = connection ( ) .getMember ( "cursor" ) .getReturn ( ) .getAwaited ( )
42
47
}
43
48
44
- /** Calling `execute` on a `Cursor` constructs a query. */
49
+ /**
50
+ * Calling `execute` on a `Cursor` constructs a query.
51
+ * See https://aiopg.readthedocs.io/en/stable/core.html#aiopg.Cursor.execute
52
+ */
45
53
class CursorExecuteCall extends SqlConstruction:: Range , DataFlow:: CallCfgNode {
46
54
CursorExecuteCall ( ) { this = cursor ( ) .getMember ( "execute" ) .getACall ( ) }
47
55
@@ -64,7 +72,10 @@ private module Aiopg {
64
72
cursorExecuteCall ( DataFlow:: TypeTracker:: end ( ) , sql ) .flowsTo ( result )
65
73
}
66
74
67
- /** Awaiting the result of calling `execute` executes the query. */
75
+ /**
76
+ * Awaiting the result of calling `execute` executes the query.
77
+ * See https://aiopg.readthedocs.io/en/stable/core.html#aiopg.Cursor.execute
78
+ */
68
79
class AwaitedCursorExecuteCall extends SqlExecution:: Range {
69
80
DataFlow:: Node sql ;
70
81
@@ -73,18 +84,25 @@ private module Aiopg {
73
84
override DataFlow:: Node getSql ( ) { result = sql }
74
85
}
75
86
76
- /** An `Engine` is created when the result of calling `aiopg.sa.create_engine` is awaited. */
87
+ /**
88
+ * An `Engine` is created when the result of calling `aiopg.sa.create_engine` is awaited.
89
+ * See https://aiopg.readthedocs.io/en/stable/sa.html#engine
90
+ */
77
91
API:: Node engine ( ) {
78
92
result =
79
93
API:: moduleImport ( "aiopg" ) .getMember ( "sa" ) .getMember ( "create_engine" ) .getReturn ( ) .getAwaited ( )
80
94
}
81
95
82
96
/**
83
97
* A `SAConnection` is created when the result of calling `aquire` on an `Engine` is awaited.
98
+ * See https://aiopg.readthedocs.io/en/stable/sa.html#connection
84
99
*/
85
100
API:: Node saConnection ( ) { result = engine ( ) .getMember ( "acquire" ) .getReturn ( ) .getAwaited ( ) }
86
101
87
- /** Calling `execute` on a `SAConnection` constructs a query. */
102
+ /**
103
+ * Calling `execute` on a `SAConnection` constructs a query.
104
+ * See https://aiopg.readthedocs.io/en/stable/sa.html#aiopg.sa.SAConnection.execute
105
+ */
88
106
class SAConnectionExecuteCall extends SqlConstruction:: Range , DataFlow:: CallCfgNode {
89
107
SAConnectionExecuteCall ( ) { this = saConnection ( ) .getMember ( "execute" ) .getACall ( ) }
90
108
@@ -109,7 +127,10 @@ private module Aiopg {
109
127
saConnectionExecuteCall ( DataFlow:: TypeTracker:: end ( ) , sql ) .flowsTo ( result )
110
128
}
111
129
112
- /** Awaiting the result of calling `execute` executes the query. */
130
+ /**
131
+ * Awaiting the result of calling `execute` executes the query.
132
+ * See https://aiopg.readthedocs.io/en/stable/sa.html#aiopg.sa.SAConnection.execute
133
+ */
113
134
class AwaitedSAConnectionExecuteCall extends SqlExecution:: Range {
114
135
DataFlow:: Node sql ;
115
136
0 commit comments