Michael Bayer wrote:
Ive integrated it with the mapper, which is quite a small change, just
added to select() (when used with a "where" clause, not if you send it a
full Select object) and select_by().  the major thing you lose with this
approach is that you cant call len() on a returned result set.  I tried
having __len()__ implemenet the count() method, but then the internal
calls for list(self) cause the __len()__ method to be called, adding an
extra query.

I think I read that correctly: you've changed the behavior of 
mapper.select(some_col='val')? If so, how do we get the old behavior?


...

i might look into having the SelectResults be optional in some way, as im
also looking to build up this "stock plugins" catalog idea, maybe this is
another candidate for that.  they do add a little bit of extra behavior
which might be better presented as "heres a plugin that will give you this
extra behavior".


The object-relational impedance mismatch makes this type of "optimization" 
great for some use cases while it totally kills others (for example, the issues you 
(Mike) raised in your previous post in this thread). IMHO this type of thing should be a 
plugin as you're suggesting--preferably something that could be used selectively on 
certain queries (pun not intended) rather than being applied across the board. Then those 
who want to use it can use it and others will not be bothered by it.

~ Daniel


-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to