SQLite User Forum

Recursive Triggers (documentation, 3.39.0)
Login

Recursive Triggers (documentation, 3.39.0)

(1) By anonymous on 2022-07-02 04:29:08 [link] [source]

I'm relatively new to SQLite so I've been wandering through the documentation, and in limits.html it states that trigger recursion was enabled by default since 3.7.0, but using the pre-built Windows 3.39 command-line version, PRAGMA recursive_triggers; returns 0, so I'm wondering if I misunderstand it.

Thanks!

T.

(2) By anonymous on 2022-07-02 08:22:09 in reply to 1 [source]

Nosing around in the source and having looked at the PRAGMA recursive_triggers manual section, it seems like the statement about it being the default mentioned in limits.html is probably not correct.

One complicating factor is that PRAGMA compile_options; shows:

DEFAULT_RECURSIVE_TRIGGERS

as being included in the compile options, even though it was likely not included but was defined to be 0 as a default which results in the compile_options inclusion but not actually having the feature enabled. The compile options list is built using #ifdef but the code uses #if to actually evaluate whether to enable the feature, and the one is true but the other is false (by default).

So it's pretty clear to me now that the Recursive Triggers feature is OFF by default, but the limits.html text along with the PRAGMA compile_options; output might lead one to believe otherwise.

Maybe an opportunity for small improvements.