]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Add result map targeting for custom compiled, text objects
authorMike Bayer <mike_mp@zzzcomputing.com>
Thu, 3 Oct 2019 21:36:27 +0000 (17:36 -0400)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 8 Oct 2019 03:06:06 +0000 (23:06 -0400)
commit65aee6cce57fd1cca3a95814feff3ed99a5a51ee
tree0352d74938902a9242dfb97ca5215d9191a2ad16
parentebd9788c986c56b8b845fa83609a6eb2c0cef083
Add result map targeting for custom compiled, text objects

In order for text(), custom compiled objects, etc. to be usable
by Query(), they are all targeted by object key in the result map.
As we no longer want Query to implicitly label these, as well as that
text() has no label feature, support adding entries to the result
map that have no name, key, or type, only the object itself, and
then ensure that the compiler sets up for positional targeting
when this condition is detected.

Allows for more flexible ORM query usage with custom expressions
and text() while having less special logic in query itself.

Fixes: #4887
Change-Id: Ie073da127d292d43cb132a2b31bc90af88bfe2fd
doc/build/changelog/unreleased_14/4887.rst [new file with mode: 0644]
lib/sqlalchemy/engine/result.py
lib/sqlalchemy/ext/compiler.py
lib/sqlalchemy/sql/compiler.py
lib/sqlalchemy/sql/selectable.py
test/ext/test_compiler.py
test/orm/test_query.py
test/sql/test_functions.py
test/sql/test_resultset.py
test/sql/test_text.py