mercredi 27 mai 2015

Why are Recursive Triggers disabled in a 3.8.8.3 database where I did *not* specify the pragma?

According to the SQLite docs, as of version 3.7.0, recursive triggers are supposed to be enabled by default. However, when I open a conncetion to a database with the version 3.8.8.3 using System.Data.SQLite core (from NuGet) and check the pragma, they are set to '0' or off, and sure enough, they do not fire recursively.

If I open up the database in something like Sqlite Browser, there too it shows the pragma as being set to off. I can enable them in the UI, but as soon as I close, then re-open the database, they are off again. WTF?!!

I have even tried adding "PRAGMA RECURSIVE_TRIGGERS = 1;" to the connection string, which does seem to be parsed, but not applied. I say that because if I change it to say "RECURSIVE_TRIGGERSX" it throws an error, meaning it is doing something. What it's not doing however is applying the pragma.

I also looked at the SQLiteConnectionStringBuilder and while it does have a reference for other pragma-related things such as Binary GUIDs, it does not have a reference to recursive triggers.

This is breaking our application.

Our only solution is to manually edit every single SQL query the app is using to add the pragma, which is a real bitch!

So... can anyone help me figure out why recursive triggers are not being enabled by default?

Aucun commentaire:

Enregistrer un commentaire