Hi,

We are trying to figure out how to use Qt Sqlite driver to use loadable
extension mechanism. We have a shared library, which needs to be loaded
after db is open. We are using Qt classes to make a connection to database,
so our code looks like this:

QSqlDatabase db= QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName("./testDb");
db.open();
..................
QSqlQuery query;
query.exec("SELECT load_extension('myextensionlib.so')");

This fails with an error message 'not authorized'. I understand that I need
to enable load extension mechanism by calling
sqlite3_enable_load_extension(db, int 1) function, but since I use Qt I dont
have db handle readily available.

So, my question is whether there is another way to enable load extension
mechanism? Is it possible to enable it by default somehow so that I wont
have to call sqlite3_enable_load_extension function? I understand that I can
build my extension into sqlite similar to fts1 and fts2, but I need to load
it dynamically so this is not an option.

Many thanks in advance for any suggestions.

  - Alex

Reply via email to