Merge pull request 'Add Infra' (#1) from feature-test into main
Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
+6
-6
@@ -13,14 +13,14 @@ type DB struct {
|
||||
*gorm.DB
|
||||
}
|
||||
|
||||
func NewDB() (*DB, error) {
|
||||
func NewDB(cfg *config.Config) (*DB, error) {
|
||||
dsn := fmt.Sprintf(
|
||||
"host=%s user=%s password=%s dbname=%s port=%v sslmode=disable",
|
||||
config.DB_HOST,
|
||||
config.DB_USER,
|
||||
config.DB_PASSWORD,
|
||||
config.DB_NAME,
|
||||
config.DB_PORT,
|
||||
cfg.Database.Host,
|
||||
cfg.Database.Username,
|
||||
cfg.Database.Password,
|
||||
cfg.Database.DB,
|
||||
cfg.Database.Port,
|
||||
)
|
||||
|
||||
if dsn == "" {
|
||||
|
||||
Reference in New Issue
Block a user