Hello!
In my project I created couple of tables with foreign keys. I enabled them using "PRAGMA foreign_keys = ON;".
Foreign key constraints work when I try to add a row containing non-existent parent element, such query simply gets
ignored without reporting an error. It makes it difficult to debug which query failed and why.
After doing some research on why it happens, I found that foreign key constraint errors are part of "Extended Result Codes",
(don't confuse with "Extended Error Codes"). By default "Extended Result Codes" are disabled as written here: Enable Or Disable Extended Result Codes
In order to enable extended result codes the following function has to be called on the database handle: int sqlite3_extended_result_codes(sqlite3*, int onoff);
Unfortunately I couldn't find an accessor method to get the database handle, so I had to modify your class and add additional
method to it which enables the "Extended Result Codes". It is not the best solution and makes it difficult to share the code
between machines.
Is there a way to enable extended result codes without modifying the SQLite library source?
SQLite is a great library, thank you James for it!
Max