SQLite PRAGMA

PRAGMA trusted_schema

The trusted_schema setting is a per-connection boolean that determines whether or not SQL functions and virtual tables that have not been security audited are allowed to be run by views, triggers, or in expressions of the schema such as CHECK constraints, DEFAULT clauses, generated columns, expressi

PRAGMA trusted_schema;
PRAGMA trusted_schema = boolean;

On the sample database

What PRAGMA trusted_schema returns on the sample database, in SQLite 3.54.1 as built for the browser by sql.js:

trusted_schema
1

What the SQLite documentation says

The trusted_schema setting is a per-connection boolean that determines whether or not SQL functions and virtual tables that have not been security audited are allowed to be run by views, triggers, or in expressions of the schema such as CHECK constraints, DEFAULT clauses, generated columns, expression indexes, and/or partial indexes. This setting can also be controlled using the sqlite3_db_config(db,SQLITE_DBCONFIG_TRUSTED_SCHEMA,...) C-language interface.

In order to maintain backwards compatibility, this setting is ON by default. There are advantages to turning it off, and most applications will be unaffected if it is turned off. For that reason, all applications are encouraged to switch this setting off on every database connection as soon as that connection is opened.

The -DSQLITE_TRUSTED_SCHEMA=0 compile-time option will cause this setting to default to OFF.

From sqlite.org's pragma documentation for SQLite 3.54.1, in the public domain.

← threads · user_version →