Actually use pg

This commit is contained in:
2016-12-20 09:46:52 +01:00
parent 0f1bd4cac3
commit c3664ef3e0
2 changed files with 21 additions and 9 deletions

14
postgres/db.go Normal file
View File

@ -0,0 +1,14 @@
package postgres
import "gopkg.in/pg.v5"
// Connect to a database
func Connect(server string, user string, password string, database string) *pg.DB {
db := pg.Connect(&pg.Options{
User: user,
Password: password,
Addr: server,
Database: database,
})
return db
}