On 6/4/07, Michael Bayer <[EMAIL PROTECTED]> wrote: > > > On Jun 3, 2007, at 10:33 PM, Michael Bayer wrote: > > > one() raises an exception when theres not exactly one result, scalar > > () does not. currently we have selectfirst() and selectone(), people > > seem to like the dichotomy. [0] specifically adds "LIMIT 1 OFFSET 0" > > to the query and i dont think scalar() or one() would do that (LIMIT > > is specifically a problem with DB's like Oracle that dont directly > > support it...more complex oracle queries cant handle it). > > > > scratch that partially, selectfirst() and selectone() *do* add the > limit. however in the case of selectone(), it adds a limit of > *two*. if a second row is present-> exception.
I know, that's why I suggested to scrap the one without the check (named first() now). If people like it, that's ok with me, it's just that when we'll deprecate the non-generative aggregate methods (which is something I think should be done), the code for the "first" method will boil down to "return self[0]"... -- Gaƫtan de Menten http://openhex.org --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to sqlalchemy@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---