mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-12-07 20:18:06 -06:00
[feature] Add db-postgres-connection-string option (#3178)
* handle db-url * lint and add doc * add more doc * fix config test * return error * change name from db-url to db-postgres-connection-string
This commit is contained in:
parent
b19cfee7ae
commit
94c615d417
6 changed files with 70 additions and 13 deletions
|
|
@ -396,6 +396,13 @@ func maxOpenConns() int {
|
|||
// deriveBunDBPGOptions takes an application config and returns either a ready-to-use set of options
|
||||
// with sensible defaults, or an error if it's not satisfied by the provided config.
|
||||
func deriveBunDBPGOptions() (*pgx.ConnConfig, error) {
|
||||
url := config.GetDbPostgresConnectionString()
|
||||
|
||||
// if database URL is defined, ignore other DB related configuration fields
|
||||
if url != "" {
|
||||
cfg, err := pgx.ParseConfig(url)
|
||||
return cfg, err
|
||||
}
|
||||
// these are all optional, the db adapter figures out defaults
|
||||
address := config.GetDbAddress()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue