Minor fixes

This commit is contained in:
Potatoboy9999
2024-04-10 10:14:10 -07:00
parent c583e32bab
commit 9f1f12318d
6 changed files with 20 additions and 7 deletions

View File

@@ -26,6 +26,9 @@ object MySQL : LedgerDatabase {
addDataSourceProperty("useLocalSessionState", true)
addDataSourceProperty("elideSetAutoCommits", true)
addDataSourceProperty("alwaysSendSetIsolation", false)
addDataSourceProperty("useJDBCCompliantTimezoneShift", true)
addDataSourceProperty("useLegacyDatetimeCode", false)
addDataSourceProperty("serverTimezone", "UTC")
for ((key, value) in Ledger.config[DatabaseExtensionSpec.properties]) {
addDataSourceProperty(key, value)
}

View File

@@ -14,6 +14,7 @@ object PostgreSQL : LedgerDatabase {
username = Ledger.config[DatabaseExtensionSpec.userName]
password = Ledger.config[DatabaseExtensionSpec.password]
maximumPoolSize = Ledger.config[DatabaseExtensionSpec.maxPoolSize]
addDataSourceProperty("reWriteBatchedInserts", "true")
for ((key, value) in Ledger.config[DatabaseExtensionSpec.properties]) {
addDataSourceProperty(key, value)
}

View File

@@ -3,10 +3,11 @@ package net.quiltservertools.ledger.databases.databases
import com.github.quiltservertools.ledger.Ledger
import org.sqlite.SQLiteDataSource
import java.nio.file.Path
import kotlin.io.path.pathString
object SQLite : LedgerDatabase {
override fun getDataSource(savePath: Path) = SQLiteDataSource().apply {
url = "jdbc:sqlite:$savePath"
url = "jdbc:sqlite:${savePath.pathString}"
}
override fun getDatabaseIdentifier() = Ledger.identifier(Ledger.DEFAULT_DATABASE)

View File

@@ -9,8 +9,8 @@
"yitzy299"
],
"contact": {
"homepage": "https://fabricmc.net/",
"sources": "https://github.com/FabricMC/fabric-example-mod"
"homepage": "https://modrinth.com/project/ledger-databases",
"sources": "https://github.com/QuiltServerTools/Ledger-Databases"
},
"license": "LGPL-3.0",