mirror of
https://github.com/BlockWorldGroup/Ledger-Databases.git
synced 2025-08-18 04:10:15 +08:00
64 lines
1.3 KiB
Markdown
64 lines
1.3 KiB
Markdown
# Ledger Databases
|
|
|
|
Adds support for MySQL, H2, and PostgreSQL databases in Ledger
|
|
|
|
## Use
|
|
|
|
## Common
|
|
|
|
For both MySQL, H2, and PostgreSQL, you will need to place Ledger Databases in your mods folder along with Ledger 1.1.0 or newer
|
|
|
|
## H2
|
|
|
|
Add the following to the bottom of your Ledger config file:
|
|
|
|
```toml
|
|
[database_extensions]
|
|
database = "H2"
|
|
```
|
|
|
|
## MySQL
|
|
|
|
Add the following to the bottom of your Ledger config file:
|
|
|
|
```toml
|
|
[database_extensions]
|
|
database = "MYSQL"
|
|
url = ""
|
|
username = ""
|
|
password = ""
|
|
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`
|
|
|
|
## PostgreSQL
|
|
|
|
```toml
|
|
[database_extensions]
|
|
database = "POSTGRESQL"
|
|
url = ""
|
|
username = ""
|
|
password = ""
|
|
properties = []
|
|
maxPoolSize = 10
|
|
connectionTimeout = 60000
|
|
```
|
|
|
|
## SQLite
|
|
|
|
```toml
|
|
[database_extensions]
|
|
database = "SQLITE"
|
|
```
|
|
|
|
## Connector properties
|
|
|
|
For some databases, such as MySQL, you can provide properties to the database connector. For each property, add a string entry to the `properties` array.
|
|
|
|
```toml
|
|
properties = ["useJDBCCompliantTimezoneShift=true", "useLegacyDatetimeCode=false", "serverTimezone=UTC"]
|
|
```
|