Skip to content

Commit b89b23b

Browse files
committed
Remove redundant fields
1 parent 78b09bf commit b89b23b

File tree

2 files changed

+5
-14
lines changed

2 files changed

+5
-14
lines changed

core/src/main/java/com/github/fernthedev/fernapi/universal/data/database/DatabaseAuthInfo.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,6 @@ public class DatabaseAuthInfo {
2525
@NonNull
2626
protected String database;
2727

28-
@Setter
29-
protected boolean cachePrepStmts = true;
30-
31-
@Setter
32-
protected int prepStmtCacheSize = 250;
33-
34-
@Setter
35-
protected int prepStmtCacheSqlLimit = 2048;
36-
37-
@Setter
38-
protected boolean useServerPrepStmts = true;
39-
4028
/**
4129
* Set if necessary
4230
*/

core/src/main/java/com/github/fernthedev/fernapi/universal/mysql/AikarFernDatabase.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import co.aikar.idb.*;
44
import com.github.fernthedev.fernapi.universal.Universal;
5+
import com.github.fernthedev.fernapi.universal.data.database.DatabaseAuthInfo;
56
import com.github.fernthedev.fernapi.universal.handlers.FernAPIPlugin;
67
import lombok.AccessLevel;
78
import lombok.NoArgsConstructor;
@@ -22,11 +23,13 @@ public static PooledDatabaseOptions getRecommendedOptions(FernAPIPlugin plugin,
2223
.logger(Logger.getLogger(Universal.getLogger().getName()))
2324
.mysql(user, pass, db, hostAndPort)
2425
.build();
25-
PooledDatabaseOptions poolOptions = PooledDatabaseOptions
26+
return PooledDatabaseOptions
2627
.builder()
2728
.options(options)
2829
.build();
29-
return poolOptions;
30+
}
31+
public static Database createHikariDatabase(FernAPIPlugin plugin, DatabaseAuthInfo databaseAuthInfo) {
32+
return createHikariDatabase(getRecommendedOptions(plugin, databaseAuthInfo.getUsername(), databaseAuthInfo.getPassword(), databaseAuthInfo.getDatabase(), databaseAuthInfo.getUrlHost() + ":" + databaseAuthInfo.getPort()));
3033
}
3134

3235
public static Database createHikariDatabase(FernAPIPlugin plugin, @NonNull String user, @NonNull String pass, @NonNull String db, @NonNull String hostAndPort) {

0 commit comments

Comments
 (0)