On 9/29/15 8:47 PM, Charles Duffy wrote:
From a StackOverflow answer describing use of the correlate() call in
SQLALchemy, at
http://stackoverflow.com/questions/13056049/how-to-specify-the-from-tables-in-sqlalchemy-subqueries:
|>>>printstr(q1)SELECT t3.id AS t3_id FROM tbl AS t3,tbl AS t1 WHERE
t3.id <t1.id ORDER BY t3.id DESC LIMIT ?OFFSET
?>>>printstr(q1.correlate(t1))SELECT t3.id AS t3_id FROM tbl AS t3
WHERE t3.id <t1.id ORDER BY t3.id DESC LIMIT ?OFFSET ?|
I'm unable to reproduce this behavior: When I run the code given
(following definitions for the relevant objects from the question),
str(q1.correlate(t1)) contains the exact same FROM clause as str(t1),
with both t1 and t3 explicitly listed. Has there been a change in
semantics across releases? I unfortunately don't know which version
the code above was tested against, though it dates from late 2012.
If this isn't a result of a deliberate change, I'm willing to take a
shot at bisecting to find the origin.
My own issue on this subject is directly posted at
http://stackoverflow.com/questions/32835335/sqlalchemy-from-entry-still-present-in-correlated-subquery.
looks like you found the answer! which is correct. the correlation
is only in context these days.
--
You received this message because you are subscribed to the Google
Groups "sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected]
<mailto:[email protected]>.
To post to this group, send email to [email protected]
<mailto:[email protected]>.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.