Skip to content

Commit

Permalink
add mysql if block
Browse files Browse the repository at this point in the history
  • Loading branch information
EmosewaMC committed Dec 7, 2024
1 parent ebc74a6 commit 7f7bee8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions dDatabase/GameDatabase/Database.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down
1 change: 1 addition & 0 deletions dDatabase/GameDatabase/MySQL/MySQLDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions dDatabase/GameDatabase/SQLite/SQLiteDatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 7f7bee8

Please sign in to comment.