SQLite Forum

How to detect invalid trigger w/o actually running it?
Hi. We've had a mishap with a trigger referencing an unknown table,  
which was detected too late, by internal users. The SQL script doing  
the upgrade (that added the faulty trigger) was run during tests,  
and installed successfully w/o errors, but of course actually using it  
yielded errors.

Validating all triggers at runtime is currently not something we can do...

So is there a way to quickly detect any invalid objects, like triggers,  
views, etc... which does not implies *running* them (via a DML statement)?

Something we could run post-schema-upgrade or post-schema-creation, to  
avoid a repeat of the above mishap?

Thanks, --DD

> PS: Note that we may have [pragma_legacy_alter_table](1), I'm not 100% sure,  
> on the connection doing the upgrade, if that makes a difference.

[1]: https://www.sqlite.org/pragma.html#pragma_legacy_alter_table