⚠️ Forum Maintenance: Feb 6th, 8am - 14pm (UTC+2)

SQLite plugin: Any way to set the SQLITE_CONFIG_xxx options through the Qt functions?

  • I know that I can call the SQLite C function sqlite3_config() directly, but I'm not sure about when it would be safe to do so. The SQLite docs say that this function should only be called "prior to library initialization using sqlite3_initialize() or after shutdown by sqlite3_shutdown()." But I cannot find (using grep -R sqlite3_, etc.) anyplace in the source code for the SQLite plugin where these functions are called.

    Is there any way to retrieve the native SQLite configuration options used by Qt as compiled into the plugin?

    What I am trying to do is to execute a long-running procedure which accesses a regular file database in a worker thread (using QThread and related examples using signal and slot connections for inter-thread communication). My application would make sure that the connection is only added (calling QSqlDatabase::addDatabase() with a unique connection name) once the worker object is moved to the thread and removed again when the worker object is destroyed.

    But perhaps I don't even need any of these options for what I am trying to do?

  • Everything seems to work OK without doing anything special as long as I am careful not to mix up which connection is used by which thread, so I am marking this as "solved".

Log in to reply