Small. Fast. Reliable.
Choose any three.

About Sitemap Documentation Download License News Developers Support

## SQLite C Interface

## Configuring The SQLite Library

>     int sqlite3_config(int, ...);

Important: This interface is experimental and is subject to change without notice.

The sqlite3_config() interface is used to make global configuration changes to SQLite in order to tune SQLite to the specific needs of the application. The default configuration is recommended for most applications and so this routine is usually not necessary. It is provided to support rare applications with unusual needs.

The sqlite3_config() interface is not threadsafe. The application must insure that no other SQLite interfaces are invoked by other threads while sqlite3_config() is running. Furthermore, sqlite3_config() may only be invoked prior to library initialization using sqlite3_initialize() or after shutdown by sqlite3_shutdown(). Note, however, that sqlite3_config() can be called as part of the implementation of an application-defined sqlite3_os_init().

The first argument to sqlite3_config() is an integer configuration option that determines what property of SQLite is to be configured. Subsequent arguments vary depending on the configuration option in the first argument.

When a configuration option is set, sqlite3_config() returns SQLITE_OK. If the option is unknown or SQLite is unable to set the option then this routine returns a non-zero error code.

### Invariants:

H14103 | A successful invocation of sqlite3_config() shall return SQLITE_OK.
H14106 | The sqlite3_config() interface shall return SQLITE_MISUSE if it is invoked in between calls to sqlite3_initialize() and sqlite3_shutdown().
H14120 | A successful call to sqlite3_config(SQLITE_CONFIG_SINGLETHREAD) shall set the default threading mode to Single-thread.
H14123 | A successful call to sqlite3_config(SQLITE_CONFIG_MULTITHREAD) shall set the default threading mode to Multi-thread.
H14126 | A successful call to sqlite3_config(SQLITE_CONFIG_SERIALIZED) shall set the default threading mode to Serialized.
H14129 | A successful call to sqlite3_config(SQLITE_CONFIG_MUTEX,X) where X is a pointer to an initialized sqlite3_mutex_methods object shall cause all subsequent mutex operations performed by SQLite to use the mutex methods that were present in X during the call to sqlite3_config().
H14132 | A successful call to sqlite3_config(SQLITE_CONFIG_GETMUTEX,X) where X is a pointer to an sqlite3_mutex_methods object shall overwrite the content of sqlite3_mutex_methods object with the mutex methods currently in use by SQLite.
H14135 | A successful call to sqlite3_config(SQLITE_CONFIG_MALLOC,M) where M is a pointer to an initialized sqlite3_mem_methods object shall cause all subsequent memory allocation operations performed by SQLite to use the methods that were present in M during the call to sqlite3_config().
H14138 | A successful call to sqlite3_config(SQLITE_CONFIG_GETMALLOC,M) where M is a pointer to an sqlite3_mem_methods object shall overwrite the content of sqlite3_mem_methods object with the memory allocation methods currently in use by SQLite.
H14141 | A successful call to sqlite3_config(SQLITE_CONFIG_MEMSTATUS,1) shall enable the memory allocation status collection logic.
H14144 | A successful call to sqlite3_config(SQLITE_CONFIG_MEMSTATUS,0) shall disable the memory allocation status collection logic.
H14147 | The memory allocation status collection logic shall be enabled by default.
H14150 | A successful call to sqlite3_config(SQLITE_CONFIG_SCRATCH,S,Z,N) where Z and N are non-negative integers and S is a pointer to an aligned memory buffer not less than Z*N bytes in size shall cause S to be used by the scratch memory allocator for as many as N simulataneous allocations each of size Z.
H14153 | A successful call to sqlite3_config(SQLITE_CONFIG_SCRATCH,S,Z,N) where S is a NULL pointer shall disable the scratch memory allocator.
H14156 | A successful call to sqlite3_config(SQLITE_CONFIG_PAGECACHE,S,Z,N) where Z and N are non-negative integers and S is a pointer to an aligned memory buffer not less than Z*N bytes in size shall cause S to be used by the pagecache memory allocator for as many as N simulataneous allocations each of size Z.
H14159 | A successful call to sqlite3_config(SQLITE_CONFIG_PAGECACHE,S,Z,N) where S is a NULL pointer shall disable the pagecache memory allocator.
H14162 | A successful call to sqlite3_config(SQLITE_CONFIG_HEAP,H,Z,N) where Z and N are non-negative integers and H is a pointer to an aligned memory buffer not less than Z bytes in size shall enable the memsys5 memory allocator and cause it to use buffer S as its memory source and to use a minimum allocation size of N.
H14165 | A successful call to sqlite3_config(SQLITE_CONFIG_HEAP,H,Z,N) where H is a NULL pointer shall disable the memsys5 memory allocator.
H14168 | A successful call to sqlite3_config(SQLITE_CONFIG_LOOKASIDE,Z,N) shall cause the default lookaside memory allocator configuration for new database connections to be N slots of Z bytes each.

See also lists of Objects, Constants, and Functions.

This page last modified 2008/08/11 17:57:43 UTC