34 #ifndef MODULE_DATABASE_HPP_ 35 #define MODULE_DATABASE_HPP_ 37 #include "../Helper/DateTime.hpp" 38 #include "../Helper/FileSystem.hpp" 39 #include "../Helper/Memory.hpp" 40 #include "../Helper/Utf8.hpp" 41 #include "../Main/Database.hpp" 42 #include "../Main/Exception.hpp" 43 #include "../Struct/DatabaseSettings.hpp" 44 #include "../Struct/ModuleOptions.hpp" 53 #include <string_view> 99 using SqlResultSetPtr = std::unique_ptr<sql::ResultSet>;
113 void setThreadId(std::uint64_t
id);
114 void setLogging(std::uint8_t level, std::uint8_t min, std::uint8_t verbose);
126 void log(std::uint8_t level,
const std::string& logEntry);
127 void log(std::uint8_t level, std::queue<std::string>& logEntries);
128 bool isLogLevel(uint8_t level)
const;
134 void setThreadStatusMessage(
135 std::uint64_t threadId,
137 const std::string& threadStatusMessage
139 void setThreadProgress(
140 std::uint64_t threadId,
141 float threadProgress,
142 std::uint64_t threadRunTime
145 std::uint64_t threadId,
146 std::uint64_t threadLast,
147 std::uint64_t threadProcessed
177 std::string threadIdString;
178 std::string websiteIdString;
179 std::string urlListIdString;
180 std::uint8_t loggingLevel{std::numeric_limits<std::uint8_t>::max() - 1};
181 std::uint8_t loggingMin{1};
182 std::uint8_t loggingVerbose{std::numeric_limits<std::uint8_t>::max()};
183 std::ofstream loggingFile;
184 bool debugLogging{
false};
188 void initDebugLogging();
192 std::size_t setThreadStatusMessage{};
193 std::size_t setThreadProgress{};
194 std::size_t setThreadLast{};
constexpr auto sqlArg2
Second argument in a SQL query.
Definition: Database.hpp:97
Class handling database access for threads.
Definition: Database.hpp:91
#define MAIN_EXCEPTION_CLASS()
Macro used to easily define classes for general exceptions.
Definition: Exception.hpp:50
Class handling database access for the command-and-control and its threads.
Definition: Database.hpp:366
Module options containing the thread ID, as well as ID and namespace of website and URL list used by ...
Definition: ModuleOptions.hpp:40
constexpr auto sqlArg3
Third argument in a SQL query.
Definition: Database.hpp:100
Wrapper class providing the database functionality of Module::Database to its child classes...
Definition: Database.hpp:72
Database settings containing its host, port, user, password, schema, and compression.
Definition: DatabaseSettings.hpp:48
Namespace for RAII wrappers and Wrapper::Database.
Definition: Database.hpp:109
constexpr auto sqlArg1
First argument in a SQL query.
Definition: Database.hpp:94
constexpr auto debugDir
The name of the (sub-)directory for debugging.
Definition: Server.hpp:167
Namespace for the different modules run by threads.