diff options
Diffstat (limited to 'lib/sqlalchemy/sql/roles.py')
-rw-r--r-- | lib/sqlalchemy/sql/roles.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/sqlalchemy/sql/roles.py b/lib/sqlalchemy/sql/roles.py index 053bd7146..55c52d401 100644 --- a/lib/sqlalchemy/sql/roles.py +++ b/lib/sqlalchemy/sql/roles.py @@ -95,6 +95,8 @@ class InElementRole(SQLRole): class FromClauseRole(ColumnsClauseRole): _role_name = "FROM expression, such as a Table or alias() object" + _is_subquery = False + @property def _hide_froms(self): raise NotImplementedError() @@ -134,7 +136,7 @@ class StatementRole(CoerceTextStatementRole): class ReturnsRowsRole(StatementRole): _role_name = ( - "Row returning expression such as a SELECT, or an " + "Row returning expression such as a SELECT, a FROM clause, or an " "INSERT/UPDATE/DELETE with RETURNING" ) @@ -142,6 +144,12 @@ class ReturnsRowsRole(StatementRole): class SelectStatementRole(ReturnsRowsRole): _role_name = "SELECT construct or equivalent text() construct" + def subquery(self): + raise NotImplementedError( + "All SelectStatementRole objects should implement a " + ".subquery() method." + ) + class HasCTERole(ReturnsRowsRole): pass |