Add H2 database support, use indexes to optimize queries, add maria-specific schema, bump adventure-fabric (#465)

* Add support for H2, bundle Maria driver, bump fabric adventure

* Bundle and download H2 drivers

* Fixup H2 schema, add indexes to DBs, add maria-specific schema

* docs: Add database type documentation

* Check plugin isn't disabled before task schedule, close #463

* Bump Annotaml to 2.0.4

* docs: Mention Maria in README and Setup
This commit is contained in:
William authored and GitHub committed 2023-07-18 15:03:31 +01:00
1 parent 8d2424a7ef
commit beed438c16
28 files changed
+1443 -50

No files matched your search

+3 -3
View File
@@ -24,11 +24,11 @@ language: en-gb
# Whether to automatically check for plugin updates on startup
check_for_updates: true
database:
# Type of database to use (MYSQL, SQLITE)
# Type of database to use (SQLITE, H2, MYSQL or MARIADB)
type: SQLITE
mysql:
credentials:
# Specify credentials here if you are using MYSQL as your database type
# Specify credentials here if you are using MYSQL or MARIADB as your database type
host: localhost
port: 3306
database: HuskHomes
@@ -36,7 +36,7 @@ database:
password: pa55w0rd
parameters: ?autoReconnect=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8
connection_pool:
# MYSQL database Hikari connection pool properties. Don't modify this unless you know what you're doing!
# MYSQL / MARIADB database Hikari connection pool properties. Don't modify this unless you know what you're doing!
size: 12
idle: 12
lifetime: 1800000
+48
View File
@@ -0,0 +1,48 @@
HuskHomes stores player data, homes, warps, and teleports in a database of your choosing. For cross-server setups, you'll need to configure a MySQL or MariaDB database to allow homes to be accessed globally.
## Database types
> **Warning:** There is currently no automatic way of migrating between _database_ types. Changing the database type will cause data to be lost.
| Type | File or Server | Description | Supports cross-server |
|:----------|----------------|:----------------------------------------------------------------------------|:---------------------:|
| `SQLITE` | File | A file-based database. This is the default (recommended) option. | ❌ |
| `H2` | File | A file-based database, similar to SQLITE, with slightly faster query times. | ❌ |
| `MYSQL` | Server | A database hosted on a MySQL server. | ✅ |
| `MARIADB` | Server | A database hosted on a MariaDB server. | ✅ |
### Cross-server
If you are using HuskHomes on a cross-server network, you will need to use a database type that supports cross-server setups. This is because cross-server setups require a single database to be shared between all servers so that HuskHomes can access the same data on each server.
## Configuring
To change the database type, navigate to your [`config.yml`](Config-Files) file and modify the properties under `database`.
<details>
<summary>Database options (config.yml)</summary>
```yaml
database:
# Type of database to use (SQLITE, H2, MYSQL or MARIADB)
type: SQLITE
mysql:
credentials:
# Specify credentials here if you are using MYSQL or MARIADB as your database type
host: localhost
port: 3306
database: HuskHomes
username: root
password: pa55w0rd
parameters: ?autoReconnect=true&useSSL=false&useUnicode=true&characterEncoding=UTF-8
connection_pool:
# MYSQL / MARIADB database Hikari connection pool properties. Don't modify this unless you know what you're doing!
size: 12
idle: 12
lifetime: 1800000
keepalive: 30000
timeout: 20000
```
</details>
### Credentials (MariaDB & MySQL)
You will need to specify the credentials (hostname, port, username, password and the database) if you are using MariaDB or MySQL. These credentials are used to connect to your database server.
Additionally, you can modify the HikariCP connection pool properties if you know what you're doing. The default values should be fine for most users.
+1
View File
@@ -10,6 +10,7 @@ Welcome to the plugin documentation for HuskHomes v4.x+, the powerful and intuit
* 📜 [[Command Conflicts]]
## Documentation
* 📁 [[Database]]
* ⛅ [[Redis Support]]
* 📝 [[Translations]]
* 🟩 [[Plan Hook]]
+6 -5
View File
@@ -2,7 +2,7 @@ This will walk you through installing HuskHomes on your Spigot, Fabric or Sponge
## Requirements
* A Spigot (1.16.5+), Fabric (latest Minecraft version), or Sponge (Implementing API v8) _Minecraft: Java Edition_ server running on Java 16+
* (For proxy network support) A proxy server (Velocity, BungeeCord) and MySQL (v8.0+) database
* (For proxy network support) A proxy server (Velocity, BungeeCord) and MySQL (v8.0+)/MariaDB database
* (For optional [[Redis support]]) A Redis database (v5.0+)
## Download HuskHomes for your server
@@ -18,7 +18,7 @@ These instructions are for simply installing HuskHomes on one Spigot, Fabric or
- Place the plugin jar file in the `/plugins/` directory of your Spigot server, or the `/mods` directory of your Fabric/Sponge server.
### 2. Restart the server and configure
- Start, then stop your server to let HuskHomes generate the config file.
- You can now edit the config and locales to your liking.
- You can now edit the [config](Config-Files) and locales to your liking.
### 3. Turn on your server
- Start your server again and enjoy HuskHomes!
@@ -34,9 +34,9 @@ These instructions are for installing HuskHomes on multiple Spigot, Fabric or Sp
- Start, then stop every server to let HuskHomes generate the config file.
- Advanced users: If you'd prefer, you can just create one config.yml file and create symbolic links in each `/plugins/HuskHomes/` (`/config/huskhomes/` on Fabric/Sponge) folder to it to make updating it easier.
### 3. Configure servers to use cross-server mode
- Navigate to the HuskHomes config file on each server (`~/plugins/HuskHomes/config.yml` on Spigot, `~/config/huskhomes/config.yml` on Fabric/Sponge)
- Under `database`, set `type` to `MYSQL`
- Under `mysql`/`credentials`, enter the credentials of your MySQL database server.
- Navigate to the HuskHomes [config](Config-Files) file on each server (`~/plugins/HuskHomes/config.yml` on Spigot, `~/config/huskhomes/config.yml` on Fabric/Sponge)
- Under `database`, set `type` to `MYSQL` or `MARIADB` (depending on which type of database you wish to use)
- Under `mysql`/`credentials`, enter the credentials of your MySQL or MariaDB database server.
- Scroll down and look for the `cross_server` section. Set `enabled` to `true`.
- You can additionally configure a Redis server to use for network messaging, if you prefer (set the `messenger_type` to `REDIS` if you do this).
- Save the config file. Make sure you have updated the file on every server.
@@ -50,5 +50,6 @@ These instructions are for installing HuskHomes on multiple Spigot, Fabric or Sp
## Next steps
* [Commands & Permissions](Commands)
* [[Config Files]]
* [[Database]]
* [[Redis Support]]
* [[Translations]]
+1
View File
@@ -7,6 +7,7 @@
* 📜 [[Command Conflicts]]
## Documentation
* 📁 [[Database]]
* ⛅ [[Redis Support]]
* 📝 [[Translations]]
* 🟩 [[Plan Hook]]