*/
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
class SQLbadColName : public SQLexception
{
public:
- SQLbadColName() { }
+ SQLbadColName() : SQLexception("SQLv2: Bad column name")
+ {
+ }
};
/** SQLerror holds the error state of any SQLrequest or SQLresult.
SQLquery(const std::string &query)
: q(query)
{
- log(DEBUG, "SQLquery constructor: %s", q.c_str());
}
/** Initialize an SQLquery with a format string and parameters.
SQLquery(const std::string &query, const ParamL ¶ms)
: 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
* @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)
{
}
/** Initialize an SQLfield
*/
- SQLfield(const std::string &data, bool n)
+ SQLfield(const std::string &data = "", bool n = false)
: d(data), null(n)
{
/** 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)
{
}