()
| 37 | } |
| 38 | |
| 39 | func loadConfig() (*pgxpool.Config, error) { |
| 40 | cfg, err := config.NewDatabase() |
| 41 | if err != nil { |
| 42 | return loadConfigFromURL() |
| 43 | } |
| 44 | |
| 45 | return pgxpool.ParseConfig(fmt.Sprintf( |
| 46 | "user=%s password=%s host=%s port=%d dbname=%s sslmode=%s", |
| 47 | cfg.Username, cfg.Password, cfg.Host, cfg.Port, cfg.DBName, cfg.SSLMode, |
| 48 | )) |
| 49 | } |
| 50 | |
| 51 | func dbURL() (string, error) { |
| 52 | cfg, err := config.NewDatabase() |
no test coverage detected