Skip to content

Commit

Permalink
fix: only MySQL being supported on Fabric
Browse files Browse the repository at this point in the history
  • Loading branch information
WiIIiam278 committed Jun 10, 2024
1 parent 7b2b47d commit fc05e4b
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,9 @@
import net.william278.husksync.config.Settings;
import net.william278.husksync.data.*;
import net.william278.husksync.database.Database;
import net.william278.husksync.database.MongoDbDatabase;
import net.william278.husksync.database.MySqlDatabase;
import net.william278.husksync.database.PostgresDatabase;
import net.william278.husksync.event.FabricEventDispatcher;
import net.william278.husksync.hook.PlanHook;
import net.william278.husksync.listener.EventListener;
Expand Down Expand Up @@ -169,7 +171,11 @@ private void onEnable() {

// Initialize the database
initialize(getSettings().getDatabase().getType().getDisplayName() + " database connection", (plugin) -> {
this.database = new MySqlDatabase(this);
this.database = switch (settings.getDatabase().getType()) {
case MYSQL, MARIADB -> new MySqlDatabase(this);
case POSTGRES -> new PostgresDatabase(this);
case MONGO -> new MongoDbDatabase(this);
};
this.database.initialize();
});

Expand Down

0 comments on commit fc05e4b

Please sign in to comment.