Skip to content

Latest commit

 

History

History
31 lines (24 loc) · 675 Bytes

README.md

File metadata and controls

31 lines (24 loc) · 675 Bytes

pq-driver

Install

$ go get github.com/innotechdevops/pq-driver

How to use

  • Wtih env
driver := pqdriver.New(pqdriver.ConfigEnv())
  • With config
driver := pqdriver.New(pqdriver.Config{
    User:         os.Getenv("POSTGRES_USER"),
    Pass:         os.Getenv("POSTGRES_PASS"),
    Host:         os.Getenv("POSTGRES_HOST"),
    DatabaseName: os.Getenv("POSTGRES_DATABASE"),
    Port:         pqdriver.DefaultPort,
    SSLMode:      pqdriver.SSLModeDisable,
    MaxLifetime:  os.Getenv("POSTGRES_MAX_LIFETIME"),
    MaxIdleConns: os.Getenv("POSTGRES_MAX_IDLE_CONNS"),
    MaxOpenConns: os.Getenv("POSTGRES_MAX_OPEN_CONNS"),
})