Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // 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}
- }
Add Comment
Please, Sign In to add comment