2013-09-13 20:36:46 +04:00
|
|
|
#!/usr/bin/tclsh
|
|
|
|
#
|
|
|
|
# Run this script to generate the pragma name lookup table C code.
|
|
|
|
#
|
|
|
|
# To add new pragmas, first add the name and other relevant attributes
|
|
|
|
# of the pragma to the "pragma_def" object below. Then run this script
|
2015-02-03 00:34:54 +03:00
|
|
|
# to generate the ../src/pragma.h header file that contains macros and
|
|
|
|
# the lookup table needed for pragma name lookup in the pragma.c module.
|
2013-09-13 20:36:46 +04:00
|
|
|
# Then add the extra "case PragTyp_XXXXX:" and subsequent code for the
|
2015-02-03 00:34:54 +03:00
|
|
|
# new pragma in ../src/pragma.c.
|
2013-09-13 20:36:46 +04:00
|
|
|
#
|
|
|
|
|
2016-12-15 19:01:17 +03:00
|
|
|
# Flag meanings:
|
|
|
|
set flagMeaning(NeedSchema) {Force schema load before running}
|
|
|
|
set flagMeaning(ReadOnly) {Read-only HEADER_VALUE}
|
|
|
|
set flagMeaning(Result0) {Acts as query when no argument}
|
|
|
|
set flagMeaning(Result1) {Acts as query when has one argument}
|
|
|
|
set flagMeaning(SchemaReq) {Schema required - "main" is default}
|
|
|
|
set flagMeaning(SchemaOpt) {Schema restricts name search if present}
|
|
|
|
set flagMeaning(NoColumns) {OP_ResultRow called with zero columns}
|
2017-01-05 22:32:48 +03:00
|
|
|
set flagMeaning(NoColumns1) {zero columns if RHS argument is present}
|
2016-12-15 19:01:17 +03:00
|
|
|
|
2013-09-13 20:36:46 +04:00
|
|
|
set pragma_def {
|
|
|
|
NAME: full_column_names
|
|
|
|
TYPE: FLAG
|
|
|
|
ARG: SQLITE_FullColNames
|
2013-10-22 03:17:23 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
|
2013-09-13 20:36:46 +04:00
|
|
|
|
|
|
|
NAME: short_column_names
|
|
|
|
TYPE: FLAG
|
|
|
|
ARG: SQLITE_ShortColNames
|
2013-10-22 03:17:23 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
|
2013-09-13 20:36:46 +04:00
|
|
|
|
|
|
|
NAME: count_changes
|
|
|
|
TYPE: FLAG
|
|
|
|
ARG: SQLITE_CountRows
|
2013-10-22 03:17:23 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
|
2013-09-13 20:36:46 +04:00
|
|
|
|
|
|
|
NAME: empty_result_callbacks
|
|
|
|
TYPE: FLAG
|
|
|
|
ARG: SQLITE_NullCallback
|
2013-10-22 03:17:23 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
|
2013-09-13 20:36:46 +04:00
|
|
|
|
|
|
|
NAME: legacy_file_format
|
|
|
|
TYPE: FLAG
|
|
|
|
ARG: SQLITE_LegacyFileFmt
|
2013-10-22 03:17:23 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
|
2013-09-13 20:36:46 +04:00
|
|
|
|
|
|
|
NAME: fullfsync
|
|
|
|
TYPE: FLAG
|
|
|
|
ARG: SQLITE_FullFSync
|
2013-10-22 03:17:23 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
|
2013-09-13 20:36:46 +04:00
|
|
|
|
|
|
|
NAME: checkpoint_fullfsync
|
|
|
|
TYPE: FLAG
|
|
|
|
ARG: SQLITE_CkptFullFSync
|
2013-10-22 03:17:23 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
|
2013-09-13 20:36:46 +04:00
|
|
|
|
|
|
|
NAME: cache_spill
|
2017-01-05 22:32:48 +03:00
|
|
|
FLAG: Result0 SchemaReq NoColumns1
|
2013-10-22 03:17:23 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
|
2013-09-13 20:36:46 +04:00
|
|
|
|
|
|
|
NAME: reverse_unordered_selects
|
|
|
|
TYPE: FLAG
|
|
|
|
ARG: SQLITE_ReverseOrder
|
2013-10-22 03:17:23 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
|
2013-09-13 20:36:46 +04:00
|
|
|
|
|
|
|
NAME: query_only
|
|
|
|
TYPE: FLAG
|
|
|
|
ARG: SQLITE_QueryOnly
|
2013-10-22 03:17:23 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
|
2013-09-13 20:36:46 +04:00
|
|
|
|
|
|
|
NAME: automatic_index
|
|
|
|
TYPE: FLAG
|
|
|
|
ARG: SQLITE_AutoIndex
|
2013-10-22 03:17:23 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_AUTOMATIC_INDEX)
|
|
|
|
|
|
|
|
NAME: sql_trace
|
|
|
|
TYPE: FLAG
|
|
|
|
ARG: SQLITE_SqlTrace
|
2013-10-22 03:17:23 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: defined(SQLITE_DEBUG)
|
|
|
|
|
|
|
|
NAME: vdbe_listing
|
|
|
|
TYPE: FLAG
|
|
|
|
ARG: SQLITE_VdbeListing
|
2013-10-22 03:17:23 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: defined(SQLITE_DEBUG)
|
|
|
|
|
|
|
|
NAME: vdbe_trace
|
|
|
|
TYPE: FLAG
|
|
|
|
ARG: SQLITE_VdbeTrace
|
2013-10-22 03:17:23 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: defined(SQLITE_DEBUG)
|
|
|
|
|
|
|
|
NAME: vdbe_addoptrace
|
|
|
|
TYPE: FLAG
|
|
|
|
ARG: SQLITE_VdbeAddopTrace
|
2013-10-22 03:17:23 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: defined(SQLITE_DEBUG)
|
|
|
|
|
|
|
|
NAME: vdbe_debug
|
|
|
|
TYPE: FLAG
|
|
|
|
ARG: SQLITE_SqlTrace|SQLITE_VdbeListing|SQLITE_VdbeTrace
|
2013-10-22 03:17:23 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: defined(SQLITE_DEBUG)
|
|
|
|
|
2013-11-13 21:58:23 +04:00
|
|
|
NAME: vdbe_eqp
|
|
|
|
TYPE: FLAG
|
|
|
|
ARG: SQLITE_VdbeEQP
|
|
|
|
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
|
|
|
|
IF: defined(SQLITE_DEBUG)
|
|
|
|
|
2013-09-13 20:36:46 +04:00
|
|
|
NAME: ignore_check_constraints
|
|
|
|
TYPE: FLAG
|
|
|
|
ARG: SQLITE_IgnoreChecks
|
2013-10-22 03:17:23 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_CHECK)
|
|
|
|
|
|
|
|
NAME: writable_schema
|
|
|
|
TYPE: FLAG
|
2017-06-26 16:57:49 +03:00
|
|
|
ARG: SQLITE_WriteSchema
|
2013-10-22 03:17:23 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
|
2013-09-13 20:36:46 +04:00
|
|
|
|
|
|
|
NAME: read_uncommitted
|
|
|
|
TYPE: FLAG
|
2017-06-26 16:57:49 +03:00
|
|
|
ARG: SQLITE_ReadUncommit
|
2013-10-22 03:17:23 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
|
2013-09-13 20:36:46 +04:00
|
|
|
|
|
|
|
NAME: recursive_triggers
|
|
|
|
TYPE: FLAG
|
|
|
|
ARG: SQLITE_RecTriggers
|
2013-10-22 03:17:23 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
|
2013-09-13 20:36:46 +04:00
|
|
|
|
|
|
|
NAME: foreign_keys
|
|
|
|
TYPE: FLAG
|
|
|
|
ARG: SQLITE_ForeignKeys
|
2013-10-22 03:17:23 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)
|
|
|
|
|
|
|
|
NAME: defer_foreign_keys
|
|
|
|
TYPE: FLAG
|
|
|
|
ARG: SQLITE_DeferFKs
|
2013-10-22 03:17:23 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FLAG_PRAGMAS)
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)
|
|
|
|
|
2015-05-27 06:46:18 +03:00
|
|
|
NAME: cell_size_check
|
|
|
|
TYPE: FLAG
|
|
|
|
ARG: SQLITE_CellSizeCk
|
|
|
|
|
2013-09-13 20:36:46 +04:00
|
|
|
NAME: default_cache_size
|
2017-01-05 22:32:48 +03:00
|
|
|
FLAG: NeedSchema Result0 SchemaReq NoColumns1
|
2016-12-15 19:01:17 +03:00
|
|
|
COLS: cache_size
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_PAGER_PRAGMAS) && !defined(SQLITE_OMIT_DEPRECATED)
|
|
|
|
|
|
|
|
NAME: page_size
|
2017-01-05 22:32:48 +03:00
|
|
|
FLAG: Result0 SchemaReq NoColumns1
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_PAGER_PRAGMAS)
|
|
|
|
|
|
|
|
NAME: secure_delete
|
2016-12-15 19:01:17 +03:00
|
|
|
FLAG: Result0
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_PAGER_PRAGMAS)
|
|
|
|
|
|
|
|
NAME: page_count
|
2016-12-15 19:01:17 +03:00
|
|
|
FLAG: NeedSchema Result0 SchemaReq
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_PAGER_PRAGMAS)
|
|
|
|
|
|
|
|
NAME: max_page_count
|
|
|
|
TYPE: PAGE_COUNT
|
2016-12-15 19:01:17 +03:00
|
|
|
FLAG: NeedSchema Result0 SchemaReq
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_PAGER_PRAGMAS)
|
|
|
|
|
|
|
|
NAME: locking_mode
|
2016-12-15 19:01:17 +03:00
|
|
|
FLAG: Result0 SchemaReq
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_PAGER_PRAGMAS)
|
|
|
|
|
|
|
|
NAME: journal_mode
|
2016-12-15 19:01:17 +03:00
|
|
|
FLAG: NeedSchema Result0 SchemaReq
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_PAGER_PRAGMAS)
|
|
|
|
|
|
|
|
NAME: journal_size_limit
|
2016-12-15 19:01:17 +03:00
|
|
|
FLAG: Result0 SchemaReq
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_PAGER_PRAGMAS)
|
|
|
|
|
|
|
|
NAME: cache_size
|
2017-01-05 22:32:48 +03:00
|
|
|
FLAG: NeedSchema Result0 SchemaReq NoColumns1
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_PAGER_PRAGMAS)
|
|
|
|
|
|
|
|
NAME: mmap_size
|
|
|
|
IF: !defined(SQLITE_OMIT_PAGER_PRAGMAS)
|
|
|
|
|
|
|
|
NAME: auto_vacuum
|
2017-01-05 22:32:48 +03:00
|
|
|
FLAG: NeedSchema Result0 SchemaReq NoColumns1
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_AUTOVACUUM)
|
|
|
|
|
|
|
|
NAME: incremental_vacuum
|
2016-12-15 19:01:17 +03:00
|
|
|
FLAG: NeedSchema NoColumns
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_AUTOVACUUM)
|
|
|
|
|
|
|
|
NAME: temp_store
|
2017-01-05 22:32:48 +03:00
|
|
|
FLAG: Result0 NoColumns1
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_PAGER_PRAGMAS)
|
|
|
|
|
|
|
|
NAME: temp_store_directory
|
2017-01-05 22:32:48 +03:00
|
|
|
FLAG: NoColumns1
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_PAGER_PRAGMAS)
|
|
|
|
|
|
|
|
NAME: data_store_directory
|
2017-01-05 22:32:48 +03:00
|
|
|
FLAG: NoColumns1
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_PAGER_PRAGMAS) && SQLITE_OS_WIN
|
|
|
|
|
|
|
|
NAME: lock_proxy_file
|
2017-01-05 22:32:48 +03:00
|
|
|
FLAG: NoColumns1
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_PAGER_PRAGMAS) && SQLITE_ENABLE_LOCKING_STYLE
|
|
|
|
|
|
|
|
NAME: synchronous
|
2017-01-05 22:32:48 +03:00
|
|
|
FLAG: NeedSchema Result0 SchemaReq NoColumns1
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_PAGER_PRAGMAS)
|
|
|
|
|
|
|
|
NAME: table_info
|
2016-12-15 19:01:17 +03:00
|
|
|
FLAG: NeedSchema Result1 SchemaOpt
|
|
|
|
COLS: cid name type notnull dflt_value pk
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
|
|
|
|
|
2013-10-13 00:22:00 +04:00
|
|
|
NAME: stats
|
2016-12-15 19:01:17 +03:00
|
|
|
FLAG: NeedSchema Result0 SchemaReq
|
2017-02-17 18:26:36 +03:00
|
|
|
COLS: tbl idx wdth hght flgs
|
2017-02-17 16:38:15 +03:00
|
|
|
IF: !defined(SQLITE_OMIT_SCHEMA_PRAGMAS) && defined(SQLITE_DEBUG)
|
2013-10-13 00:22:00 +04:00
|
|
|
|
2013-09-13 20:36:46 +04:00
|
|
|
NAME: index_info
|
2015-01-31 05:00:01 +03:00
|
|
|
TYPE: INDEX_INFO
|
|
|
|
ARG: 0
|
2016-12-15 19:01:17 +03:00
|
|
|
FLAG: NeedSchema Result1 SchemaOpt
|
|
|
|
COLS: seqno cid name
|
2015-01-31 05:00:01 +03:00
|
|
|
IF: !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
|
|
|
|
|
|
|
|
NAME: index_xinfo
|
|
|
|
TYPE: INDEX_INFO
|
|
|
|
ARG: 1
|
2016-12-15 19:01:17 +03:00
|
|
|
FLAG: NeedSchema Result1 SchemaOpt
|
|
|
|
COLS: seqno cid name desc coll key
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
|
|
|
|
|
|
|
|
NAME: index_list
|
2016-12-15 19:01:17 +03:00
|
|
|
FLAG: NeedSchema Result1 SchemaOpt
|
|
|
|
COLS: seq name unique origin partial
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
|
|
|
|
|
|
|
|
NAME: database_list
|
2016-12-15 19:01:17 +03:00
|
|
|
FLAG: NeedSchema Result0
|
|
|
|
COLS: seq name file
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
|
|
|
|
|
2017-07-07 18:43:22 +03:00
|
|
|
NAME: function_list
|
|
|
|
FLAG: Result0
|
|
|
|
COLS: name builtin
|
|
|
|
IF: !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
|
2017-07-07 20:33:07 +03:00
|
|
|
IF: defined(SQLITE_INTROSPECTION_PRAGMAS)
|
2017-07-07 18:43:22 +03:00
|
|
|
|
|
|
|
NAME: module_list
|
|
|
|
FLAG: Result0
|
|
|
|
COLS: name
|
|
|
|
IF: !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
|
|
|
|
IF: !defined(SQLITE_OMIT_VIRTUALTABLE)
|
2017-07-07 20:33:07 +03:00
|
|
|
IF: defined(SQLITE_INTROSPECTION_PRAGMAS)
|
|
|
|
|
|
|
|
NAME: pragma_list
|
|
|
|
FLAG: Result0
|
|
|
|
COLS: name
|
|
|
|
IF: defined(SQLITE_INTROSPECTION_PRAGMAS)
|
2017-07-07 18:43:22 +03:00
|
|
|
|
2013-09-13 20:36:46 +04:00
|
|
|
NAME: collation_list
|
2016-12-15 19:01:17 +03:00
|
|
|
FLAG: Result0
|
|
|
|
COLS: seq name
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_SCHEMA_PRAGMAS)
|
|
|
|
|
|
|
|
NAME: foreign_key_list
|
2016-12-15 19:01:17 +03:00
|
|
|
FLAG: NeedSchema Result1 SchemaOpt
|
|
|
|
COLS: id seq table from to on_update on_delete match
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FOREIGN_KEY)
|
|
|
|
|
|
|
|
NAME: foreign_key_check
|
2017-06-21 04:36:30 +03:00
|
|
|
FLAG: NeedSchema Result0
|
2016-12-15 19:01:17 +03:00
|
|
|
COLS: table rowid parent fkid
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_FOREIGN_KEY) && !defined(SQLITE_OMIT_TRIGGER)
|
|
|
|
|
|
|
|
NAME: parser_trace
|
2015-12-15 16:50:22 +03:00
|
|
|
IF: defined(SQLITE_DEBUG) && !defined(SQLITE_OMIT_PARSER_TRACE)
|
2013-09-13 20:36:46 +04:00
|
|
|
|
|
|
|
NAME: case_sensitive_like
|
2017-01-06 16:49:40 +03:00
|
|
|
FLAG: NoColumns
|
2013-09-13 20:36:46 +04:00
|
|
|
|
|
|
|
NAME: integrity_check
|
2017-06-21 04:36:30 +03:00
|
|
|
FLAG: NeedSchema Result0 Result1
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_INTEGRITY_CHECK)
|
|
|
|
|
|
|
|
NAME: quick_check
|
|
|
|
TYPE: INTEGRITY_CHECK
|
2017-06-21 04:36:30 +03:00
|
|
|
FLAG: NeedSchema Result0 Result1
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_INTEGRITY_CHECK)
|
|
|
|
|
|
|
|
NAME: encoding
|
2017-01-05 22:32:48 +03:00
|
|
|
FLAG: Result0 NoColumns1
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_UTF16)
|
|
|
|
|
|
|
|
NAME: schema_version
|
|
|
|
TYPE: HEADER_VALUE
|
2014-12-19 21:49:55 +03:00
|
|
|
ARG: BTREE_SCHEMA_VERSION
|
2017-01-05 22:32:48 +03:00
|
|
|
FLAG: NoColumns1 Result0
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
|
|
|
|
|
|
|
|
NAME: user_version
|
|
|
|
TYPE: HEADER_VALUE
|
2014-12-19 21:49:55 +03:00
|
|
|
ARG: BTREE_USER_VERSION
|
2017-01-05 22:32:48 +03:00
|
|
|
FLAG: NoColumns1 Result0
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
|
|
|
|
|
2014-12-19 22:28:02 +03:00
|
|
|
NAME: data_version
|
|
|
|
TYPE: HEADER_VALUE
|
|
|
|
ARG: BTREE_DATA_VERSION
|
2017-01-05 22:32:48 +03:00
|
|
|
FLAG: ReadOnly Result0
|
2014-12-19 22:28:02 +03:00
|
|
|
IF: !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
|
|
|
|
|
2013-09-13 20:36:46 +04:00
|
|
|
NAME: freelist_count
|
|
|
|
TYPE: HEADER_VALUE
|
2014-12-19 21:49:55 +03:00
|
|
|
ARG: BTREE_FREE_PAGE_COUNT
|
2017-01-05 22:32:48 +03:00
|
|
|
FLAG: ReadOnly Result0
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
|
|
|
|
|
|
|
|
NAME: application_id
|
|
|
|
TYPE: HEADER_VALUE
|
2014-12-19 21:49:55 +03:00
|
|
|
ARG: BTREE_APPLICATION_ID
|
2017-01-05 22:32:48 +03:00
|
|
|
FLAG: NoColumns1 Result0
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS)
|
|
|
|
|
|
|
|
NAME: compile_options
|
2016-12-15 19:01:17 +03:00
|
|
|
FLAG: Result0
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_COMPILEOPTION_DIAGS)
|
|
|
|
|
|
|
|
NAME: wal_checkpoint
|
2013-10-03 18:08:07 +04:00
|
|
|
FLAG: NeedSchema
|
2016-12-15 19:01:17 +03:00
|
|
|
COLS: busy log checkpointed
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: !defined(SQLITE_OMIT_WAL)
|
|
|
|
|
|
|
|
NAME: wal_autocheckpoint
|
|
|
|
IF: !defined(SQLITE_OMIT_WAL)
|
|
|
|
|
|
|
|
NAME: shrink_memory
|
2017-01-06 16:49:40 +03:00
|
|
|
FLAG: NoColumns
|
2013-09-13 20:36:46 +04:00
|
|
|
|
|
|
|
NAME: busy_timeout
|
2016-12-15 19:01:17 +03:00
|
|
|
FLAG: Result0
|
|
|
|
COLS: timeout
|
2013-09-13 20:36:46 +04:00
|
|
|
|
|
|
|
NAME: lock_status
|
2016-12-15 19:01:17 +03:00
|
|
|
FLAG: Result0
|
|
|
|
COLS: database status
|
2013-09-13 20:36:46 +04:00
|
|
|
IF: defined(SQLITE_DEBUG) || defined(SQLITE_TEST)
|
|
|
|
|
|
|
|
NAME: key
|
|
|
|
IF: defined(SQLITE_HAS_CODEC)
|
|
|
|
|
|
|
|
NAME: rekey
|
|
|
|
IF: defined(SQLITE_HAS_CODEC)
|
|
|
|
|
|
|
|
NAME: hexkey
|
|
|
|
IF: defined(SQLITE_HAS_CODEC)
|
|
|
|
|
2013-10-07 04:36:01 +04:00
|
|
|
NAME: hexrekey
|
|
|
|
TYPE: HEXKEY
|
|
|
|
IF: defined(SQLITE_HAS_CODEC)
|
|
|
|
|
2013-09-13 20:36:46 +04:00
|
|
|
NAME: activate_extensions
|
|
|
|
IF: defined(SQLITE_HAS_CODEC) || defined(SQLITE_ENABLE_CEROD)
|
2013-09-14 01:01:56 +04:00
|
|
|
|
|
|
|
NAME: soft_heap_limit
|
2016-12-15 19:01:17 +03:00
|
|
|
FLAG: Result0
|
2014-08-25 19:13:22 +04:00
|
|
|
|
|
|
|
NAME: threads
|
2016-12-15 19:01:17 +03:00
|
|
|
FLAG: Result0
|
2017-02-17 19:26:34 +03:00
|
|
|
|
2017-02-22 23:24:10 +03:00
|
|
|
NAME: optimize
|
2017-04-03 16:33:51 +03:00
|
|
|
FLAG: Result1 NeedSchema
|
2013-09-13 20:36:46 +04:00
|
|
|
}
|
2015-02-03 00:34:54 +03:00
|
|
|
|
|
|
|
# Open the output file
|
|
|
|
#
|
|
|
|
set destfile "[file dir [file dir [file normal $argv0]]]/src/pragma.h"
|
|
|
|
puts "Overwriting $destfile with new pragma table..."
|
|
|
|
set fd [open $destfile wb]
|
|
|
|
puts $fd {/* DO NOT EDIT!
|
|
|
|
** This file is automatically generated by the script at
|
|
|
|
** ../tool/mkpragmatab.tcl. To update the set of pragmas, edit
|
|
|
|
** that script and rerun it.
|
|
|
|
*/}
|
|
|
|
|
|
|
|
# Parse the PRAGMA table above.
|
|
|
|
#
|
2013-09-13 20:36:46 +04:00
|
|
|
set name {}
|
|
|
|
set type {}
|
|
|
|
set if {}
|
2013-10-03 18:08:07 +04:00
|
|
|
set flags {}
|
2016-12-15 19:01:17 +03:00
|
|
|
set cols {}
|
|
|
|
set cols_list {}
|
2013-09-13 20:36:46 +04:00
|
|
|
set arg 0
|
|
|
|
proc record_one {} {
|
2016-12-15 19:01:17 +03:00
|
|
|
global name type if arg allbyname typebyif flags cols allcols
|
|
|
|
global cols_list colUsedBy
|
2013-09-13 20:36:46 +04:00
|
|
|
if {$name==""} return
|
2016-12-15 19:01:17 +03:00
|
|
|
if {$cols!=""} {
|
|
|
|
if {![info exists allcols($cols)]} {
|
|
|
|
lappend cols_list $cols
|
|
|
|
set allcols($cols) [llength $cols_list]
|
|
|
|
}
|
|
|
|
set cx $allcols($cols)
|
|
|
|
lappend colUsedBy($cols) $name
|
|
|
|
} else {
|
|
|
|
set cx 0
|
|
|
|
}
|
|
|
|
set allbyname($name) [list $type $arg $if $flags $cx]
|
2013-09-13 20:36:46 +04:00
|
|
|
set name {}
|
|
|
|
set type {}
|
|
|
|
set if {}
|
2013-10-03 18:08:07 +04:00
|
|
|
set flags {}
|
2016-12-15 19:01:17 +03:00
|
|
|
set cols {}
|
2013-09-13 20:36:46 +04:00
|
|
|
set arg 0
|
|
|
|
}
|
|
|
|
foreach line [split $pragma_def \n] {
|
|
|
|
set line [string trim $line]
|
|
|
|
if {$line==""} continue
|
|
|
|
foreach {id val} [split $line :] break
|
|
|
|
set val [string trim $val]
|
|
|
|
if {$id=="NAME"} {
|
|
|
|
record_one
|
|
|
|
set name $val
|
|
|
|
set type [string toupper $val]
|
|
|
|
} elseif {$id=="TYPE"} {
|
|
|
|
set type $val
|
2016-12-15 19:01:17 +03:00
|
|
|
if {$type=="FLAG"} {
|
2017-01-05 22:32:48 +03:00
|
|
|
lappend flags Result0 NoColumns1
|
2016-12-15 19:01:17 +03:00
|
|
|
}
|
2013-09-13 20:36:46 +04:00
|
|
|
} elseif {$id=="ARG"} {
|
|
|
|
set arg $val
|
2016-12-15 19:01:17 +03:00
|
|
|
} elseif {$id=="COLS"} {
|
|
|
|
set cols $val
|
2013-09-13 20:36:46 +04:00
|
|
|
} elseif {$id=="IF"} {
|
2013-10-22 03:17:23 +04:00
|
|
|
lappend if $val
|
2013-10-03 18:08:07 +04:00
|
|
|
} elseif {$id=="FLAG"} {
|
|
|
|
foreach term [split $val] {
|
|
|
|
lappend flags $term
|
|
|
|
set allflags($term) 1
|
|
|
|
}
|
2013-09-13 20:36:46 +04:00
|
|
|
} else {
|
|
|
|
error "bad pragma_def line: $line"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
record_one
|
|
|
|
set allnames [lsort [array names allbyname]]
|
|
|
|
|
|
|
|
# Generate #defines for all pragma type names. Group the pragmas that are
|
|
|
|
# omit in default builds (defined(SQLITE_DEBUG) and defined(SQLITE_HAS_CODEC))
|
|
|
|
# at the end.
|
|
|
|
#
|
2016-12-15 19:01:17 +03:00
|
|
|
puts $fd "\n/* The various pragma types */"
|
2013-09-13 20:36:46 +04:00
|
|
|
set pnum 0
|
|
|
|
foreach name $allnames {
|
|
|
|
set type [lindex $allbyname($name) 0]
|
|
|
|
if {[info exists seentype($type)]} continue
|
|
|
|
set if [lindex $allbyname($name) 2]
|
|
|
|
if {[regexp SQLITE_DEBUG $if] || [regexp SQLITE_HAS_CODEC $if]} continue
|
|
|
|
set seentype($type) 1
|
2015-02-03 00:34:54 +03:00
|
|
|
puts $fd [format {#define %-35s %4d} PragTyp_$type $pnum]
|
2013-09-13 20:36:46 +04:00
|
|
|
incr pnum
|
|
|
|
}
|
|
|
|
foreach name $allnames {
|
|
|
|
set type [lindex $allbyname($name) 0]
|
|
|
|
if {[info exists seentype($type)]} continue
|
|
|
|
set if [lindex $allbyname($name) 2]
|
|
|
|
if {[regexp SQLITE_DEBUG $if]} continue
|
|
|
|
set seentype($type) 1
|
2015-02-03 00:34:54 +03:00
|
|
|
puts $fd [format {#define %-35s %4d} PragTyp_$type $pnum]
|
2013-09-13 20:36:46 +04:00
|
|
|
incr pnum
|
|
|
|
}
|
|
|
|
foreach name $allnames {
|
|
|
|
set type [lindex $allbyname($name) 0]
|
|
|
|
if {[info exists seentype($type)]} continue
|
|
|
|
set seentype($type) 1
|
2015-02-03 00:34:54 +03:00
|
|
|
puts $fd [format {#define %-35s %4d} PragTyp_$type $pnum]
|
2013-09-13 20:36:46 +04:00
|
|
|
incr pnum
|
|
|
|
}
|
|
|
|
|
2013-10-03 18:08:07 +04:00
|
|
|
# Generate #defines for flags
|
|
|
|
#
|
2016-12-15 19:01:17 +03:00
|
|
|
puts $fd "\n/* Property flags associated with various pragma. */"
|
2013-10-03 18:08:07 +04:00
|
|
|
set fv 1
|
|
|
|
foreach f [lsort [array names allflags]] {
|
2016-12-15 19:01:17 +03:00
|
|
|
puts $fd [format {#define PragFlg_%-10s 0x%02x /* %s */} \
|
|
|
|
$f $fv $flagMeaning($f)]
|
2013-10-03 18:08:07 +04:00
|
|
|
set fv [expr {$fv*2}]
|
|
|
|
}
|
|
|
|
|
2016-12-15 19:01:17 +03:00
|
|
|
# Generate the array of column names used by pragmas that act like
|
|
|
|
# queries.
|
|
|
|
#
|
|
|
|
puts $fd "\n/* Names of columns for pragmas that return multi-column result"
|
|
|
|
puts $fd "** or that return single-column results where the name of the"
|
|
|
|
puts $fd "** result column is different from the name of the pragma\n*/"
|
|
|
|
puts $fd "static const char *const pragCName\[\] = {"
|
|
|
|
set offset 0
|
|
|
|
foreach cols $cols_list {
|
|
|
|
set cols_offset($allcols($cols)) $offset
|
|
|
|
set ub " /* Used by: $colUsedBy($cols) */"
|
|
|
|
foreach c $cols {
|
|
|
|
puts $fd [format " /* %3d */ %-14s%s" $offset \"$c\", $ub]
|
|
|
|
set ub ""
|
|
|
|
incr offset
|
|
|
|
}
|
|
|
|
}
|
|
|
|
puts $fd "\175;"
|
|
|
|
|
2013-09-13 20:36:46 +04:00
|
|
|
# Generate the lookup table
|
|
|
|
#
|
2016-12-15 19:01:17 +03:00
|
|
|
puts $fd "\n/* Definitions of all built-in pragmas */"
|
2016-12-15 23:59:03 +03:00
|
|
|
puts $fd "typedef struct PragmaName \173"
|
2016-12-15 19:01:17 +03:00
|
|
|
puts $fd " const char *const zName; /* Name of pragma */"
|
|
|
|
puts $fd " u8 ePragTyp; /* PragTyp_XXX value */"
|
|
|
|
puts $fd " u8 mPragFlg; /* Zero or more PragFlg_XXX values */"
|
|
|
|
puts $fd { u8 iPragCName; /* Start of column names in pragCName[] */}
|
|
|
|
puts $fd " u8 nPragCName; \
|
|
|
|
/* Num of col names. 0 means use pragma name */"
|
|
|
|
puts $fd " u32 iArg; /* Extra argument */"
|
2016-12-15 23:59:03 +03:00
|
|
|
puts $fd "\175 PragmaName;"
|
|
|
|
puts $fd "static const PragmaName aPragmaName\[\] = \173"
|
2013-09-13 20:36:46 +04:00
|
|
|
|
|
|
|
set current_if {}
|
|
|
|
set spacer [format { %26s } {}]
|
|
|
|
foreach name $allnames {
|
2016-12-15 19:01:17 +03:00
|
|
|
foreach {type arg if flag cx} $allbyname($name) break
|
|
|
|
if {$cx==0} {
|
|
|
|
set cy 0
|
|
|
|
set nx 0
|
|
|
|
} else {
|
|
|
|
set cy $cols_offset($cx)
|
|
|
|
set nx [llength [lindex $cols_list [expr {$cx-1}]]]
|
|
|
|
}
|
2013-09-13 20:36:46 +04:00
|
|
|
if {$if!=$current_if} {
|
2013-10-22 03:17:23 +04:00
|
|
|
if {$current_if!=""} {
|
|
|
|
foreach this_if $current_if {
|
2015-02-03 00:34:54 +03:00
|
|
|
puts $fd "#endif"
|
2013-10-22 03:17:23 +04:00
|
|
|
}
|
|
|
|
}
|
2013-09-13 20:36:46 +04:00
|
|
|
set current_if $if
|
2013-10-22 03:17:23 +04:00
|
|
|
if {$current_if!=""} {
|
|
|
|
foreach this_if $current_if {
|
2015-02-03 00:34:54 +03:00
|
|
|
puts $fd "#if $this_if"
|
2013-10-22 03:17:23 +04:00
|
|
|
}
|
|
|
|
}
|
2013-09-13 20:36:46 +04:00
|
|
|
}
|
|
|
|
set typex [format PragTyp_%-23s $type,]
|
2013-10-03 18:08:07 +04:00
|
|
|
if {$flag==""} {
|
|
|
|
set flagx "0"
|
2013-09-13 20:36:46 +04:00
|
|
|
} else {
|
2016-12-15 19:01:17 +03:00
|
|
|
set flagx PragFlg_[join $flag {|PragFlg_}]
|
2013-09-13 20:36:46 +04:00
|
|
|
}
|
2016-12-15 19:01:17 +03:00
|
|
|
puts $fd " \173/* zName: */ \"$name\","
|
|
|
|
puts $fd " /* ePragTyp: */ PragTyp_$type,"
|
|
|
|
puts $fd " /* ePragFlg: */ $flagx,"
|
|
|
|
puts $fd " /* ColNames: */ $cy, $nx,"
|
|
|
|
puts $fd " /* iArg: */ $arg \175,"
|
2013-09-13 20:36:46 +04:00
|
|
|
}
|
2013-10-22 03:17:23 +04:00
|
|
|
if {$current_if!=""} {
|
|
|
|
foreach this_if $current_if {
|
2015-02-03 00:34:54 +03:00
|
|
|
puts $fd "#endif"
|
2013-10-22 03:17:23 +04:00
|
|
|
}
|
|
|
|
}
|
2015-02-03 00:34:54 +03:00
|
|
|
puts $fd "\175;"
|
2013-09-13 20:56:17 +04:00
|
|
|
|
|
|
|
# count the number of pragmas, for information purposes
|
|
|
|
#
|
|
|
|
set allcnt 0
|
|
|
|
set dfltcnt 0
|
|
|
|
foreach name $allnames {
|
|
|
|
incr allcnt
|
|
|
|
set if [lindex $allbyname($name) 2]
|
|
|
|
if {[regexp {^defined} $if] || [regexp {[^!]defined} $if]} continue
|
|
|
|
incr dfltcnt
|
|
|
|
}
|
2015-02-03 00:34:54 +03:00
|
|
|
puts $fd "/* Number of pragmas: $dfltcnt on by default, $allcnt total. */"
|