[Server] Create the worker database interfaces through the factory (#7860)

This commit is contained in:
BruebachL 2026-11-10 12:16:34 +01:00 • committed by GitHub
parent 0caacb27c1
commit c4ac80e282
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 62 additions and 29 deletions

View file

@ -81,6 +81,18 @@ void Servatrice_DatabaseInterface::initDatabase(const QSqlDatabase &_sqlDatabase
}
}
Server_DatabaseInterface *Servatrice_DatabaseInterface::createWorkerInterface(int instanceId)
{
auto *worker = new Servatrice_DatabaseInterface(instanceId, server);
worker->inheritedDatabase = sqlDatabase;
return worker;
}
void Servatrice_DatabaseInterface::initialiseWorkerDatabase()
{
initDatabase(inheritedDatabase);
}
bool Servatrice_DatabaseInterface::openDatabase(const QString &type,
const QString &hostName,
const QString &databaseName,