generated from erangel1/generic-template
Update db.go
This commit is contained in:
@@ -11,7 +11,7 @@ type Task struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func InitDB() *gorm.DB {
|
func InitDB() *gorm.DB {
|
||||||
dsn := "host=gopostgres-vlcjiq user=postgres password=postgres dbname=go_postgres port=5432 sslmode=disable"
|
dsn := "host=postgresql://postgres:postgres@gopostgres-vlcjiq:5432/go_postgres user=postgres password=postgres dbname=go_postgres port=5432 sslmode=disable"
|
||||||
db, err := gorm.Open(postgres.Open(dsn), &gorm.Config{})
|
db, err := gorm.Open(postgres.Open(dsn), &gorm.Config{})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic("Failed to connect to database")
|
panic("Failed to connect to database")
|
||||||
|
|||||||
Reference in New Issue
Block a user