]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
SelectBase no longer a FromClause
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 13 Jun 2019 16:37:22 +0000 (12:37 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Sat, 6 Jul 2019 17:02:22 +0000 (13:02 -0400)
commitef7ff058eb67d73ebeac7b125ab2a7806e14629c
tree9a09162961f7bcdb6d16837adacabb99f10b4410
parent1ce98ca83a4b2da12e52aa0f4ab181c83063abc2
SelectBase no longer a FromClause

As part of the SQLAlchemy 2.0 migration project, a conceptual change has
been made to the role of the :class:`.SelectBase` class hierarchy,
which is the root of all "SELECT" statement constructs, in that they no
longer serve directly as FROM clauses, that is, they no longer subclass
:class:`.FromClause`.  For end users, the change mostly means that any
placement of a :func:`.select` construct in the FROM clause of another
:func:`.select` requires first that it be wrapped in a subquery first,
which historically is through the use of the :meth:`.SelectBase.alias`
method, and is now also available through the use of
:meth:`.SelectBase.subquery`.    This was usually a requirement in any
case since several databases don't accept unnamed SELECT subqueries
in their FROM clause in any case.

See the documentation in this change for lots more detail.

Fixes: #4617
Change-Id: I0f6174ee24b9a1a4529168e52e855e12abd60667
53 files changed:
doc/build/changelog/migration_14.rst
doc/build/changelog/unreleased_14/4617_implicit_subquery.rst
doc/build/changelog/unreleased_14/4617_scalar.rst
doc/build/core/selectable.rst
doc/build/core/tutorial.rst
doc/build/errors.rst
lib/sqlalchemy/dialects/mssql/base.py
lib/sqlalchemy/dialects/oracle/base.py
lib/sqlalchemy/engine/result.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/orm/strategies.py
lib/sqlalchemy/orm/util.py
lib/sqlalchemy/sql/__init__.py
lib/sqlalchemy/sql/base.py
lib/sqlalchemy/sql/clause_compare.py
lib/sqlalchemy/sql/coercions.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/dml.py
lib/sqlalchemy/sql/elements.py
lib/sqlalchemy/sql/expression.py
lib/sqlalchemy/sql/roles.py
lib/sqlalchemy/sql/selectable.py
lib/sqlalchemy/sql/util.py
lib/sqlalchemy/testing/suite/__init__.py
lib/sqlalchemy/testing/suite/test_deprecations.py [new file with mode: 0644]
lib/sqlalchemy/testing/suite/test_select.py
test/aaa_profiling/test_memusage.py
test/base/test_utils.py
test/dialect/oracle/test_compiler.py
test/dialect/oracle/test_types.py
test/engine/test_reflection.py
test/orm/inheritance/test_relationship.py
test/orm/test_deprecations.py
test/orm/test_froms.py
test/orm/test_joins.py
test/orm/test_of_type.py
test/orm/test_query.py
test/sql/test_compare.py
test/sql/test_compiler.py
test/sql/test_deprecations.py
test/sql/test_functions.py
test/sql/test_generative.py
test/sql/test_join_rewriting.py
test/sql/test_lateral.py
test/sql/test_metadata.py
test/sql/test_operators.py
test/sql/test_query.py
test/sql/test_quote.py
test/sql/test_resultset.py
test/sql/test_roles.py
test/sql/test_selectable.py
test/sql/test_text.py
test/sql/test_type_expressions.py