Add Infra

This commit is contained in:
aditya.siregar
2025-03-03 18:59:25 +07:00
parent c02d8cda69
commit c9f1e33c24
1782 changed files with 692894 additions and 21 deletions
+6 -6
View File
@@ -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 == "" {