Search code examples
sqlitetriggersmissing-features

How to handle a missing feature of SQLite : disable triggers?


How to handle a missing feature of SQLite: disable triggers?

I don't have it stored the name of triggers for a specific table.

For example how can I drop all triggers?
What would you do?


Solution

  • I wrote a very simple extension function to set a boolean value to true or false.

    And a function to retrieve this value (GetAllTriggersOn()).

    With this function I can define all my triggers like:

    CREATE TRIGGER tr_table1_update AFTER UPDATE ON TABLE1 WHEN GetAllTriggersOn()
    BEGIN
        -- ...
    END