Skip to content

Database

David Gerber edited this page Oct 19, 2024 · 2 revisions

Using H2

Xeres uses the H2 database. The following is a list of guidelines:

Data types

Instant

TIMESTAMP(9)

By default, the precision is 6, which is only up to milliseconds instead of nanoseconds. Truncation will occur and make comparison with a fresh instant fail. So make sure to always specify 9 as precision.

Accessing the database

Online

While Xeres is running with the dev profile, there's a built-in H2 Console available, accessible through the Debug menu.

Offline

With IntelliJ Ultimate, create the following Database connection with the built-in Datagrip client (aka the Database tool window)

  • Connection type: Embedded
  • Driver: H2
  • Path: select ./data/userdata.mv.db. If the file is not there, run Xeres once.
  • Authentication: User & Password
  • User: sa
  • There's no password

You can also download the H2 installer (version to use: 2.2.224). Then run the H2 console with the following settings:

  • Saved Settings: Generic H2 (Embedded)
  • Driver Class: org.h2.Driver
  • JDBC URL: hdbc:h2:file:~/workspace/Xeres/data/userdata (put your path, and no file extension at the end!)
  • User Name: sa
  • The password is empty
Clone this wiki locally