On Jun 3, 2007, at 4:54 PM, Gaetan de Menten wrote:
> > On 6/3/07, Michael Bayer <[EMAIL PROTECTED]> wrote: > >> - the methods select(), selectfirst(), selectone(), select_by(), >> selectfirst_by(), selectone_by() and get_by() would be deprecated. >> this means they will remain present on the Query object but the >> documentation would be reorganized to talk only about filter(), >> filter_by(), list(), scalar(), and a new method called one() which is >> like scalar() but ensures that only one row was returned. > > I'm unsure about this but wouldn't "one" be redundant with "scalar" > and [0]? > Couldn't we have only one of either "one" or "scalar" (and have the > check there) and otherwise let people use [0]. > 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). --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---