Since the SQLite database plugin is being worked on for 2013R1 anyway, I thought it a good idea to post this here…
I assume the SQLite plugin is compiled with the ability to support Foreign key Constraints. Even so as of now SQLite defaults to not using them. You have to execute a PRAGMA with each connection to enable them. Why you would not want them on all the time I don’t know.
In any case I certainly don’t want old code to break, but it makes sense to have this taken care of for us so we don’t forget to turn it on or have to subclass the DB class just for this.
What I propose is an enum property called ForeignKeySupport on the SQLite database class with the following values:
Default ’ Whatever that version of SQLite defaults to
If the property was set to ‘On’ or ‘Off’ (BUT NOT to ‘Default’), on a successful connection, the connect method would then execute the PRAGMA with that value.
An optional additional enhancement to that for more flexibility could be to add an optional parameter (ForeignKeySupport) to the connect method.
Here Default could mean default to the setting of the Database ForeignKeySupport property