ON DELETE CASCADE not working in SQLite

后端 未结 2 1480
渐次进展
渐次进展 2021-01-23 17:06

In SQLite for iOS (3.7.7) I am running these queries:

PRAGMA foreign_keys = ON;

create table venue(id integer primary key not null, name text not null);

create         


        
相关标签:
2条回答
  • 2021-01-23 17:42

    I followed what Catcall said and it worked for me: setting foreign_keys by running

    stmt.execute("PRAGMA foreign_keys = ON");
    

    each time I establish a connection to the database.

    0 讨论(0)
  • 2021-01-23 17:45

    The problem seems to be the usage of multiple handles in different threads although synchronized. Since sqlite included in iOS is new enough to allow one handle to be used across threads as long as they are properly synchronized, using one single handle instead of several should make this a no-problem. But I would be interested in getting to know how and if someone else solves this problem.

    0 讨论(0)
提交回复
热议问题