Using master pg library

This commit is contained in:
Las Zenow 2017-05-18 22:16:16 +00:00
parent d9a95a997c
commit e0854aa001
8 changed files with 43 additions and 76 deletions

View file

@ -1,7 +1,7 @@
package database
import (
"gopkg.in/pg.v4"
"github.com/go-pg/pg"
)
type DB interface {
@ -45,7 +45,12 @@ type Options struct {
// Init the database connection
func Init(options Options) (DB, error) {
network := "tcp"
if options.Addr[0] == '/' {
network = "unix"
}
sql := pg.Connect(&pg.Options{
Network: network,
Addr: options.Addr,
User: options.User,
Password: options.Password,