Adam Dziendziel wrote:
>
> By the way, is this possible to tell SQLAlchemy to load two lazy
> attributes together, using a single query i.e. like it does with
> eagerly-loaded attributes, but on demand?
> If collection1 and some_reference points to different rows in the
> database, the code:
>   self.collection1
>   self.some_reference
> would issue two SELECTs, two round-trips to the database.
>
> When I know that I need these two, I would write instead something
> like:
> orm.attributes.load(self, ['collection1', 'some_reference'])
>

in fact if you load collection1 eagerly, and some_reference is a many to
one within that collection, referencing "some_reference" will pull the
existing object from the identity map and no SQL is emitted.   So the
feature is already "there" from a performance standpoint.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to