Before an application can use the SQLite library to do anything, the library must first be initialized. This process allocates some standard resources and sets up any OS-specific data structures. By default, most major API function calls will automatically initialize the library, if it has not already been initialized. It is considered a good practice to manually initialize the library, however.
int sqlite3_initialize( )
Initializes the SQLite library. This function should be called
prior to any other function in the SQLite API. Calling
this function after the library has already been
initialized is harmless. This function can be called after
a shutdown to reinitialize the library. A return value of
SQLITE_OK
indicates success.
When an application is finished using the SQLite library, the library should be shut down.
Because of the automatic initialization features, many
applications never call either of these functions. Rather, they call
sqlite3_open()
, or one of the other
primary functions, and depend on the library to automatically initialize
itself. In most cases this is safe enough, but for maximum compatibility it
is best to call these functions
explicitly
.