Foreign key support in sqlite 3

I wanted to use a foreign key mechanism for the database. But the tables do not comply with integrity constraints. How can I be sure that my sqlite3 db has foreign key support?

+5
source share
1 answer

Enter the command "PRAGMA foreign_keys" at the sqlite3 prompt and, if it does not return data instead of a single line containing "0" or "1", then the version of SQLite that you use does not support foreign keys (either because it is older than 3.6.19 or because that it was compiled using SQLITE_OMIT_FOREIGN_KEY or SQLITE_OMIT_TRIGGER)

Additional information is available at the link below: http://www.sqlite.org/foreignkeys.html

+8

All Articles