diff --git a/clickhouse_options.go b/clickhouse_options.go index f9ddcb343d..1aef8194df 100644 --- a/clickhouse_options.go +++ b/clickhouse_options.go @@ -265,6 +265,24 @@ func (o *Options) fromDSN(in string) error { case "round_robin": o.ConnOpenStrategy = ConnOpenRoundRobin } + case "max_open_conns": + maxOpenConns, err := strconv.Atoi(params.Get(v)) + if err != nil { + return errors.Wrap(err, "max_open_conns invalid value") + } + o.MaxOpenConns = maxOpenConns + case "max_idle_conns": + maxIdleConns, err := strconv.Atoi(params.Get(v)) + if err != nil { + return errors.Wrap(err, "max_idle_conns invalid value") + } + o.MaxIdleConns = maxIdleConns + case "conn_max_lifetime": + connMaxLifetime, err := time.ParseDuration(params.Get(v)) + if err != nil { + return errors.Wrap(err, "conn_max_lifetime invalid value") + } + o.ConnMaxLifetime = connMaxLifetime case "username": o.Auth.Username = params.Get(v) case "password":