fix: only MySQL being supported on Fabric

feat/data-edit-commands
William 6 months ago
parent 7b2b47de83
commit fc05e4b17a
No known key found for this signature in database

@ -47,7 +47,9 @@ import net.william278.husksync.config.Server;
import net.william278.husksync.config.Settings; import net.william278.husksync.config.Settings;
import net.william278.husksync.data.*; import net.william278.husksync.data.*;
import net.william278.husksync.database.Database; import net.william278.husksync.database.Database;
import net.william278.husksync.database.MongoDbDatabase;
import net.william278.husksync.database.MySqlDatabase; import net.william278.husksync.database.MySqlDatabase;
import net.william278.husksync.database.PostgresDatabase;
import net.william278.husksync.event.FabricEventDispatcher; import net.william278.husksync.event.FabricEventDispatcher;
import net.william278.husksync.hook.PlanHook; import net.william278.husksync.hook.PlanHook;
import net.william278.husksync.listener.EventListener; import net.william278.husksync.listener.EventListener;
@ -169,7 +171,11 @@ public class FabricHuskSync implements DedicatedServerModInitializer, HuskSync,
// Initialize the database // Initialize the database
initialize(getSettings().getDatabase().getType().getDisplayName() + " database connection", (plugin) -> { 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(); this.database.initialize();
}); });

Loading…
Cancel
Save