Actually use pg
This commit is contained in:
14
postgres/db.go
Normal file
14
postgres/db.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user