diff options
| author | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-01-14 23:01:13 -0500 |
|---|---|---|
| committer | Mike Bayer <mike_mp@zzzcomputing.com> | 2021-01-14 23:35:41 -0500 |
| commit | 038ee979985c5585287c5636bbfde607082f5130 (patch) | |
| tree | 7c930695be7e7ab4f10674701d018737c7954392 /lib/sqlalchemy/sql | |
| parent | 6be06d85e598e4fda6f3d35084e1c5cccb30cee5 (diff) | |
| download | sqlalchemy-038ee979985c5585287c5636bbfde607082f5130.tar.gz | |
allow Executable to be accepted by Session.execute()
Fixed an issue where the API to create a custom executable SQL construct
using the ``sqlalchemy.ext.compiles`` extension according to the
documentation that's been up for many years would no longer function if
only ``Executable, ClauseElement`` were used as the base classes,
additional classes were needed if wanting to use
:meth:`_orm.Session.execute`. This has been resolved so that those extra
classes aren't needed.
Change-Id: I99b8acd88515c2a52842d62974199121e64c0381
Diffstat (limited to 'lib/sqlalchemy/sql')
| -rw-r--r-- | lib/sqlalchemy/sql/base.py | 2 | ||||
| -rw-r--r-- | lib/sqlalchemy/sql/elements.py | 1 |
2 files changed, 1 insertions, 2 deletions
diff --git a/lib/sqlalchemy/sql/base.py b/lib/sqlalchemy/sql/base.py index a1426b628..550111020 100644 --- a/lib/sqlalchemy/sql/base.py +++ b/lib/sqlalchemy/sql/base.py @@ -729,7 +729,7 @@ class ExecutableOption(HasCopyInternals, HasCacheKey): return c -class Executable(Generative): +class Executable(roles.CoerceTextStatementRole, Generative): """Mark a :class:`_expression.ClauseElement` as supporting execution. :class:`.Executable` is a superclass for all "statement" types diff --git a/lib/sqlalchemy/sql/elements.py b/lib/sqlalchemy/sql/elements.py index d3c767b5d..5ea3526ea 100644 --- a/lib/sqlalchemy/sql/elements.py +++ b/lib/sqlalchemy/sql/elements.py @@ -1502,7 +1502,6 @@ class TextClause( roles.OrderByRole, roles.FromClauseRole, roles.SelectStatementRole, - roles.CoerceTextStatementRole, roles.BinaryElementRole, roles.InElementRole, Executable, |
