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.

+1

> - by removing the word "select" from Query's API entirely, the
> timeless confusion of "sql.select()? or query.select()?" goes away.
> the identifier "select" at last loses its ambiguity.  this is a big win.

For this reason.  SQLAlchemy has too many ways to do the same thing,
and too many ways to access the same object.

I would suggest renaming .list() to .all().  It seems funny having a
method with the same name and same behavior as list(query) -- I can
never decide which to use.

There is the concern about building dozens of intermediate query
objects that you immediately throw away, but that would be a good
target for optimization.  For instance, I'm not sure if it clones a
query by rebuilding the criteria from scratch, or if it just copies
one list of immutable (sharable) objects.  If you can guarantee that
the existing query won't be used anymore you can just reassign (share)
the criteria as single unit, but I guess you can't guarantee that.

> - assignmapper would also keep all of its current methods with
> regards to selecting/filtering.  it seems like tools like Elixir are
> going to move away from assignmapper anyway which is a good thing.

It would still be worth a separate proposal to reform assignmapper;
i.e., delete the query methods .foo() that duplicate
MyClass.query().foo().  A lot of non-Exilir people use assignmapper,
and it's frustrating that .select() exists but .filter() doesn't, so
either add the missing methods or delete the redundant ones.  On the
other hand, this can be handled in the documentation by emphasizing
.query() and deprecating the query methods.

-- 
Mike Orr <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to