Ledger-Databases/README.md

81 lines
1.7 KiB
Markdown
Raw Normal View History

2021-09-16 18:12:44 +01:00
# Ledger Databases
2024-06-08 18:44:20 +02:00
Adds support for MySQL, MariaDB, H2, and PostgreSQL databases in Ledger
2021-09-16 18:24:01 +01:00
## Use
## Common
2024-06-08 18:44:20 +02:00
For both MySQL, MariaDB, H2, and PostgreSQL, you will need to place Ledger Databases in your mods folder along with Ledger 1.1.0 or newer
2021-09-16 18:24:01 +01:00
## H2
Add the following to the bottom of your Ledger config file:
```toml
[database_extensions]
database = "H2"
2021-09-16 18:24:01 +01:00
```
## MySQL
Add the following to the bottom of your Ledger config file:
```toml
[database_extensions]
database = "MYSQL"
2021-09-16 18:24:01 +01:00
url = ""
username = ""
password = ""
properties = []
2024-04-10 10:14:10 -07:00
maxPoolSize = 10
connectionTimeout = 60000
2021-09-16 18:24:01 +01:00
```
`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`
2024-05-05 00:50:40 +02:00
## MariaDB
Add the following to the bottom of your Ledger config file:
```toml
[database_extensions]
database = "MARIADB"
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]
2022-06-23 11:14:24 +08:00
database = "POSTGRESQL"
url = ""
username = ""
password = ""
properties = []
2024-04-10 10:14:10 -07:00
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"]
```