| 23 | ) |
| 24 | |
| 25 | func SimpleExecute(args *common.QuerierParams) (result *common.Result, debug map[string]interface{}, err error) { |
| 26 | chClient := client.Client{ |
| 27 | Host: config.Cfg.Clickhouse.Host, |
| 28 | Port: config.Cfg.Clickhouse.Port, |
| 29 | UserName: config.Cfg.Clickhouse.User, |
| 30 | Password: config.Cfg.Clickhouse.Password, |
| 31 | DB: "default", |
| 32 | Context: args.Context, |
| 33 | } |
| 34 | query_uuid := args.QueryUUID |
| 35 | debugInfo := &client.DebugInfo{} |
| 36 | queryDebug := &client.Debug{ |
| 37 | IP: config.Cfg.Clickhouse.Host, |
| 38 | QueryUUID: query_uuid, |
| 39 | } |
| 40 | chClient.Debug = queryDebug |
| 41 | result, err = chClient.DoQuery(&client.QueryParams{Sql: args.Sql, UseQueryCache: args.UseQueryCache, QueryCacheTTL: args.QueryCacheTTL}) |
| 42 | debugInfo.Debug = append(debugInfo.Debug, *queryDebug) |
| 43 | debug = debugInfo.Get() |
| 44 | return |
| 45 | } |