-enum SQLstatus { CREAD, CWRITE, WREAD, WWRITE };
-
-/** QueryQueue, a queue of queries waiting to be executed.
- * This maintains two queues internally, one for 'priority'
- * queries and one for less important ones. Each queue has
- * new queries appended to it and ones to execute are popped
- * off the front. This keeps them flowing round nicely and no
- * query should ever get 'stuck' for too long. If there are
- * queries in the priority queue they will be executed first,
- * 'unimportant' queries will only be executed when the
- * priority queue is empty.
- *
- * These are lists of SQLresult so we can, from the moment the
- * SQLrequest is recieved, be beginning to construct the result
- * object. The copy in the deque can then be submitted in-situ
- * and finally deleted from this queue. No copies of the SQLresult :)
- *
- * Because we work on the SQLresult in-situ, we need a way of accessing the
- * result we are currently processing, QueryQueue::front(), but that call
- * needs to always return the same element until that element is removed
- * from the queue, this is what the 'which' variable is. New queries are
- * always added to the back of one of the two queues, but if when front()
- * is first called then the priority queue is empty then front() will return
- * a query from the normal queue, but if a query is then added to the priority
- * queue then front() must continue to return the front of the *normal* queue
- * until pop() is called.
+enum SQLstatus { CREAD, CWRITE, WREAD, WWRITE, RREAD, RWRITE };
+
+class ReconnectTimer : public Timer
+{
+ private:
+ ModulePgSQL* mod;
+ public:
+ ReconnectTimer(ModulePgSQL* m) : Timer(5, ServerInstance->Time(), false), mod(m)
+ {
+ }
+ virtual void Tick(time_t TIME);
+};
+
+struct QueueItem
+{
+ SQLQuery* c;
+ std::string q;
+ QueueItem(SQLQuery* C, const std::string& Q) : c(C), q(Q) {}
+};
+
+/** PgSQLresult is a subclass of the mostly-pure-virtual class SQLresult.
+ * All SQL providers must create their own subclass and define it's methods using that
+ * database library's data retriveal functions. The aim is to avoid a slow and inefficient process
+ * of converting all data to a common format before it reaches the result structure. This way
+ * data is passes to the module nearly as directly as if it was using the API directly itself.