context.adapter = sql_util.ColumnAdapter(inner, equivs)
- statement = sql.select([inner] + context.secondary_columns, for_update=for_update, use_labels=labels, execution_options=self._execution_options)
+ statement = sql.select([inner] + context.secondary_columns, for_update=for_update, use_labels=labels)
+ if self._execution_options:
+ statement = statement.execution_options(**self._execution_options)
from_clause = inner
for eager_join in eager_joins:
for_update=for_update,
correlate=False,
order_by=context.order_by,
- execution_options=self._execution_options,
**self._select_args
)
+ if self._execution_options:
+ statement = statement.execution_options(**self._execution_options)
if self._correlate:
statement = statement.correlate(*self._correlate)
_hide_froms = []
def __init__(self, text = "", bind=None,
- bindparams=None, typemap=None, autocommit=PARSE_AUTOCOMMIT, execution_options=None):
+ bindparams=None, typemap=None,
+ autocommit=PARSE_AUTOCOMMIT):
self._bind = bind
self.bindparams = {}
self.typemap = typemap
self._autocommit = autocommit
- self._execution_options = execution_options
- if self._execution_options is None:
- self._execution_options = {}
if typemap is not None:
for key in typemap.keys():
typemap[key] = sqltypes.to_instance(typemap[key])
order_by=None,
group_by=None,
bind=None,
- autocommit=False,
- execution_options=None):
+ autocommit=False):
self.use_labels = use_labels
self.for_update = for_update
self._autocommit = autocommit
self._limit = limit
self._offset = offset
self._bind = bind
- self._execution_options = execution_options
- if self._execution_options is None:
- self._execution_options = dict()
self._order_by_clause = ClauseList(*util.to_list(order_by) or [])
self._group_by_clause = ClauseList(*util.to_list(group_by) or [])
assert s2._execution_options == dict(foo='bar', bar='baz')
assert s3._execution_options == dict(foo='not bar')
- def test_execution_options_in_kwargs(self):
+ # this feature not available yet
+ def _NOTYET_test_execution_options_in_kwargs(self):
s = select(execution_options=dict(foo='bar'))
s2 = s.execution_options(bar='baz')
# The original select should not be modified.
assert s._execution_options == dict(foo='bar')
# s2 should have its execution_options based on s, though.
assert s2._execution_options == dict(foo='bar', bar='baz')
-
- def test_execution_options_in_text(self):
+
+ # this feature not available yet
+ def _NOTYET_test_execution_options_in_text(self):
s = text('select 42', execution_options=dict(foo='bar'))
assert s._execution_options == dict(foo='bar')