mirror of
https://github.com/FJurmanovic/wallet-go-api.git
synced 2026-02-06 06:08:16 +00:00
starter
This commit is contained in:
17
pkg/utl/db/db.go
Normal file
17
pkg/utl/db/db.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package db
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"wallet-api/pkg/utl/common"
|
||||
|
||||
"github.com/go-pg/pg/v10"
|
||||
)
|
||||
|
||||
func CreateConnection(dbUrl string) *pg.DB {
|
||||
opt, err := pg.ParseURL(dbUrl)
|
||||
common.CheckError(err)
|
||||
conn := pg.Connect(opt)
|
||||
|
||||
fmt.Println("Successfully connected!")
|
||||
return conn
|
||||
}
|
||||
Reference in New Issue
Block a user