Skip to content

Add support for multiple sql database types and dynamic library loading#191

Open
sadcenter wants to merge 4 commits intoInfernalSuite:mainfrom
sadcenter:multi-sql
Open

Add support for multiple sql database types and dynamic library loading#191
sadcenter wants to merge 4 commits intoInfernalSuite:mainfrom
sadcenter:multi-sql

Conversation

@sadcenter
Copy link

@sadcenter sadcenter commented Feb 9, 2026

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:

  • Redis
  • MariaDB
  • SQLite
  • h2
  • PostgreSQL

Reduces the plugin file size by 485% (10mb) due to paper maven library api

…ostgresSQL)

Add dynamic library loading for dependencies
Add batch saving
Copilot AI review requested due to automatic review settings February 9, 2026 19:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Member

@davidmayr davidmayr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could just be implemented using the default impl to avoid duplicate code

import org.eclipse.aether.graph.Dependency;
import org.eclipse.aether.repository.RemoteRepository;

public class DependenciesMavenResolver {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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()) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unnecessary check as file should always exist

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this file even touched? Seems like unnecessary diff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants