mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
add database name in go test
This commit is contained in:
parent
a7d982198c
commit
933b2e07c2
@ -24,19 +24,19 @@ func compress(data io.Reader) io.Reader {
|
||||
}
|
||||
|
||||
func main() {
|
||||
database := os.Getenv("CLICKHOUSE_DATABASE")
|
||||
p, err := url.Parse("http://localhost:8123/")
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
q := p.Query()
|
||||
|
||||
q.Set("query", "INSERT INTO graphite FORMAT RowBinary")
|
||||
q.Set("query", "INSERT INTO "+database+".graphite FORMAT RowBinary")
|
||||
p.RawQuery = q.Encode()
|
||||
queryUrl := p.String()
|
||||
|
||||
var req *http.Request
|
||||
|
||||
|
||||
req, err = http.NewRequest("POST", queryUrl, compress(os.Stdin))
|
||||
req.Header.Add("Content-Encoding", "gzip")
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user