]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
pep484 - sql.selectable
authorMike Bayer <mike_mp@zzzcomputing.com>
Wed, 30 Mar 2022 22:01:58 +0000 (18:01 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Mon, 4 Apr 2022 13:26:43 +0000 (09:26 -0400)
commit3b4d62f4f72e8dfad7f38db192a6a90a8551608c
treed0334c4bb52f803bd7dad661f2e6a12e25f5880c
parent4e603e23755f31278f27a45449120a8dea470a45
pep484 - sql.selectable

the pep484 task becomes more intense as there is mounting
pressure to come up with a consistency in how data moves
from end-user to instance variable.

current thinking is coming into:

1. there are _typing._XYZArgument objects that represent "what the
   user sent"
2. there's the roles, which represent a kind of "filter" for different
   kinds of objects.   These are mostly important as the argument
   we pass to coerce().
3. there's the thing that coerce() returns, which should be what the
   construct uses as its internal representation of the thing.
   This is _typing._XYZElement.

but there's some controversy over whether or
not we should pass actual ClauseElements around by their role
or not.   I think we shouldn't at the moment, but this makes the
"role-ness" of something a little less portable. Like, we have
to set DMLTableRole for TableClause, Join, and Alias, but then
also we have to repeat those three types in order to set up
_DMLTableElement.

Other change introduced here, there was a deannotate=True
for the left/right of a sql.join().    All tests pass without that.
I'd rather not have that there as if we have a join(A, B) where
A, B are mapped classes, we want them inside of the _annotations.
The rationale seems to be performance, but this performance can
be illustrated to be on the compile side which we hope is cached
in the normal case.

CTEs now accommodate for text selects including recursive.

Get typing to accommodate "util.preloaded" cleanly; add "preloaded"
as a real module.  This seemed like we would have needed
pep562 `__getattr__()` but we don't, just set names in
globals() as we import them.

References: #6810
Change-Id: I34d17f617de2fe2c086fc556bd55748dc782faf0
37 files changed:
lib/sqlalchemy/exc.py
lib/sqlalchemy/orm/query.py
lib/sqlalchemy/sql/_dml_constructors.py
lib/sqlalchemy/sql/_elements_constructors.py
lib/sqlalchemy/sql/_selectable_constructors.py
lib/sqlalchemy/sql/_typing.py
lib/sqlalchemy/sql/annotation.py
lib/sqlalchemy/sql/base.py
lib/sqlalchemy/sql/cache_key.py
lib/sqlalchemy/sql/coercions.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/dml.py
lib/sqlalchemy/sql/elements.py
lib/sqlalchemy/sql/functions.py
lib/sqlalchemy/sql/lambdas.py
lib/sqlalchemy/sql/roles.py
lib/sqlalchemy/sql/schema.py
lib/sqlalchemy/sql/selectable.py
lib/sqlalchemy/sql/traversals.py
lib/sqlalchemy/sql/type_api.py
lib/sqlalchemy/sql/util.py
lib/sqlalchemy/sql/visitors.py
lib/sqlalchemy/testing/engines.py
lib/sqlalchemy/testing/fixtures.py
lib/sqlalchemy/util/__init__.py
lib/sqlalchemy/util/_collections.py
lib/sqlalchemy/util/preloaded.py [moved from lib/sqlalchemy/util/_preloaded.py with 85% similarity]
pyproject.toml
test/aaa_profiling/test_orm.py
test/base/test_utils.py
test/profiles.txt
test/sql/test_compare.py
test/sql/test_compiler.py
test/sql/test_cte.py
test/sql/test_selectable.py
test/sql/test_text.py
test/sql/test_values.py