Guest User

Untitled

a guest
Jan 22nd, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. // Client is a Postgres client.
  2. // It wraps a pool of Postgres DB connections.
  3. type Client struct {
  4. *pg.DB
  5. }
  6.  
  7. // NewDBClient creates a Postgres client
  8. func NewDBClient(addr string, user string, password string, database string) *Client {
  9. db := pg.Connect(&pg.Options{
  10. Addr: addr,
  11. User: user,
  12. Password: password,
  13. Database: database,
  14. })
  15.  
  16. return &Client{db}
  17. }
Add Comment
Please, Sign In to add comment