How can I list all database triggers in sqlite?

I cannot reset the trigger, but when I try to create a new one with the same name, it warns me that there is a trigger. So, I want to list all the triggers to find out what happened.

+6
source share
1 answer

You can get all the data related to triggers using the sqlite_master table (this includes the ddl code to create them). If you do not want all the data to just leave some of the columns in your query.

For all data:

select * from sqlite_master where type = 'trigger'; 

For a list of names only:

 select name from sqlite_master where type = 'trigger'; 
+19
source

Source: https://habr.com/ru/post/953301/


All Articles