mirror of
https://github.com/cuberite/SQLiteCpp.git
synced 2025-08-05 02:06:02 -04:00
Merge pull request #52 from nazim-can-bedir/master
Added conditional support for extension loading
This commit is contained in:
commit
594b9c26b2
@ -156,6 +156,12 @@ void Database::createFunction(const char* apFuncName,
|
||||
void Database::loadExtension(const char* apExtensionName,
|
||||
const char *apEntryPointName)
|
||||
{
|
||||
#ifdef SQLITE_OMIT_LOAD_EXTENSION
|
||||
#
|
||||
throw std::runtime_error("sqlite extensions are disabled");
|
||||
#
|
||||
#else
|
||||
#
|
||||
int ret = sqlite3_enable_load_extension(mpSQLite, 1);
|
||||
|
||||
check(ret);
|
||||
@ -163,6 +169,8 @@ void Database::loadExtension(const char* apExtensionName,
|
||||
ret = sqlite3_load_extension(mpSQLite, apExtensionName, apEntryPointName, 0);
|
||||
|
||||
check(ret);
|
||||
#
|
||||
#endif
|
||||
}
|
||||
|
||||
} // namespace SQLite
|
||||
|
Loading…
x
Reference in New Issue
Block a user