2023-02-02 10:55:24 +01:00
|
|
|
package config
|
|
|
|
|
|
|
|
const (
|
|
|
|
DatabaseDriverPostgres = "postgres"
|
|
|
|
DatabaseDriverSQLite = "sqlite"
|
|
|
|
)
|
|
|
|
|
|
|
|
// DatabaseConfig definition
|
|
|
|
type DatabaseConfig struct {
|
|
|
|
Driver InterpolatedString `yaml:"driver"`
|
|
|
|
DSN InterpolatedString `yaml:"dsn"`
|
|
|
|
}
|
|
|
|
|
|
|
|
// NewDefaultDatabaseConfig return the default database configuration
|
|
|
|
func NewDefaultDatabaseConfig() DatabaseConfig {
|
|
|
|
return DatabaseConfig{
|
|
|
|
Driver: "sqlite",
|
2023-03-31 17:27:54 +02:00
|
|
|
DSN: "sqlite://emissary.sqlite?_pragma=foreign_keys(1)&_pragma=journal_mode(WAL)&_txlock=immediate",
|
2023-02-02 10:55:24 +01:00
|
|
|
}
|
|
|
|
}
|