Well it works using SQLite extensions.
But - to enable the use of extensions I have to call sqlite3_enable_load_extension. This doesn't work. The app always crashes when calling sqlite3_enable_load_extension(handle,1).
Did I make a mistake?
if (v.isValid() && qstrcmp(v.typeName(), "sqlite3*")==0) {
// v.data() returns a pointer to the handle
sqlite3 *handle = *static_cast<sqlite3 **>(v.data());
if (handle != 0) { // check that it is not NULL
sqlite3_enable_load_extension(handle,1);
}
}
QSqlDatabase db = QSqlDatabase::database();
QVariant v = db.driver()->handle();
if (v.isValid() && qstrcmp(v.typeName(), "sqlite3*")==0) {
// v.data() returns a pointer to the handle
sqlite3 *handle = *static_cast<sqlite3 **>(v.data());
if (handle != 0) { // check that it is not NULL
sqlite3_enable_load_extension(handle,1);
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks