func newProcessor() query.Processor {
	return &processor{}
}
query.Processor interface implementation
package main
import (
	"encoding/json"
	"fmt"
	"strings"
	"time"
	"github.com/blagojts/viper"
	"github.com/jmoiron/sqlx"
	_ "github.com/kshvakov/clickhouse"
	"github.com/spf13/pflag"
	"github.com/timescale/tsbs/internal/utils"
	"github.com/timescale/tsbs/pkg/query"
)
var (
	chConnect string
	hostsList []string
	user      string
	password  string
	showExplain bool
)
var (
	runner *query.BenchmarkRunner
)
func init() {
	var config query.BenchmarkRunnerConfig
	config.AddToFlagSet(pflag.CommandLine)
	var hosts string
	pflag.String("additional-params", "sslmode=disable",
		"String of additional ClickHouse connection parameters, e.g., 'sslmode=disable'.")
	pflag.String("hosts", "localhost",
		"Comma separated list of ClickHouse hosts (pass multiple values for sharding reads on a multi-node setup)")
	pflag.String("user", "default", "User to connect to ClickHouse as")
	pflag.String("password", "", "Password to connect to ClickHouse")
	pflag.Parse()
	err := utils.SetupConfigFile()
	if err != nil {
		panic(fmt.Errorf("fatal error config file: %s", err))
	}
	if err := viper.Unmarshal(&config); err != nil {
		panic(fmt.Errorf("unable to decode config: %s", err))
	}
	chConnect = viper.GetString("additional-params")
	hosts = viper.GetString("hosts")
	user = viper.GetString("user")
	password = viper.GetString("password")
	for _, host := range strings.Split(hosts, ",") {
		hostsList = append(hostsList, host)
	}
	runner = query.NewBenchmarkRunner(config)
}
func main() {
	runner.Run(&query.ClickHousePool, newProcessor)
}
func getConnectString(workerNumber int) string {
	host := hostsList[workerNumber%len(hostsList)]
	return fmt.Sprintf("tcp://%s:9000?username=%s&password=%s&database=%s", host, user, password, runner.DatabaseName())
}
func prettyPrintResponse(rows *sqlx.Rows, q *query.ClickHouse) {
	resp := make(map[string]interface{})
	resp["query"] = string(q.SqlQuery)
	results := []map[string]interface{}{}
	for rows.Next() {
		r := make(map[string]interface{})
		if err := rows.MapScan(r); err != nil {
			panic(err)
		}
		results = append(results, r)
		resp["results"] = results
	}
	line, err := json.MarshalIndent(resp, "", "  ")
	if err != nil {
		panic(err)
	}
	fmt.Println(string(line) + "\n")
}
type queryExecutorOptions struct {
	showExplain   bool
	debug         bool
	printResponse bool
}
type processor struct {
	db   *sqlx.DB
	opts *queryExecutorOptions
}