Skip to content

Commit 1ab04a7

Browse files
committed
Python: Model Connection.execution_options
1 parent 2acf518 commit 1ab04a7

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

python/ql/src/experimental/semmle/python/frameworks/SqlAlchemy.qll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ private module SqlAlchemy {
111111
this.(DataFlow::MethodCallNode).calls(Engine::instance(), ["begin", "connect"])
112112
or
113113
this.(DataFlow::MethodCallNode).calls(instance(), "connect")
114+
or
115+
this.(DataFlow::MethodCallNode).calls(instance(), "execution_options")
114116
}
115117
}
116118

python/ql/test/experimental/library-tests/frameworks/sqlalchemy/new_tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@
9898

9999
# connection with custom execution options
100100
conn_with_custom_exe_opts = conn.execution_options(bar=1337)
101-
result = conn_with_custom_exe_opts.execute(text_sql) # $ MISSING: getSql=text_sql
101+
result = conn_with_custom_exe_opts.execute(text_sql) # $ getSql=text_sql
102102
assert result.fetchall() == [("FOO",)]
103103

104104
# Session -- is what you use to work with the ORM layer
@@ -300,7 +300,7 @@ class For14(Base):
300300

301301
# connection with custom execution options
302302
conn_with_custom_exe_opts = conn.execution_options(bar=1337)
303-
result = conn_with_custom_exe_opts.execute(text_sql) # $ MISSING: getSql=text_sql
303+
result = conn_with_custom_exe_opts.execute(text_sql) # $ getSql=text_sql
304304
assert result.fetchall() == [("FOO",)]
305305

306306
# `scalar` is shorthand helper

0 commit comments

Comments
 (0)