For most purposes, SQLite can be built just fine using the default compilation options. However, if required, the compile-time options documented below can be used to omit SQLite features (resulting in a smaller compiled library size) or to change the default values of some parameters.
Every effort has been made to ensure that the various combinations of compilation options work harmoniously and produce a working library. Nevertheless, it is strongly recommended that the SQLite test-suite be executed to check for errors before using an SQLite library built with non-standard compilation options.
$name
regsub -all "\n\\s*\n" $text "\n\n" text hd_resolve
} COMPILE_OPTION {SQLITE_DEFAULT_AUTOVACUUM=<1 or 0>} { This macro determines if SQLite creates databases with the [auto_vacuum] flag set by default. The default value is 0 (do not create auto-vacuum databases). In any case the compile-time default may be overridden by the [PRAGMA auto_vacuum] command. } COMPILE_OPTION {SQLITE_DEFAULT_CACHE_SIZE=<pages>} { This macro sets the default size of the page-cache for each attached database, in pages. This can be overridden by the [PRAGMA cache_size] comamnd. The default value is 2000. } COMPILE_OPTION {SQLITE_DEFAULT_FILE_FORMAT=<1 or 4>} { The default schema-level file format used by SQLite when creating new database files is set by this macro. The file formats are all very similar. The difference between formats 1 and 4 is that format 4 understands descending indices and has a tighter encoding for boolean values. SQLite (as of [version 3.6.0]) can read and write any file format between 1 and 4. But older versions of SQLite might not be able to read formats greater than 1. So that older versions of SQLite will be able to read and write database files created by newer versions of SQLite, the default file format is set to 1 for maximum compatability. The file format for a new database can be set at runtime using the [PRAGMA legacy_file_format] command. } COMPILE_OPTION {SQLITE_DEFAULT_PAGE_SIZE=<bytes>} { This macro is used to set the default page-size used when a database is created. The value assigned must be a power of 2. The default value is 1024. The compile-time default may be overridden at runtime by the [PRAGMA page_size] command. } COMPILE_OPTION {SQLITE_DEFAULT_TEMP_CACHE_SIZE=<pages>} { This macro sets the default size of the page-cache for temporary files created by SQLite to store intermediate results, in pages. It does not affect the page-cache for the temp database, where tables created using [CREATE TABLE | CREATE TEMP TABLE] are stored. The default value is 500. }$text
There are compile-time options that will set upper bounds on the sizes of various structures in SQLite. The compile-time options normally set a hard upper bound which can be changed at run-time on individual [database connections] using the [sqlite3_limit()] interface.
The compile-time options for setting upper bounds are [limits | documented separately]. The following is a list of the available settings:
SQLITE_TEMP_STORE | Meaning |
---|---|
0 | Always use temporary files |
1 | Use files by default but allow the [PRAGMA temp_store] command to override |
2 | Use memory by default but allow the [PRAGMA temp_store] command to override |
3 | Always use memory |
The following options are used to reduce the size of the compiled library by omiting optional features. This is probably only useful in embedded systems where space is especially tight, as even with all features included the SQLite library is relatively small. Don't forget to tell your compiler to optimize for binary size! (the -Os option if using GCC).
The macros in this section do not require values. The following
compilation switches all have the same effect:
-DSQLITE_OMIT_ALTERTABLE
-DSQLITE_OMIT_ALTERTABLE=1
-DSQLITE_OMIT_ALTERTABLE=0
If any of these options are defined, then the same set of SQLITE_OMIT_XXX options must also be defined when using the 'lemon' tool to generate a parse.c file. Because of this, these options may only used when the library is built from source, not from the collection of pre-packaged C files provided for non-UNIX like platforms on the website.
In the future, this option may also disable other floating point functionality, for example the [sqlite3_result_double()], [sqlite3_bind_double()], [sqlite3_value_double()] and [sqlite3_column_double()] API functions.
} COMPILE_OPTION {SQLITE_OMIT_FOREIGN_KEY} { If this option is defined, FOREIGN KEY clauses in column declarations are ignored. } COMPILE_OPTION {SQLITE_OMIT_INTEGRITY_CHECK} { This option may be used to omit the [integrity_check] PRAGMA. } COMPILE_OPTION {SQLITE_OMIT_MEMORYDB} { When this is defined, the library does not respect the special database name ":memory:" (normally used to create an in-memory database). If ":memory:" is passed to [sqlite3_open()], [sqlite3_open16()], or [sqlite3_open_v2()], a file with this name will be opened or created. } COMPILE_OPTION {SQLITE_OMIT_PAGER_PRAGMAS} { Defining this option omits pragmas related to the pager subsystem from the build. } COMPILE_OPTION {SQLITE_OMIT_PRAGMA} { This option is used to omit the [PRAGMA] command from the library. Note that it is useful to define the macros that omit specific pragmas in addition to this, as they may also remove supporting code in other sub-systems. This macro removes the [PRAGMA] command only. } COMPILE_OPTION {SQLITE_OMIT_PROGRESS_CALLBACK} { This option may be defined to omit the capability to issue "progress" callbacks during long-running SQL statements. The [sqlite3_progress_handler()] API function is not present in the library. } COMPILE_OPTION {SQLITE_OMIT_REINDEX} { When this option is defined, the [REINDEX] command is not included in the library. Executing a [REINDEX] statement causes a parse error. } COMPILE_OPTION {SQLITE_OMIT_SCHEMA_PRAGMAS} { Defining this option omits pragmas for querying the database schema from the build. } COMPILE_OPTION {SQLITE_OMIT_SCHEMA_VERSION_PRAGMAS} { Defining this option omits pragmas for querying and modifying the database schema version and user version from the build. Specifically, the [schema_version] and [user_version] PRAGMAs are omitted. } COMPILE_OPTION {SQLITE_OMIT_SUBQUERY} { If defined, support for sub-selects and the IN() operator are omitted. } COMPILE_OPTION {SQLITE_OMIT_TCL_VARIABLE} { If this macro is defined, then the special "$