summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/sql/roles.py
diff options
context:
space:
mode:
authormike bayer <mike_mp@zzzcomputing.com>2021-04-06 14:29:44 +0000
committerGerrit Code Review <gerrit@ci3.zzzcomputing.com>2021-04-06 14:29:44 +0000
commitd5a22410474f51170f18958a623e4f6c05e6b47e (patch)
treed5cdd8c79349d32d8b77e9a4e17d6ffc3a7b60e3 /lib/sqlalchemy/sql/roles.py
parent3375aa7be1e34aa711416122bb3937615333b759 (diff)
parentac2ed15740629967e7fe004d3a7369ccf97aac46 (diff)
downloadsqlalchemy-d5a22410474f51170f18958a623e4f6c05e6b47e.tar.gz
Merge "Disallow AliasedReturnsRows from execution"
Diffstat (limited to 'lib/sqlalchemy/sql/roles.py')
-rw-r--r--lib/sqlalchemy/sql/roles.py20
1 files changed, 7 insertions, 13 deletions
diff --git a/lib/sqlalchemy/sql/roles.py b/lib/sqlalchemy/sql/roles.py
index 1c8276eb6..7d64e8382 100644
--- a/lib/sqlalchemy/sql/roles.py
+++ b/lib/sqlalchemy/sql/roles.py
@@ -155,26 +155,20 @@ class AnonymizedFromClauseRole(StrictFromClauseRole):
raise NotImplementedError()
-class CoerceTextStatementRole(SQLRole):
- _role_name = "Executable SQL or text() construct"
+class ReturnsRowsRole(SQLRole):
+ _role_name = (
+ "Row returning expression such as a SELECT, a FROM clause, or an "
+ "INSERT/UPDATE/DELETE with RETURNING"
+ )
-class StatementRole(CoerceTextStatementRole):
+class StatementRole(SQLRole):
_role_name = "Executable SQL or text() construct"
- _is_future = False
-
_propagate_attrs = util.immutabledict()
-class ReturnsRowsRole(StatementRole):
- _role_name = (
- "Row returning expression such as a SELECT, a FROM clause, or an "
- "INSERT/UPDATE/DELETE with RETURNING"
- )
-
-
-class SelectStatementRole(ReturnsRowsRole):
+class SelectStatementRole(StatementRole, ReturnsRowsRole):
_role_name = "SELECT construct or equivalent text() construct"
def subquery(self):