On Sep 9, 2007, at 12:21 PM, Jean-Philippe Dutreve wrote:

> I prefer put constraints in database rather than in application/
> framework because several applications can access
> the same database and applications can gone quicker than DB.

The ORM doesnt get in the way of your placing appropriate constraints  
on the DB.   The reason SA very much wants to maintain referential  
integrity itself only applies to those objects which are currently  
present in the session; and its that it wants the session to mirror  
what's in the database without having to issue extra queries to see  
what the constraints have fired off.  With passive_deletes=True, it  
wont add the overhead of loading anything additional (i.e. things  
that are not already in the session) during a delete operation.  The  
passive_deletes="all" option I just added will, depending on usage,  
produce a session that is not in sync with what the database actually  
has.   Other people have asked for the "dont set NULL" behavior as  
well, since its just a small conditional it wasnt a big deal to add  
(but i bet nobody will use it unless they have some triggering  
scenario in place).

in your case, yes a NOT NULL FK is probably the more straightforward  
way to go but feel free to try out the flag.




--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to