Add support for multiple sql database types and dynamic library loading#191
Add support for multiple sql database types and dynamic library loading#191sadcenter wants to merge 4 commits intoInfernalSuite:mainfrom
Conversation
…ostgresSQL) Add dynamic library loading for dependencies Add batch saving
davidmayr
left a comment
There was a problem hiding this comment.
Sorry for the delayed review. Haven't actually looked at the sql impl yet, but there seems to be quite a lot to look into already
| * @param worlds a map containing the world names as keys and their data files as values | ||
| * @throws IOException if the worlds could not be saved. | ||
| */ | ||
| void saveWorlds(Map<String, byte[]> worlds) throws IOException; |
There was a problem hiding this comment.
Needs default impl to not break API. In general this method probably should not exist. All loader methods are pretty much only for internal use. They are not intended to be accessed by anyone else (except maybe deleteWorld)
The default server impl likely will never make use of this, so this is in general just pretty useless.
|
|
||
| @Override | ||
| public void saveWorlds(Map<String, byte[]> worlds) throws IOException { | ||
| this.logger.warn("Illegal call to saveWorld: API Worlds cannot be saved. They're always read-only."); |
There was a problem hiding this comment.
Could just be implemented using the default impl to avoid duplicate code
plugin/src/main/java/com/infernalsuite/asp/plugin/config/DatasourcesConfig.java
Show resolved
Hide resolved
| import org.eclipse.aether.graph.Dependency; | ||
| import org.eclipse.aether.repository.RemoteRepository; | ||
|
|
||
| public class DependenciesMavenResolver { |
There was a problem hiding this comment.
I'm not sure if this really needs to be its own class. addDependency could just be a static helper method somewhere/inside the PluginLoader instead of this
| )); | ||
| } | ||
|
|
||
| if (getLoaders().isEmpty()) { |
There was a problem hiding this comment.
Unnecessary check as file should always exist
There was a problem hiding this comment.
Why was this file even touched? Seems like unnecessary diff
Adds support for multiple SQL databases (MySQL, MariaDB, h2, SQLite, PostgreSQL)
Adds dynamic library loading for dependencies
Adds batch saving
Currently I've tested it with:
Reduces the plugin file size by 485% (10mb) due to paper maven library api