On Thu, Feb 28, 2019 at 1:32 PM Jonathan Vanasco <[email protected]> wrote: > > I couldn't find an answer to this in the docs. > > I'm auditing a handful of queries that are in a form similar to this... > > query = session.query(Foo, Bar).join(Bar, Foo.id == Bar.foo_id) > > I think SqlAlchemy is interpreting this as: select from the leftmost entity > from `query` (Foo), joining things to it for the rest of the construct, then > populate the rest of the objects in `query` based on their appearance in the > row from the join (Bar). Is that about right?
sure, though you're giving it the ON clause directly so it doesn't even have to do much, but yes it sees Bar and pulls that from the FROM list to be the right side of the join. > > I'm getting the results I expect and the sql I want, I just want to confirm > that I'm using SqlAlchemy correctly. I want to make sure that I am not > invoking things incorrectly, yet getting the right results. that's happened > before! > > > > > > -- > SQLAlchemy - > The Python SQL Toolkit and Object Relational Mapper > > http://www.sqlalchemy.org/ > > To post example code, please provide an MCVE: Minimal, Complete, and > Verifiable Example. See http://stackoverflow.com/help/mcve for a full > description. > --- > 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 https://groups.google.com/group/sqlalchemy. > For more options, visit https://groups.google.com/d/optout. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- 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 https://groups.google.com/group/sqlalchemy. For more options, visit https://groups.google.com/d/optout.
