]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_sqlv2.h
This is better now.
[user/henk/code/inspircd.git] / src / modules / extra / m_sqlv2.h
index 3272efec5802d8c550b18e97dc30e09864a96fd4..a48b9b147c6fe806d7c6a1bd9116de0063516b47 100644 (file)
@@ -30,6 +30,14 @@ typedef std::deque<std::string> ParamL;
  */
 class SQLexception : public ModuleException
 {
+ public:
+       SQLexception(const std::string &reason) : ModuleException(reason)
+       {
+       }
+
+       SQLexception() : ModuleException("SQLv2: Undefined exception")
+       {
+       }
 };
 
 /** An exception thrown when a bad column or row name or id is requested
@@ -37,7 +45,9 @@ class SQLexception : public ModuleException
 class SQLbadColName : public SQLexception
 {
 public:
-       SQLbadColName() { }
+       SQLbadColName() : SQLexception("SQLv2: Bad column name")
+       {
+       }
 };
 
 /** SQLerror holds the error state of any SQLrequest or SQLresult.
@@ -149,7 +159,6 @@ public:
        SQLquery(const std::string &query)
        : q(query)
        {
-               log(DEBUG, "SQLquery constructor: %s", q.c_str());
        }
 
        /** Initialize an SQLquery with a format string and parameters.
@@ -159,7 +168,6 @@ public:
        SQLquery(const std::string &query, const ParamL &params)
        : q(query), p(params)
        {
-               log(DEBUG, "SQLquery constructor with %d params: %s", p.size(), q.c_str());
        }       
        
        /** An overloaded operator for pushing parameters onto the parameter list
@@ -221,7 +229,7 @@ public:
         * @param q A properly initialized SQLquery object.
         */
        SQLrequest(Module* s, Module* d, const std::string &databaseid, const SQLquery &q)
-       : Request(SQLREQID, s, d), query(q), dbid(databaseid), pri(false), id(0)
+       : Request(s, d, SQLREQID), query(q), dbid(databaseid), pri(false), id(0)
        {
        }
        
@@ -259,7 +267,7 @@ public:
 
        /** Initialize an SQLfield
         */
-       SQLfield(const std::string &data, bool n)
+       SQLfield(const std::string &data = "", bool n = false)
        : d(data), null(n)
        {
                
@@ -307,7 +315,7 @@ public:
        /** Used by the SQL API to instantiate an SQLrequest
         */
        SQLresult(Module* s, Module* d, unsigned long i)
-       : Request(SQLRESID, s, d), id(i)
+       : Request(s, d, SQLRESID), id(i)
        {
        }