On Dec 6, 7:58 am, Paul Johnston <[EMAIL PROTECTED]> wrote:
>
> >As long as you never use GROUP BY/DISTINCT, or aggregate functions, or
> >non-trivial joins, SQLObject and friends work just fine.
>
> I do use GROUP BY with an ORM  successfully.
...
> DISTINCT doesn't really work with an ORM -

DISTINCT is essentially just a special (albeit common) case of GROUP
BY, so if the latter works well, so does the former. It doesn't work
on the objects, true, but it works fine on the data underneath. If an
ORM supports one better than the other, I think that's just a rather
arbitrary decision on the implementor's part.

> because everything has an
> identity, everything is distinct already.

But that's the case in most relational tables anyway, until you
project a subset of the columns.

> There's still some benefit to
> using SQLAlchemy in non-ORM mode - queries are shorter as they leverage
> the relations defined in the model, and you can mix python values more
> freely into the query, without bind params and such.

I definitely find some benefits to the ORM approach. There are also
some downsides too. As long as it's easy to go straight to the metal
on the occasions that you need it, I think it's ok.

--
Ben Sizer

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

Reply via email to