1
0
mirror of https://github.com/anope/anope.git synced 2026-06-29 13:36:38 +02:00

Add db_sql:prefix allow prefixing all anope tables similarly, and changed db_sql to update the databases incrementally instead of one big flush

This commit is contained in:
Adam
2012-04-27 15:38:50 -04:00
parent 83ee20fc29
commit 5068483cb9
9 changed files with 133 additions and 122 deletions
+3 -3
View File
@@ -48,7 +48,7 @@ class SQLiteService : public SQLProvider
std::vector<SQLQuery> CreateTable(const Anope::string &table, const Serialize::Data &data) anope_override;
SQLQuery GetTables();
SQLQuery GetTables(const Anope::string &prefix);
Anope::string BuildQuery(const SQLQuery &q);
};
@@ -236,9 +236,9 @@ std::vector<SQLQuery> SQLiteService::CreateTable(const Anope::string &table, con
return queries;
}
SQLQuery SQLiteService::GetTables()
SQLQuery SQLiteService::GetTables(const Anope::string &prefix)
{
return SQLQuery("SELECT name FROM sqlite_master WHERE type='table'");
return SQLQuery("SELECT name FROM sqlite_master WHERE type='table' AND name LIKE '" + prefix + "%';");
}
Anope::string SQLiteService::Escape(const Anope::string &query)