Last active
January 22, 2019 09:28
-
-
Save shanev/2c4a324d8a56fd7e279a9d914f0de4a1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Client is a Postgres client. | |
// It wraps a pool of Postgres DB connections. | |
type Client struct { | |
*pg.DB | |
} | |
// NewDBClient creates a Postgres client | |
func NewDBClient(addr string, user string, password string, database string) *Client { | |
db := pg.Connect(&pg.Options{ | |
Addr: addr, | |
User: user, | |
Password: password, | |
Database: database, | |
}) | |
return &Client{db} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment