Skip to content

SQL drivers for mindustry plugins.

License

Notifications You must be signed in to change notification settings

xpdustry/sql4md

Repository files navigation

sql4md

Downloads Mindustry 8.0 Discord

Description

With this plugin, you will no longer need to bundle your database drivers inside your own plugins.

Supported Databases

Name Plugin ID Website
SQLite sql4md-sqlite GitHub
H2 sql4md-h2 GitHub
MariaDB sql4md-mariadb GitHub
MySQL sql4md-mysql GitHub
PostgreSQL sql4md-postgresql Website

Usage

For server operators

This plugin requires :

  • Mindustry v154 or above.

  • Java 17 or above.

  • SLF4MD (optional)

For developers

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)
}

Building

  • ./gradlew :sql4md-$database:shadowJar to compile and bundle a plugin (will be located at sql4md-$database/builds/libs/sql4md-$database.jar).
  • ./gradlew :sql4md-$database:runMindustryServer to run the plugin in a local Mindustry server.
  • ./gradlew :runMindustryServer to run all the database plugins at once in a local Mindustry server.

About

SQL drivers for mindustry plugins.

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Contributors 3

  •  
  •  
  •  

Languages