mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-10 03:53:26 -08:00
[Server] Create the worker database interfaces through the factory (#7860)
This commit is contained in:
parent
0caacb27c1
commit
c4ac80e282
5 changed files with 62 additions and 29 deletions
|
|
@ -33,6 +33,7 @@ class Servatrice_DatabaseInterface : public Server_DatabaseInterface
|
|||
private:
|
||||
int instanceId;
|
||||
QSqlDatabase sqlDatabase;
|
||||
QSqlDatabase inheritedDatabase;
|
||||
QHash<QString, QSqlQuery *> preparedStatements;
|
||||
Servatrice *server;
|
||||
ServerInfo_User evalUserQueryResult(const QSqlQuery *query, bool complete, bool withId = false);
|
||||
|
|
@ -72,13 +73,11 @@ public:
|
|||
const QString &userName,
|
||||
const QString &password) override;
|
||||
bool openDatabase();
|
||||
Server_DatabaseInterface *createWorkerInterface(int instanceId) override;
|
||||
void initialiseWorkerDatabase() override;
|
||||
bool checkSql() override;
|
||||
QSqlQuery *prepareQuery(const QString &queryText);
|
||||
bool execSqlQuery(QSqlQuery *query);
|
||||
const QSqlDatabase &getDatabase()
|
||||
{
|
||||
return sqlDatabase;
|
||||
}
|
||||
|
||||
bool activeUserExists(const QString &user) override;
|
||||
bool userExists(const QString &user) override;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue