With this plugin, you will no longer need to bundle your database drivers inside your own plugins.
| Name | Plugin ID | Website |
|---|---|---|
| SQLite | sql4md-sqlite | GitHub |
| H2 | sql4md-h2 | GitHub |
| MariaDB | sql4md-mariadb | GitHub |
| MySQL | sql4md-mysql | GitHub |
| PostgreSQL | sql4md-postgresql | Website |
This plugin requires :
-
Mindustry v154 or above.
-
Java 17 or above.
-
SLF4MD (optional)
You only need to add the driver plugin you want in your plugin.json dependencies:
{
"dependencies": [ "sql4md-h2", "sql4md-mariadb" ]
}For local testing, I recommend using the toxopid Gradle plugin, you will be able to automatically download this mod alongside yours and launch it in a local Mindustry server:
Gradle
import com.xpdustry.toxopid.task.GithubAssetDownload
import com.xpdustry.toxopid.task.MindustryExec
plugins {
id "com.xpdustry.toxopid" version "4.x.x"
}
def downloadSql4md = tasks.register("downloadSql4md", GithubAssetDownload) {
owner = "xpdustry"
repo = "sql4md"
asset = "sql4md-sqlite.jar"
version = "v2.x.x"
}
tasks.withType(MindustryExec).configureEach {
mods.from(downloadSql4md)
}Kotlin
import com.xpdustry.toxopid.task.GithubAssetDownload
import com.xpdustry.toxopid.task.MindustryExec
plugins {
id("com.xpdustry.toxopid") version "4.x.x"
}
val downloadSql4md by tasks.registering(GithubAssetDownload::class) {
owner = "xpdustry"
repo = "sql4md"
asset = "sql4md-sqlite.jar"
version = "v2.x.x"
}
tasks.withType<MindustryExec> {
mods.from(downloadSql4md)
}./gradlew :sql4md-$database:shadowJarto compile and bundle a plugin (will be located atsql4md-$database/builds/libs/sql4md-$database.jar)../gradlew :sql4md-$database:runMindustryServerto run the plugin in a local Mindustry server../gradlew :runMindustryServerto run all the database plugins at once in a local Mindustry server.