[Sqlalchemy-tickets] [sqlalchemy] #2746: Add a flag to explicitly enable correlation even when the
Brought to you by:
zzzeek
|
From: sqlalchemy <mi...@zz...> - 2013-06-06 03:54:11
|
#2746: Add a flag to explicitly enable correlation even when the subquery has
`asfrom=True`
-------------------+-----------------------------------------
Reporter: sayap | Owner: zzzeek
Type: task | Status: new
Priority: low | Milestone:
Component: sql | Severity: no triage selected yet
Keywords: | Progress State: not decided upon
-------------------+-----------------------------------------
This is related to the mailing list post:
https://groups.google.com/forum/?fromgroups#!topic/sqlalchemy/Ld0iuCUphHU
It seems like #2668 has universally disabled correlation for subquery
inside a FROM clause. The situations where such expression is needed could
be quite rare, but it is sometimes necessary to do so, especially for
lesser databases such as SQL Server. An example would be this:
http://stackoverflow.com/questions/5786739/porting-postgresql-string-agg-
to-sql-server-problem-with-order-by
Another example would be a subquery that returns a couple of computed
values, with an outer query consists entirely of a CASE statement in its
select list that makes use of the values.
(Note that these examples are used in the context of hybrid / column
property)
I think it would be good to add a flag to `select()` to enforce the
correlation when necessary.
--
Ticket URL: <http://www.sqlalchemy.org/trac/ticket/2746>
sqlalchemy <http://www.sqlalchemy.org/>
The Database Toolkit for Python
|