mirror of
https://github.com/BlockWorldGroup/Ledger-Databases.git
synced 2025-08-17 19:49:42 +08:00
Minor fixes
This commit is contained in:
parent
c583e32bab
commit
9f1f12318d
11
README.md
11
README.md
@ -28,6 +28,8 @@ url = ""
|
|||||||
username = ""
|
username = ""
|
||||||
password = ""
|
password = ""
|
||||||
properties = []
|
properties = []
|
||||||
|
maxPoolSize = 10
|
||||||
|
connectionTimeout = 60000
|
||||||
```
|
```
|
||||||
|
|
||||||
`url`: Must be URL of database with `/<database_name>` appended. An example URL would be `localhost/ledger`. You can optionally add port information such as `localhost:3000/ledger`
|
`url`: Must be URL of database with `/<database_name>` appended. An example URL would be `localhost/ledger`. You can optionally add port information such as `localhost:3000/ledger`
|
||||||
@ -41,6 +43,15 @@ url = ""
|
|||||||
username = ""
|
username = ""
|
||||||
password = ""
|
password = ""
|
||||||
properties = []
|
properties = []
|
||||||
|
maxPoolSize = 10
|
||||||
|
connectionTimeout = 60000
|
||||||
|
```
|
||||||
|
|
||||||
|
## SQLite
|
||||||
|
|
||||||
|
```toml
|
||||||
|
[database_extensions]
|
||||||
|
database = "SQLITE"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Connector properties
|
## Connector properties
|
||||||
|
@ -11,6 +11,3 @@ org.gradle.jvmargs=-Xmx2G
|
|||||||
mod_version = 1.2.0
|
mod_version = 1.2.0
|
||||||
maven_group = net.quiltservertools
|
maven_group = net.quiltservertools
|
||||||
archives_base_name = ledger-databases
|
archives_base_name = ledger-databases
|
||||||
|
|
||||||
# Dependencies
|
|
||||||
fabric_version=0.58.0+1.19
|
|
||||||
|
@ -26,6 +26,9 @@ object MySQL : LedgerDatabase {
|
|||||||
addDataSourceProperty("useLocalSessionState", true)
|
addDataSourceProperty("useLocalSessionState", true)
|
||||||
addDataSourceProperty("elideSetAutoCommits", true)
|
addDataSourceProperty("elideSetAutoCommits", true)
|
||||||
addDataSourceProperty("alwaysSendSetIsolation", false)
|
addDataSourceProperty("alwaysSendSetIsolation", false)
|
||||||
|
addDataSourceProperty("useJDBCCompliantTimezoneShift", true)
|
||||||
|
addDataSourceProperty("useLegacyDatetimeCode", false)
|
||||||
|
addDataSourceProperty("serverTimezone", "UTC")
|
||||||
for ((key, value) in Ledger.config[DatabaseExtensionSpec.properties]) {
|
for ((key, value) in Ledger.config[DatabaseExtensionSpec.properties]) {
|
||||||
addDataSourceProperty(key, value)
|
addDataSourceProperty(key, value)
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,7 @@ object PostgreSQL : LedgerDatabase {
|
|||||||
username = Ledger.config[DatabaseExtensionSpec.userName]
|
username = Ledger.config[DatabaseExtensionSpec.userName]
|
||||||
password = Ledger.config[DatabaseExtensionSpec.password]
|
password = Ledger.config[DatabaseExtensionSpec.password]
|
||||||
maximumPoolSize = Ledger.config[DatabaseExtensionSpec.maxPoolSize]
|
maximumPoolSize = Ledger.config[DatabaseExtensionSpec.maxPoolSize]
|
||||||
|
addDataSourceProperty("reWriteBatchedInserts", "true")
|
||||||
for ((key, value) in Ledger.config[DatabaseExtensionSpec.properties]) {
|
for ((key, value) in Ledger.config[DatabaseExtensionSpec.properties]) {
|
||||||
addDataSourceProperty(key, value)
|
addDataSourceProperty(key, value)
|
||||||
}
|
}
|
||||||
|
@ -3,10 +3,11 @@ package net.quiltservertools.ledger.databases.databases
|
|||||||
import com.github.quiltservertools.ledger.Ledger
|
import com.github.quiltservertools.ledger.Ledger
|
||||||
import org.sqlite.SQLiteDataSource
|
import org.sqlite.SQLiteDataSource
|
||||||
import java.nio.file.Path
|
import java.nio.file.Path
|
||||||
|
import kotlin.io.path.pathString
|
||||||
|
|
||||||
object SQLite : LedgerDatabase {
|
object SQLite : LedgerDatabase {
|
||||||
override fun getDataSource(savePath: Path) = SQLiteDataSource().apply {
|
override fun getDataSource(savePath: Path) = SQLiteDataSource().apply {
|
||||||
url = "jdbc:sqlite:$savePath"
|
url = "jdbc:sqlite:${savePath.pathString}"
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun getDatabaseIdentifier() = Ledger.identifier(Ledger.DEFAULT_DATABASE)
|
override fun getDatabaseIdentifier() = Ledger.identifier(Ledger.DEFAULT_DATABASE)
|
||||||
|
@ -9,8 +9,8 @@
|
|||||||
"yitzy299"
|
"yitzy299"
|
||||||
],
|
],
|
||||||
"contact": {
|
"contact": {
|
||||||
"homepage": "https://fabricmc.net/",
|
"homepage": "https://modrinth.com/project/ledger-databases",
|
||||||
"sources": "https://github.com/FabricMC/fabric-example-mod"
|
"sources": "https://github.com/QuiltServerTools/Ledger-Databases"
|
||||||
},
|
},
|
||||||
|
|
||||||
"license": "LGPL-3.0",
|
"license": "LGPL-3.0",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user