How to create mulitple database connections for a shared cache memory SqliteDB in Qt?
Unsolved
General and Desktop
-
I want to create a shared cache memory SqliteDB(https://www.sqlite.org/inmemorydb.html) in a process, and use different connections in a few threads to query that SqliteDB.
But when I followed example use to open the DB, I got the the error.
My code:
QSqlDatabase db;
db = QSqlDatabase::addDatabase("QSQLITE");
db.setDatabaseName(file::memory:?cache=shared);
if(!db.open())
{
qDebug() << db.lastError().text();
}
How to create a shared sqliteDb, and create several connetions to this shared database?Thanks!
Heiduc