Skip to content

innotechdevops/pq-driver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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"),
})

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages