(Sorry, hit 'Send' before I meant to.)

On 6 Jul 2009, at 6:34am, James Gregurich wrote:

> a question for the sqlite developers.
>
> The inability of "INSERT OR REPLACE" to maintain referential integrity
> leaves me with no mechanism to implement a feature in my project that
> I was intending to provide.  Are there any plans to add in the
> functionality for "INSERT OR REPLACE" to call delete triggers so that
> referential integrity can be maintained?

It should not call DELETE triggers since it never deletes.  It should  
call either INSERT triggers or UPDATE triggers depending on which one  
it decides to do.

In the meantime, you can do the same thing yourself: instead of  
calling INSERT OR REPLACE, test to see which one would happen then  
call either INSERT or UPDATE.  Or do the INSERT, allow it to fail if  
it will, then do the UPDATE.  The triggers on both of those  
combinations will work correctly.

Simon.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to