2009/2/28 Chris Curvey <[email protected]>:

> this may be more of a SQLAlchemy question, but I'll ask here anyway :)

This is indeed not an Elixir-specific issue, though there is no harm
in asking here. You only have less chances to get your question
answered quickly.

> I have a real simple setup.  I've created an Entity class called Game
> (which relies on a MySQL table called "game").  It's pretty simple,
> just some fields and some many-to-one relationships.  I'm surprised
> that
>
> q = Game.query()
> print q
>
> tells me that there is an "order by game.id" tacked on the end of my
> sql statement.  I don't need that (and because the Game table is
> pretty big, I actively don't want it).
>
> is there a way to suppress this?

Recent versions of SA (0.5.x I *think*) don't have this anymore. And
you can actively supress it with q.order_by(None).

> P.S.  For double points, what I really want is just an iterator that
> goes through the results of the query, without trying to instantiate
> the entire list in memory.

This is what you get if you iterate on the query itself instead of
calling all():

for game in Game.query():
    ....

-- 
Gaëtan de Menten
http://openhex.org

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"SQLElixir" 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/sqlelixir?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to