Navigation
API > API/Plugins > API/Plugins/SQLiteCore > API/Plugins/SQLiteCore/sqlite
References
| Module | SQLiteCore |
| Header | /Engine/Plugins/Runtime/Database/SQLiteCore/Source/SQLiteCore/Public/sqlite/sqlite3.h |
| Include | #include "sqlite/sqlite3.h" |
int sqlite3_load_extension
(
sqlite3 * db,
const char * zFile,
const char * zProc,
char ** pzErrMsg
)
Remarks
CAPI3REF: Load An Extension METHOD: sqlite3
^This interface loads an SQLite extension library from the named file.
^The sqlite3_load_extension() interface attempts to load an [SQLite extension] library contained in the file zFile. If the file cannot be loaded directly, attempts are made to load with various operating-system specific extensions added. So for example, if "samplelib" cannot be loaded, then names like "samplelib.so" or "samplelib.dylib" or "samplelib.dll" might be tried also.
^The entry point is zProc. ^(zProc may be 0, in which case SQLite will try to come up with an entry point name on its own. It first tries "sqlite3_extension_init". If that does not work, it constructs a name "sqlite3_X_init" where the X is consists of the lower-case equivalent of all ASCII alphabetic characters in the filename from the last "/" to the first following "." and omitting any initial "lib".)^ ^The sqlite3_load_extension() interface returns [SQLITE_OK] on success and [SQLITE_ERROR] if something goes wrong. ^If an error occurs and pzErrMsg is not 0, then the [sqlite3_load_extension()] interface shall attempt to fill *pzErrMsg with error message text stored in memory obtained from [sqlite3_malloc()]. The calling function should free this memory by calling [sqlite3_free()].
^Extension loading must be enabled using [sqlite3_enable_load_extension()] or sqlite3_db_config prior to calling this API, otherwise an error will be returned.
Security warning: It is recommended that the [SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION] method be used to enable only this interface. The use of the [sqlite3_enable_load_extension()] interface should be avoided. This will keep the SQL function [load_extension()] disabled and prevent SQL injections from giving attackers access to extension loading capabilities.
See also the [load_extension() SQL function].