-private:
- Server* Srv; /* Server* for..uhm..something, maybe */
- std::string dbhost; /* Database server hostname */
- unsigned int dbport; /* Database server port */
- std::string dbname; /* Database name */
- std::string dbuser; /* Database username */
- std::string dbpass; /* Database password */
- bool ssl; /* If we should require SSL */
- PGconn* sql; /* PgSQL database connection handle */
- SQLstatus status; /* PgSQL database connection status */
-
-public:
- QueryQueue queue; /* Queue of queries waiting to be executed on this connection */
-
- /* This class should only ever be created inside this module, using this constructor, so we don't have to worry about the default ones */
-
- SQLConn(Server* srv, const std::string &h, unsigned int p, const std::string &d, const std::string &u, const std::string &pwd, bool s)
- : InspSocket::InspSocket(), Srv(srv), dbhost(h), dbport(p), dbname(d), dbuser(u), dbpass(pwd), ssl(s), sql(NULL), status(CWRITE)
+ public:
+ reference<ConfigTag> conf; /* The <database> entry */
+ std::deque<QueueItem> queue;
+ PGconn* sql; /* PgSQL database connection handle */
+ SQLstatus status; /* PgSQL database connection status */
+ QueueItem qinprog; /* If there is currently a query in progress */
+
+ SQLConn(Module* Creator, ConfigTag* tag)
+ : SQLProvider(Creator, "SQL/" + tag->getString("id")), conf(tag), sql(NULL), status(CWRITE), qinprog(NULL, "")