On 9 Mar 2018, at 7:49pm, John Found <johnfo...@asm32.info> wrote:

> In the current implementation "insert or replace" behave as the foreign 
> constraint is deferred.
> But according to documentation, all foreign constraints in SQLite are 
> immediate by default.

John,

The documentation suggests that in SQLite foreign keys are not deferred by 
default.  Section 4.2 of

<https://sqlite.org/foreignkeys.html>

talks about this and shows how to set up a foreign key to be deferred:

    create table B (
        aid references A(id) on delete cascade DEFERRABLE INITIALLY DEFERRED, 
        ulti_data)

Assuming you are using atomic commit (not using BEGIN/COMMIT, so SQLite 
"inserts" them around that single statement) I /think/ this should allow your 
code to work the way you intended.

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

Reply via email to