On Wed, May 13, 2009 at 17:28, Mykola Paliyenko <[email protected]> wrote:

> Is it possible to have a read-only entities in Elixir, by mapping
> entity to the view not to the table?
> If do how to do it? Just map and not edit?

Hmmm, I don't know if/how SQLAlchemy support views... autoload=True
*might* work, if reflecting a view as a Table is supported in
SQLAlchemy.

> Basically the problem why I need it is that we want to retrieve
> related data for list of entities in one query (now it do it for each
> entity in a list) and map it to the new object, to have no problems
> with data type mapping we want to use new Elixir entity on top of the
> View where all needed fields are present. Is it the best way we can do
> it, or there are better receipts that allow to use DB less heavily.

I'm not sure I understand what you need. You might be able to do what
you are looking for through column_properties and eager loads, as
described at:
http://www.sqlalchemy.org/docs/05/mappers.html#sql-expressions-as-mapped-attributes

http://www.sqlalchemy.org/docs/05/ormtutorial.html#working-with-related-objects

http://www.sqlalchemy.org/docs/05/mappers.html#configuring-loader-strategies-lazy-loading-eager-loading

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