mirror of
https://github.com/github/codeql.git
synced 2026-05-02 20:25:13 +02:00
Python: Model Connection.execution_options
This commit is contained in:
@@ -111,6 +111,8 @@ private module SqlAlchemy {
|
||||
this.(DataFlow::MethodCallNode).calls(Engine::instance(), ["begin", "connect"])
|
||||
or
|
||||
this.(DataFlow::MethodCallNode).calls(instance(), "connect")
|
||||
or
|
||||
this.(DataFlow::MethodCallNode).calls(instance(), "execution_options")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ assert result.fetchall() == [("FOO",)]
|
||||
|
||||
# connection with custom execution options
|
||||
conn_with_custom_exe_opts = conn.execution_options(bar=1337)
|
||||
result = conn_with_custom_exe_opts.execute(text_sql) # $ MISSING: getSql=text_sql
|
||||
result = conn_with_custom_exe_opts.execute(text_sql) # $ getSql=text_sql
|
||||
assert result.fetchall() == [("FOO",)]
|
||||
|
||||
# Session -- is what you use to work with the ORM layer
|
||||
@@ -300,7 +300,7 @@ with engine.connect() as conn:
|
||||
|
||||
# connection with custom execution options
|
||||
conn_with_custom_exe_opts = conn.execution_options(bar=1337)
|
||||
result = conn_with_custom_exe_opts.execute(text_sql) # $ MISSING: getSql=text_sql
|
||||
result = conn_with_custom_exe_opts.execute(text_sql) # $ getSql=text_sql
|
||||
assert result.fetchall() == [("FOO",)]
|
||||
|
||||
# `scalar` is shorthand helper
|
||||
|
||||
Reference in New Issue
Block a user