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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user