Ian wrote:
>
> Is there any way to customize the mapper-generated queries used for
> persisting objects?  My specific case is that I would like to have the
> ORM call a stored procedure for inserts and updates rather than the
> usual insert and update statements.

in a way that is transparent within the ORM, not currently.   you can of
course issue SQL directly via Session.execute() or similar, though this is
tricky with the ORM since you'd have to expire() the object afterwards so
that its new values are loaded.

There's a proposal #1518 in trac to allow an extension system to allow
custom persistence methods.  It talks about non-relational databases but
it would apply equally well to any kind of overriding of _save_obj() or
_delete_obj().

if you were truly adventurous you might try subclassing Mapper and
overriding _save_obj() directly, but there's probably a lot of
complexities to that (hence the enhancement proposal to make it easy).



>
> Thanks,
> Ian
> >
>


--~--~---------~--~----~------------~-------~--~----~
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 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to