From 2bbd3ac1fb6049fc7195821798f02ce7fa56a7e9 Mon Sep 17 00:00:00 2001 From: Daniel Lister Date: Thu, 24 Jan 2019 16:35:16 -0500 Subject: Add getters for all execution_options Added accessors for execution options to Core and ORM, via :meth:`.Query.get_execution_options`, :meth:`.Connection.get_execution_options`, :meth:`.Engine.get_execution_options`, and :meth:`.Executable.get_execution_options`. PR courtesy Daniel Lister. Fixes: #4406 Closes: #4465 Pull-request: https://github.com/sqlalchemy/sqlalchemy/pull/4465 Pull-request-sha: 9674688bb5e80471a6a421bac06f995c2e64f8f7 Change-Id: I93ba51d7a2d687e255edd6938db15615e56dd237 --- lib/sqlalchemy/sql/base.py | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'lib/sqlalchemy/sql') diff --git a/lib/sqlalchemy/sql/base.py b/lib/sqlalchemy/sql/base.py index a5a0e4377..c5e5fd8a1 100644 --- a/lib/sqlalchemy/sql/base.py +++ b/lib/sqlalchemy/sql/base.py @@ -365,9 +365,11 @@ class Executable(Generative): .. seealso:: - :meth:`.Connection.execution_options()` + :meth:`.Connection.execution_options` - :meth:`.Query.execution_options()` + :meth:`.Query.execution_options` + + :meth:`.Executable.get_execution_options` """ if "isolation_level" in kw: @@ -384,6 +386,17 @@ class Executable(Generative): ) self._execution_options = self._execution_options.union(kw) + def get_execution_options(self): + """ Get the non-SQL options which will take effect during execution. + + .. versionadded:: 1.3 + + .. seealso:: + + :meth:`.Executable.execution_options` + """ + return self._execution_options + def execute(self, *multiparams, **params): """Compile and execute this :class:`.Executable`.""" e = self.bind -- cgit v1.2.1