Hi,

I would like to be able to map an Entity against an arbitrary select,
as can be done in plain sqlalchemy :

http://www.sqlalchemy.org/docs/05/mappers.html#mapping-a-class-against-arbitrary-selects

It is my understanding that this is currently not possible with
Elixir,
and cumbersome to setup in sqlalchemy when using Elixir ??

Looking at the Elixir code, I seems possible to create an
additional argument to using options to specify the select, which
would result in code like :

class Customer(Entity):
    using_options(select=lambda:Organization.table.join
(Purchases.table))

and then process this argument in EntityDescriptor.setup_mapper

Would that be a good move ?
Would it be likely that such a patch gets accepted ?

The only alternative I see today is creating views, in the database,
and map Entities
to those views.  This works fine, but it is a lot of hard work to
manage those views
as the source changes.

Thx,

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