Database
The configuration file must also specify a database.
The supported databases are SQLite3, PostgreSQL, MariaDB, MySQL. The configuration looks like this:
[Database]
DriverName = "sqlite3"
DataSourceName = "/path/to/database"
EncryptorMasterPassword = "password"
DriverName is the name of the datasource and can be either sqlite3, mysql, or postgres. For mysql, an example of a datasource name could be:
`USER:PASSWORD@HOST:3306/DATABASE_NAME?parseTime=true`
and for postgreSQL:
`postgres://USER:PASSWORD@HOST:5432/DATABASE_NAME?sslmode=disable`
EncryptorMasterPassword specifies a master encryption key used to protect database records. This key is not directly used to encrypt data (as explained here). Use any long random string here and make sure to keep a backup of it somewhere safe.
Notes on options
MySQL
On mysql the option:
?parseTime=trueis required for Golang to get the correct time objects.
This is not required for MariaDB.
PostgreSQL
The option:
?sslmode=disable
is required when running against databases that uses self-signed certificates
Updated 4 days ago
