Enable foreign key constraint checks for Sqlite
Currently OrmLite's Sqlite adapter supports creation of foreign key constraints when using the ForeignKey attribute on your data classes. However the foreign keys aren't actually enforced at the database by default (for 'compatibility reasons').
I don't know when Sqlite added the feature, but it will check constraints if you send a pragma at the start of each connection:
I've tested a simple workaround by sending the pragma as a SQL statement in my service methods), and the constraints are enforced as expected. Cascade deletes work as expected too.
However this isn't optimal if you want your service code to be db-agnostic (it's also a bit inefficient if sent as a separate db request, rather than pre-pended to the first request). It would be great to have this enabled at the dialect level so that developers can use db-agnostic code and patterns related to constraint checks and foreign key delete and update operations, regardless whether they are using Sqlite or the other databases that support foreign keys.