Skip to content

Commit

Permalink
Code format - (Clang-format)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Nov 7, 2024
1 parent 33e0971 commit f23e8a5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/database/database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ bool Database::connect(const std::string* host, const std::string* user, const s
}

namespace {
std::string createBackupFileName(const std::string& backupDir, const std::string& formattedTime) {
std::string createBackupFileName(const std::string &backupDir, const std::string &formattedTime) {
std::filesystem::create_directories(backupDir);
return fmt::format("{}/backup_{}.sql", backupDir, formattedTime);
}
Expand All @@ -75,7 +75,7 @@ namespace {
return mysql_store_result(handle);
}

void writeCreateTableStatement(MYSQL* handle, const std::string& tableName, std::ofstream& backupFile) {
void writeCreateTableStatement(MYSQL* handle, const std::string &tableName, std::ofstream &backupFile) {
std::string createTableQuery = fmt::format("SHOW CREATE TABLE `{}`", tableName);
if (mysql_query(handle, createTableQuery.c_str()) == 0) {
MYSQL_RES* createTableResult = mysql_store_result(handle);
Expand All @@ -91,7 +91,7 @@ namespace {
}
}

void writeValue(std::ofstream& backupFile, const char* value, const MYSQL_FIELD& field, unsigned long length) {
void writeValue(std::ofstream &backupFile, const char* value, const MYSQL_FIELD &field, unsigned long length) {
if (!value) {
backupFile << "NULL";
return;
Expand All @@ -106,7 +106,7 @@ namespace {
}
}

void writeTableData(MYSQL* handle, const std::string& tableName, std::ofstream& backupFile) {
void writeTableData(MYSQL* handle, const std::string &tableName, std::ofstream &backupFile) {
std::string selectQuery = fmt::format("SELECT * FROM `{}`", tableName);
if (mysql_query(handle, selectQuery.c_str()) != 0) {
g_logger().error("Failed to retrieve data from table {}: {}", tableName, mysql_error(handle));
Expand Down

0 comments on commit f23e8a5

Please sign in to comment.