File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
src/experimental/semmle/python/frameworks
test/experimental/library-tests/frameworks/sqlalchemy Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -195,6 +195,18 @@ private module SqlAlchemy {
195
195
override DataFlow:: Node getSql ( ) { result in [ this .getArg ( 0 ) , this .getArgByName ( "statement" ) ] }
196
196
}
197
197
198
+ /**
199
+ * A call to `exec_driver_sql` on a SQLAlchemy Connection.
200
+ * See
201
+ * - https://docs.sqlalchemy.org/en/14/core/connections.html#sqlalchemy.engine.Connection.exec_driver_sql
202
+ * - https://docs.sqlalchemy.org/en/14/core/future.html#sqlalchemy.future.Connection.exec_driver_sql
203
+ */
204
+ private class SqlAlchemyExecDriverSqlCall extends DataFlow:: MethodCallNode , SqlExecution:: Range {
205
+ SqlAlchemyExecDriverSqlCall ( ) { this .calls ( Connection:: instance ( ) , "exec_driver_sql" ) }
206
+
207
+ override DataFlow:: Node getSql ( ) { result in [ this .getArg ( 0 ) , this .getArgByName ( "statement" ) ] }
208
+ }
209
+
198
210
/**
199
211
* A call to `scalar` on a SQLAlchemy Engine, Connection, or Session.
200
212
* See
Original file line number Diff line number Diff line change 69
69
70
70
71
71
# exec_driver_sql
72
- result = conn .exec_driver_sql (raw_sql ) # $ MISSING: getSql=raw_sql
72
+ result = conn .exec_driver_sql (raw_sql ) # $ getSql=raw_sql
73
73
assert result .fetchall () == [("FOO" ,)]
74
74
75
75
# construction by object
@@ -284,7 +284,7 @@ class For14(Base):
284
284
result = conn .execute (statement = text_sql ) # $ getSql=text_sql
285
285
assert result .fetchall () == [("FOO" ,)]
286
286
287
- result = conn .exec_driver_sql (raw_sql ) # $ MISSING: getSql=raw_sql
287
+ result = conn .exec_driver_sql (raw_sql ) # $ getSql=raw_sql
288
288
assert result .fetchall () == [("FOO" ,)]
289
289
290
290
raw_conn = conn .connection
You can’t perform that action at this time.
0 commit comments