Activate pg debug via config
Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
@@ -29,6 +29,7 @@ type (
|
|||||||
Database string `json:"database"`
|
Database string `json:"database"`
|
||||||
PoolSize int32 `json:"pool-size"`
|
PoolSize int32 `json:"pool-size"`
|
||||||
CACertBundle string `json:"ca-cert-bundle"`
|
CACertBundle string `json:"ca-cert-bundle"`
|
||||||
|
Debug bool `json:"debug"`
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -41,6 +42,10 @@ func (cfg pgConfig) Options(options ...pg.Option) []pg.Option {
|
|||||||
pg.WithPoolSize(cfg.PoolSize),
|
pg.WithPoolSize(cfg.PoolSize),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if cfg.Debug {
|
||||||
|
opts = append(opts, pg.WithDebug())
|
||||||
|
}
|
||||||
|
|
||||||
if cfg.CACertBundle != "" {
|
if cfg.CACertBundle != "" {
|
||||||
var certs []*x509.Certificate
|
var certs []*x509.Certificate
|
||||||
pemData := []byte(cfg.CACertBundle)
|
pemData := []byte(cfg.CACertBundle)
|
||||||
|
|||||||
Reference in New Issue
Block a user