Re: [sqlite] Foreign key help

2017-11-28 Thread x
Good stuff Keith. One to archive. From: sqlite-users on behalf of Keith Medcalf Sent: Tuesday, November 28, 2017 4:02:35 PM To: SQLite mailing list Subject: Re: [sqlite] Foreign key help And of course in the command line shell you can and should use .lint

Re: [sqlite] Foreign key help

2017-11-28 Thread Keith Medcalf
And of course in the command line shell you can and should use .lint fkey-indexes to let you know if you are missing any indexes required for efficient foreign-key enforcement operations. It will report missing indexes on the PARENT (table/columns referred to) and on CHILDREN (tables/columns

Re: [sqlite] Foreign key help

2017-11-28 Thread x
Thanks David / Simon. From: sqlite-users on behalf of Simon Slavin Sent: Tuesday, November 28, 2017 3:36:51 PM To: SQLite mailing list Subject: Re: [sqlite] Foreign key help On 28 Nov 2017, at 3:26pm, x wrote: > If I have foreign keys in place but alw

Re: [sqlite] Foreign key help

2017-11-28 Thread David Raymond
Leaves what's there alone and just starts enforcing from when you turn it on. It'll only go actively looking for issues if you do a pragma foreign_key_check; sqlite> pragma foreign_keys = off; sqlite> create table parent (id integer primary key); sqlite> create table child (id integer primary k

Re: [sqlite] Foreign key help

2017-11-28 Thread Simon Slavin
On 28 Nov 2017, at 3:26pm, x wrote: > If I have foreign keys in place but always have foreign_keys = OFF then one > day start SQLite with foreign_keys = ON what happens? Does SQLite suddenly > check all foreign keys and report / delete violations or does it leave > everything as is and just en