I have an extension which can be loaded in SQLite using the load_extension function. It would be useful for me if I could load it in QGIS to use in queries made via Database Manager.

The Python SQLite binding prohibits loading extensions by default. Could I do something from the Python console or project macro to load an extension?

I have QGIS 2.4.0 with spatialite 4.1.1, python-spatialite 3.0.1, python 2.7.8 and sqlite3 3.8.5. I have tried running the select load_extension('...') from DB Manager and it does not work (gives error "Authorization required"; because it is prohibited by default by python sqlite bindings). I don't know how to get the connection from the python console to do anything with it.

  • Please provide more information about your OS, version of QGIS, how it was installed, and what you have already tried. – dakcarto Aug 27 '14 at 23:28
  • @dakcarto: I have added versions and what I tried. Operating system does not matter; this is internal behaviour of qgis and the python bindings it uses. – Jan Hudec Aug 28 '14 at 5:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.