H2 as a Server

This is a Guide if you are interested in using H2 as a embedded Server.

Why?

Well if you want to use the Bot and the Backend at the same time, using only H2 or SQLite won't work! Since they lock the file on every read-and-write operation. So if you use H2 you can enable the option called createEmbeddedServer which allows you to create a small H2 Database Server that handles all incoming requests for anything Database related!

Setup

To start you will need to set the value hikari.misc.createEmbeddedServer to true and set the storage to h2. Once you do so only other thing you need to do is set the same port on the Backend and set the host to the IP of the Bot. After setting all these values the last thing to do is set the storage type to h2-server on the Backend and it should connect to the H2 Server running on the

Last updated