func ProvideDB(
	ctx context.Context,
	cfg *config.Config,
	logger *log.Logger,
) (*pgxpool.Pool, error) {
	pgCfg, err := pgxpool.ParseConfig(cfg.ConnectString)
	if err != nil {
		return nil, nil
	}
	if pgCfg.MaxConns < int32(cfg.ChunkConcurrency) {
		pgCfg.MaxConns = int32(cfg.ChunkConcurrency)
		logger.Infof("raising pool_max_conns to %d", cfg.ChunkConcurrency)
	}
	pgCfg.AfterConnect = func(ctx context.Context, conn *pgx.Conn) error {
		_, err := conn.Exec(ctx, "SET application_name = $1", "cacheroach")
		return err
	}
	return pgxpool.ConnectConfig(ctx, pgCfg)
}
ProvideDB creates a database connection pool.
package storeproduction
import (
	"context"
	"github.com/Mandala/go-log"
	"github.com/bobvawter/cacheroach/pkg/cache"
	"github.com/bobvawter/cacheroach/pkg/store/config"
	"github.com/google/wire"
	"github.com/jackc/pgx/v4"
	"github.com/jackc/pgx/v4/pgxpool"
)
var Set = wire.NewSet(
	ProvideDB,
	cache.Set,
)