Python: Model Connection.execution_options

This commit is contained in:
Rasmus Wriedt Larsen
2021-09-01 15:03:13 +02:00
parent 2acf518037
commit 1ab04a7276
2 changed files with 4 additions and 2 deletions

View File

@@ -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