Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dehwyy committed Dec 17, 2023
1 parent 8773ce0 commit fc1ef80
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions libs/db/src/go/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import (
func New(database_url string) *gorm.DB {
fmt.Printf("database_url: %s\n", database_url)

if database_url == "" {
database_url = "host=localhost user=postgres password=postgres dbname=postgres port=5432 sslmode=disable"
}

db, err := gorm.Open(postgres.New(postgres.Config{
DSN: database_url,
}), &gorm.Config{})
Expand Down

0 comments on commit fc1ef80

Please sign in to comment.