SQLite trusted_schema controls indirect schema execution
An SQLite view or trigger can contain an expression that calls an application-defined function. If the database schema is untrusted, opening the database and querying that view may execute the function even though the application never intended to expose it. PRAGMA trusted_schema is the setting that determines whether unaudited functions and virtual tables may be used by schema objects.
The setting applies to functions and virtual tables inside views, triggers, CHECK constraints, DEFAULT clauses, generated columns, expression indexes, and partial indexes. It is per connection and is ON by default for backwards compatibility.…