Add optional MySQL support for statistics storage
Build / build (push) Successful in 1m15s

This commit is contained in:
Michael Burgess
2026-08-07 06:09:24 -04:00
parent bcb603dadf
commit 1c16f9a83b
7 changed files with 128 additions and 25 deletions
@@ -80,4 +80,27 @@ public class ConfigManager {
public boolean isPlaceholderApiEnabled() {
return config.getBoolean("integrations.placeholderapi", true);
}
public StorageSettings getStorageSettings() {
String type = config.getString("storage.type", "sqlite");
return new StorageSettings(
type,
config.getString("storage.mysql.host", "localhost"),
config.getInt("storage.mysql.port", 3306),
config.getString("storage.mysql.database", "blockparty"),
config.getString("storage.mysql.username", "blockparty"),
config.getString("storage.mysql.password", ""),
config.getBoolean("storage.mysql.use-ssl", false),
config.getString("storage.mysql.table-prefix", "bp_")
);
}
/** Immutable snapshot of the storage.* config section. */
public record StorageSettings(String type, String host, int port, String database,
String username, String password, boolean useSsl, String tablePrefix) {
public boolean isMysql() {
return "mysql".equalsIgnoreCase(type);
}
}
}