summaryrefslogtreecommitdiff
path: root/modules/extra/m_sql_oper.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2012-12-13 06:12:56 -0500
committerAdam <Adam@anope.org>2012-12-13 06:12:56 -0500
commitc1077faa281c5635f85b892e605e23bd6c8fcc3b (patch)
tree213b5f87a19f182e1efd6110f03ff10d5b10ebf6 /modules/extra/m_sql_oper.cpp
parent76ba147c22944b67e8522cd2bb7b6e1bae498ced (diff)
Optimize much of the database code and serialize code.
Diffstat (limited to 'modules/extra/m_sql_oper.cpp')
-rw-r--r--modules/extra/m_sql_oper.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/modules/extra/m_sql_oper.cpp b/modules/extra/m_sql_oper.cpp
index 523272a49..dd1f13b74 100644
--- a/modules/extra/m_sql_oper.cpp
+++ b/modules/extra/m_sql_oper.cpp
@@ -1,7 +1,7 @@
#include "module.h"
#include "sql.h"
-class SQLOperResult : public SQLInterface
+class SQLOperResult : public SQL::Interface
{
Reference<User> user;
@@ -13,9 +13,9 @@ class SQLOperResult : public SQLInterface
};
public:
- SQLOperResult(Module *m, User *u) : SQLInterface(m), user(u) { }
+ SQLOperResult(Module *m, User *u) : SQL::Interface(m), user(u) { }
- void OnResult(const SQLResult &r) anope_override
+ void OnResult(const SQL::Result &r) anope_override
{
SQLOperResultDeleter d(this);
@@ -27,7 +27,7 @@ class SQLOperResult : public SQLInterface
{
opertype = r.Get(0, "opertype");
}
- catch (const SQLException &)
+ catch (const SQL::Exception &)
{
return;
}
@@ -39,7 +39,7 @@ class SQLOperResult : public SQLInterface
{
modes = r.Get(0, "modes");
}
- catch (const SQLException &) { }
+ catch (const SQL::Exception &) { }
if (opertype.empty())
{
@@ -79,7 +79,7 @@ class SQLOperResult : public SQLInterface
}
}
- void OnError(const SQLResult &r) anope_override
+ void OnError(const SQL::Result &r) anope_override
{
SQLOperResultDeleter d(this);
Log(this->owner) << "m_sql_oper: Error executing query " << r.GetQuery().query << ": " << r.GetError();
@@ -91,7 +91,7 @@ class ModuleSQLOper : public Module
Anope::string engine;
Anope::string query;
- ServiceReference<SQLProvider> SQL;
+ ServiceReference<SQL::Provider> SQL;
public:
ModuleSQLOper(const Anope::string &modname, const Anope::string &creator) : Module(modname, creator, SUPPORTED)
@@ -111,7 +111,7 @@ class ModuleSQLOper : public Module
this->engine = config.ReadValue("m_sql_oper", "engine", "", 0);
this->query = config.ReadValue("m_sql_oper", "query", "", 0);
- this->SQL = ServiceReference<SQLProvider>("SQLProvider", this->engine);
+ this->SQL = ServiceReference<SQL::Provider>("SQL::Provider", this->engine);
}
void OnNickIdentify(User *u) anope_override
@@ -122,9 +122,9 @@ class ModuleSQLOper : public Module
return;
}
- SQLQuery q(this->query);
- q.setValue("a", u->Account()->display);
- q.setValue("i", u->ip);
+ SQL::Query q(this->query);
+ q.SetValue("a", u->Account()->display);
+ q.SetValue("i", u->ip);
this->SQL->Run(new SQLOperResult(this, u), q);