SQLite PRAGMA statements
Pragmas query and change SQLite's settings and internal state: page size, journal mode, foreign keys, integrity checks and more. Each page has the official description and, where it is safe to run, what the pragma returns on the sample database.
| analysis_limit | Query or change a limit on the approximate ANALYZE setting. |
| application_id | The application_id PRAGMA is used to query or set the 32-bit signed big-endian "Application ID" integer located at… |
| auto_vacuum | Query or set the auto-vacuum status in the database. |
| automatic_index | Query, set, or clear the automatic indexing capability. |
| busy_timeout | Query or change the setting of the busy timeout. |
| cache_size | Query or change the suggested maximum number of database disk pages that SQLite will hold in memory at once per open… |
| cache_spill | The cache_spill pragma enables or disables the ability of the pager to spill dirty cache pages to the database file in… |
| case_sensitive_like | The default behavior of the LIKE operator is to ignore case for ASCII characters. deprecated |
| cell_size_check | The cell_size_check pragma enables or disables additional sanity checking on database b-tree pages as they are… |
| checkpoint_fullfsync | Query or change the fullfsync flag for checkpoint operations. |
| collation_list | Return a list of the collating sequences defined for the current database connection. |
| compile_options | This pragma returns the names of compile-time options used when building SQLite, one option per row. |
| count_changes | Query or change the count-changes flag. deprecated |
| data_store_directory | Query or change the value of the sqlite3_data_directory global variable, which windows operating-system interface… deprecated |
| data_version | The "PRAGMA data_version" command provides an indication that the database file has been modified. |
| database_list | This pragma works like a query to return one row for each database attached to the current database connection. |
| default_cache_size | PRAGMA schema.default_cache_size; PRAGMA schema.default_cache_size = Number-of-pages; This pragma queries or sets the… deprecated |
| defer_foreign_keys | When the defer_foreign_keys PRAGMA is on, enforcement of all foreign key constraints is delayed until the outermost… |
| empty_result_callbacks | Query or change the empty-result-callbacks flag. deprecated |
| encoding | In first form, if the main database has already been created, then this pragma returns the text encoding used by the… |
| foreign_key_check | The foreign_key_check pragma checks the database, or the table called "table-name", for foreign key constraints that… |
| foreign_key_list | This pragma returns one row for each foreign key constraint created by a REFERENCES clause in the CREATE TABLE… |
| foreign_keys | Query, set, or clear the enforcement of foreign key constraints. |
| freelist_count | Return the number of unused pages in the database file. |
| full_column_names | Query or change the full_column_names flag. deprecated |
| fullfsync | Query or change the fullfsync flag. |
| function_list | This pragma returns a list of SQL functions known to the database connection. |
| hard_heap_limit | This pragma invokes the sqlite3_hard_heap_limit64() interface with the argument N, if N is specified and N is a… |
| ignore_check_constraints | This pragma enables or disables the enforcement of CHECK constraints. |
| incremental_vacuum | The incremental_vacuum pragma causes up to N pages to be removed from the freelist. |
| index_info | This pragma returns one row for each key column in the named index. |
| index_list | This pragma returns one row for each index associated with the given table. |
| index_xinfo | This pragma returns information about every column in an index. |
| integrity_check | This pragma does a low-level formatting and consistency check of the database. |
| journal_mode | This pragma queries or sets the journal mode for databases associated with the current database connection. |
| journal_size_limit | If a database connection is operating in exclusive locking mode or in persistent journal mode (PRAGMA… |
| legacy_alter_table | This pragma sets or queries the value of the legacy_alter_table flag. |
| legacy_file_format | This pragma no longer functions. |
| locking_mode | This pragma sets or queries the database connection locking-mode. |
| max_page_count | Query or set the maximum number of pages in the database file. |
| mmap_size | Query or change the maximum number of bytes that are set aside for memory-mapped I/O on a single database. |
| module_list | This pragma returns a list of virtual table modules registered with the database connection. |
| optimize | Attempt to optimize the database. |
| page_count | Return the total number of pages in the database file. |
| page_size | Query or set the page size of the database. |
| parser_trace | If SQLite has been compiled with the SQLITE_DEBUG compile-time option, then the parser_trace pragma can be used to turn… only in builds with non-standard options |
| pragma_list | This pragma returns a list of PRAGMA commands known to the database connection. |
| query_only | The query_only pragma prevents data changes on database files when enabled. |
| quick_check | The pragma is like integrity_check except that it does not verify UNIQUE constraints and does not verify that index… |
| read_uncommitted | Query, set, or clear READ UNCOMMITTED isolation. |
| recursive_triggers | Query, set, or clear the recursive trigger capability. |
| reverse_unordered_selects | When enabled, this PRAGMA causes many SELECT statements without an ORDER BY clause to emit their results in the reverse… |
| schema_version | The schema_version pragma will get or set the value of the schema-version integer at offset 40 in the database header. for testing; not for applications |
| secure_delete | Query or change the secure-delete setting. |
| short_column_names | Query or change the short-column-names flag. deprecated |
| shrink_memory | This pragma causes the database connection on which it is invoked to free up as much memory as it can, by calling… |
| soft_heap_limit | This pragma invokes the sqlite3_soft_heap_limit64() interface with the argument N, if N is specified and is a… |
| stats | This pragma returns auxiliary information about tables and indices. for testing; not for applications |
| synchronous | Query or change the setting of the "synchronous" flag. |
| table_info | This pragma returns one row for each normal column in the named table. |
| table_list | This pragma returns information about the tables and views in the schema, one table per row of output. |
| table_xinfo | This pragma returns one row for each column in the named table, including generated columns and hidden columns. |
| temp_store | Query or change the setting of the "temp_store" parameter. |
| temp_store_directory | Query or change the value of the sqlite3_temp_directory global variable, which many operating-system interface backends… deprecated |
| threads | Query or change the value of the sqlite3_limit(db,SQLITE_LIMIT_WORKER_THREADS,...) limit for the current database… |
| trusted_schema | The trusted_schema setting is a per-connection boolean that determines whether or not SQL functions and virtual tables… |
| user_version | The user_version pragma will get or set the value of the user-version integer at offset 60 in the database header. |
| vdbe_addoptrace | If SQLite has been compiled with the SQLITE_DEBUG compile-time option, then the vdbe_addoptrace pragma can be used to… only in builds with non-standard options |
| vdbe_debug | If SQLite has been compiled with the SQLITE_DEBUG compile-time option, then the vdbe_debug pragma is a shorthand for… only in builds with non-standard options |
| vdbe_listing | If SQLite has been compiled with the SQLITE_DEBUG compile-time option, then the vdbe_listing pragma can be used to… only in builds with non-standard options |
| vdbe_trace | If SQLite has been compiled with the SQLITE_DEBUG compile-time option, then the vdbe_trace pragma can be used to cause… only in builds with non-standard options |
| wal_autocheckpoint | This pragma queries or sets the write-ahead log auto-checkpoint interval. |
| wal_checkpoint | If the write-ahead log is enabled (via the journal_mode pragma), this pragma causes a checkpoint operation to run on… |
| writable_schema | When this pragma is on, and the SQLITE_DBCONFIG_DEFENSIVE flag is off, then the sqlite_schema table can be changed… for testing; not for applications |