pq-driver

module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 22, 2021 License: MIT

README

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("MARIA_MAX_LIFETIME"),
    MaxIdleConns: os.Getenv("MARIA_MAX_IDLE_CONNS"),
    MaxOpenConns: os.Getenv("MARIA_MAX_OPEN_CONNS"),
})

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL