diff options
author | Adam <Adam@anope.org> | 2012-04-27 15:38:50 -0400 |
---|---|---|
committer | Adam <Adam@anope.org> | 2012-04-27 15:38:50 -0400 |
commit | 5068483cb917ba1c8ed3a0d20f7bfcb996f0aa3e (patch) | |
tree | cf2bf4096b72f68b595a3bbe9d0e75d34ad2641d /modules/extra/m_sqlite.cpp | |
parent | 83ee20fc2910e9ea0cac250e767d20f17576d98a (diff) |
Add db_sql:prefix allow prefixing all anope tables similarly, and changed db_sql to update the databases incrementally instead of one big flush
Diffstat (limited to 'modules/extra/m_sqlite.cpp')
-rw-r--r-- | modules/extra/m_sqlite.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/modules/extra/m_sqlite.cpp b/modules/extra/m_sqlite.cpp index 1c82f3459..5102c003b 100644 --- a/modules/extra/m_sqlite.cpp +++ b/modules/extra/m_sqlite.cpp @@ -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) |