Storage

Storage configuration describes which database should be used for data persistence and the connection string required to connect to the database. This information is organized in 2 separate configuration files:

  1. db.<database>.conf - datasource configuration

Database configuration

Database configuration holds the datasource configuration filename (with no extension). The content of this configuration file will then be loaded and used as the connection string for the database. The filename should have the following format: db.<database> The database configuration is stored in the config/db.conf.

SQLite Config

database = "db.sqlite"

Postgres Config

database = "db.postgres"

Datasource Configs

They hold the connection string used to connect to the chosen database.

Sqlite Datasource Config

Can be found in config/db.sqlite.conf

hikariDataSource {
    jdbcUrl = "jdbc:sqlite:data.db"
    driverClassName = "org.sqlite.JDBC"
    username = ""
    password = ""
    transactionIsolation = "TRANSACTION_SERIALIZABLE"
    maximumPoolSize = 5
    autoCommit = false
    dataSource {
        journalMode = "WAL"
        fullColumnNames = false
    }
}

Postgres Datasource Config

Can be found in config/db.postgres.conf

hikariDataSource {
    jdbcUrl = "jdbc:postgresql://127.0.0.1:5432/postgres"
    driverClassName = "org.postgresql.Driver"
    username = "postgres"
    password = "postgres"
    transactionIsolation = "TRANSACTION_SERIALIZABLE"
    maximumPoolSize = 5
    minimumIdle: 0
    autoCommit = false
    dataSource {
        journalMode = WAL
        fullColumnNames = false
    }
}

Last updated