Default Values

The following compiler directives are used to alter the default value for different database parameters. These directives alter the default startup values. Most of these parameters can be changed at runtime.

In general, if you alter a default value for your application, it is also a good idea to alter the default values for any tools you might use (e.g., the sqlite3 command-line tool). Having everything using the same set of defaults reduces the chance that the configuration values inherited by a new database will be out of sync with the rest of the system.

Conversely, if your application has critical dependencies on specific settings, it would be best to explicitly set those values at runtime through an appropriate SQL command or API call, even if you also configure the appropriate defaults when building the library. This guarantees that the values will remain correct, regardless of the SQLite library configuration.

Get Using SQLite now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.