[Server] Accept the database interface in the connection pool (#7853)

Servatrice_ConnectionPool stored and returned a concrete
Servatrice_DatabaseInterface pointer, so the pool that decides which database a
socket handler runs against could not hold any other Server_DatabaseInterface.
Retype the constructor, member and accessor, and include the interface header
instead of the Servatrice one. The shipped path still builds MySQL pools and
converts implicitly; behaviour is unchanged.
This commit is contained in:
BruebachL 2026-11-10 12:16:31 +01:00 • committed by GitHub
parent 35232cbcf1
commit ec3ad812f0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 6 deletions

View file

@ -1,10 +1,10 @@
#include "servatrice_connection_pool.h" #include "servatrice_connection_pool.h"
#include "servatrice_database_interface.h" #include "server_database_interface.h"
#include <QThread> #include <QThread>
Servatrice_ConnectionPool::Servatrice_ConnectionPool(Servatrice_DatabaseInterface *_databaseInterface) Servatrice_ConnectionPool::Servatrice_ConnectionPool(Server_DatabaseInterface *_databaseInterface)
: databaseInterface(_databaseInterface), threaded(false), clientCount(0) : databaseInterface(_databaseInterface), threaded(false), clientCount(0)
{ {
} }

View file

@ -6,22 +6,22 @@
#include <QObject> #include <QObject>
#include <qtmetamacros.h> #include <qtmetamacros.h>
class Servatrice_DatabaseInterface; class Server_DatabaseInterface;
class Servatrice_ConnectionPool : public QObject class Servatrice_ConnectionPool : public QObject
{ {
Q_OBJECT Q_OBJECT
private: private:
Servatrice_DatabaseInterface *databaseInterface; Server_DatabaseInterface *databaseInterface;
bool threaded; bool threaded;
mutable QMutex clientCountMutex; mutable QMutex clientCountMutex;
int clientCount; int clientCount;
public: public:
explicit Servatrice_ConnectionPool(Servatrice_DatabaseInterface *_databaseInterface); explicit Servatrice_ConnectionPool(Server_DatabaseInterface *_databaseInterface);
~Servatrice_ConnectionPool() override; ~Servatrice_ConnectionPool() override;
Servatrice_DatabaseInterface *getDatabaseInterface() const Server_DatabaseInterface *getDatabaseInterface() const
{ {
return databaseInterface; return databaseInterface;
} }