1 #ifndef INSPIRCD_SQLAPI_2
2 #define INSPIRCD_SQLAPI_2
4 #define SQLREQID "SQLv2 Request"
5 #define SQLRESID "SQLv2 Result"
6 #define SQLSUCCESS "You shouldn't be reading this (success)"
11 enum SQLerrorNum { NO_ERROR, BAD_DBID, BAD_CONN, QSEND_FAIL };
18 SQLerror(SQLerrorNum i = NO_ERROR, const std::string &s = "")
23 void Id(SQLerrorNum i)
28 void Str(const std::string &s)
43 return "Invalid database ID";
45 return "Invalid connection";
47 return "Sending query failed";
49 return "Unknown error";
54 class SQLrequest : public Request
62 SQLrequest(Module* s, Module* d, const std::string &q, const std::string &id, bool p = false)
63 : Request(SQLREQID, s, d), query(q), dbid(id), pri(p)
68 class SQLresult : public Request
72 SQLresult(Module* s, Module* d)
73 : Request(SQLRESID, s, d)