Skip to content

Commit 9f1f123

Browse files
Minor fixes
1 parent c583e32 commit 9f1f123

6 files changed

Lines changed: 20 additions & 7 deletions

File tree

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ url = ""
2828
username = ""
2929
password = ""
3030
properties = []
31+
maxPoolSize = 10
32+
connectionTimeout = 60000
3133
```
3234

3335
`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 = ""
4143
username = ""
4244
password = ""
4345
properties = []
46+
maxPoolSize = 10
47+
connectionTimeout = 60000
48+
```
49+
50+
## SQLite
51+
52+
```toml
53+
[database_extensions]
54+
database = "SQLITE"
4455
```
4556

4657
## Connector properties

gradle.properties

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,4 @@ org.gradle.jvmargs=-Xmx2G
1010
# Mod Properties
1111
mod_version = 1.2.0
1212
maven_group = net.quiltservertools
13-
archives_base_name = ledger-databases
14-
15-
# Dependencies
16-
fabric_version=0.58.0+1.19
13+
archives_base_name = ledger-databases

src/main/kotlin/net/quiltservertools/ledger/databases/databases/MySQL.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ object MySQL : LedgerDatabase {
2626
addDataSourceProperty("useLocalSessionState", true)
2727
addDataSourceProperty("elideSetAutoCommits", true)
2828
addDataSourceProperty("alwaysSendSetIsolation", false)
29+
addDataSourceProperty("useJDBCCompliantTimezoneShift", true)
30+
addDataSourceProperty("useLegacyDatetimeCode", false)
31+
addDataSourceProperty("serverTimezone", "UTC")
2932
for ((key, value) in Ledger.config[DatabaseExtensionSpec.properties]) {
3033
addDataSourceProperty(key, value)
3134
}

src/main/kotlin/net/quiltservertools/ledger/databases/databases/PostgreSQL.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ object PostgreSQL : LedgerDatabase {
1414
username = Ledger.config[DatabaseExtensionSpec.userName]
1515
password = Ledger.config[DatabaseExtensionSpec.password]
1616
maximumPoolSize = Ledger.config[DatabaseExtensionSpec.maxPoolSize]
17+
addDataSourceProperty("reWriteBatchedInserts", "true")
1718
for ((key, value) in Ledger.config[DatabaseExtensionSpec.properties]) {
1819
addDataSourceProperty(key, value)
1920
}

src/main/kotlin/net/quiltservertools/ledger/databases/databases/SQLite.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ package net.quiltservertools.ledger.databases.databases
33
import com.github.quiltservertools.ledger.Ledger
44
import org.sqlite.SQLiteDataSource
55
import java.nio.file.Path
6+
import kotlin.io.path.pathString
67

78
object SQLite : LedgerDatabase {
89
override fun getDataSource(savePath: Path) = SQLiteDataSource().apply {
9-
url = "jdbc:sqlite:$savePath"
10+
url = "jdbc:sqlite:${savePath.pathString}"
1011
}
1112

1213
override fun getDatabaseIdentifier() = Ledger.identifier(Ledger.DEFAULT_DATABASE)

src/main/resources/fabric.mod.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@
99
"yitzy299"
1010
],
1111
"contact": {
12-
"homepage": "https://fabricmc.net/",
13-
"sources": "https://github.com/FabricMC/fabric-example-mod"
12+
"homepage": "https://modrinth.com/project/ledger-databases",
13+
"sources": "https://github.com/QuiltServerTools/Ledger-Databases"
1414
},
1515

1616
"license": "LGPL-3.0",

0 commit comments

Comments
 (0)