From 7f7bee8f455a566d232fd0935bb597dd8fea696e Mon Sep 17 00:00:00 2001 From: David Markowitz Date: Fri, 6 Dec 2024 20:51:58 -0800 Subject: [PATCH] add mysql if block --- dDatabase/GameDatabase/Database.cpp | 1 + dDatabase/GameDatabase/MySQL/MySQLDatabase.cpp | 1 + dDatabase/GameDatabase/SQLite/SQLiteDatabase.cpp | 1 + 3 files changed, 3 insertions(+) diff --git a/dDatabase/GameDatabase/Database.cpp b/dDatabase/GameDatabase/Database.cpp index b388163a..2f7c8692 100644 --- a/dDatabase/GameDatabase/Database.cpp +++ b/dDatabase/GameDatabase/Database.cpp @@ -20,6 +20,7 @@ void Database::Connect() { } if (Game::config->GetValue("sqlite_database") == "1") database = new SQLiteDatabase(); + else if (Game::config->GetValue("mysql_database") == "1") database = new MySQLDatabase(); database->Connect(); } diff --git a/dDatabase/GameDatabase/MySQL/MySQLDatabase.cpp b/dDatabase/GameDatabase/MySQL/MySQLDatabase.cpp index fcceabea..26693631 100644 --- a/dDatabase/GameDatabase/MySQL/MySQLDatabase.cpp +++ b/dDatabase/GameDatabase/MySQL/MySQLDatabase.cpp @@ -14,6 +14,7 @@ namespace { }; void MySQLDatabase::Connect() { + LOG("Using MySQL database"); driver = sql::mariadb::get_driver_instance(); // The mariadb connector is *supposed* to handle unix:// and pipe:// prefixes to hostName, but there are bugs where diff --git a/dDatabase/GameDatabase/SQLite/SQLiteDatabase.cpp b/dDatabase/GameDatabase/SQLite/SQLiteDatabase.cpp index 7c620302..635ca8fb 100644 --- a/dDatabase/GameDatabase/SQLite/SQLiteDatabase.cpp +++ b/dDatabase/GameDatabase/SQLite/SQLiteDatabase.cpp @@ -15,6 +15,7 @@ namespace { }; void SQLiteDatabase::Connect() { + LOG("Using SQLite database"); con = new CppSQLite3DB(); con->open(Game::config->GetValue("sqlite_database_path").c_str()); isConnected = true;