Does SQLite support foreign keys?
FOREIGN KEY constraints are parsed but are not enforced. However, the equivalent constraint enforcement can be achieved using triggers. The SQLite source tree contains source code and documentation for a C program (genfkey) that will read an SQLite database, analyze the foreign key constraints, and generate appropriate triggers automatically. The readme for the genfkey utility contains more information. As of Version 3.6.12 this feature is incorporated into the CLI. You can read about other possible solutions for foreign key support in the SQLite Wiki. (23) I get a compiler error if I use the SQLITE_OMIT_… compile-time options when building SQLite. The SQLITE_OMIT_… compile-time options only work when building from canonically source files. They do not work when you build from the SQLite amalgamation or from the pre-processed source files. It is possible to build a special amalgamation that will work with a predetermined set of SQLITE_OMIT_… options. Instructions for doing so can