Activate pg debug via config

Signed-off-by: Émile Ré <emile@getprobo.com>
This commit is contained in:
Émile Ré
2026-02-13 13:58:18 +04:00
parent 9171900a84
commit 03404e5d63

View File

@@ -29,6 +29,7 @@ type (
Database string `json:"database"`
PoolSize int32 `json:"pool-size"`
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),
}
if cfg.Debug {
opts = append(opts, pg.WithDebug())
}
if cfg.CACertBundle != "" {
var certs []*x509.Certificate
pemData := []byte(cfg.CACertBundle)