mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-17 20:02:05 +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() {
|
func main() {
|
||||||
|
database := os.Getenv("CLICKHOUSE_DATABASE")
|
||||||
p, err := url.Parse("http://localhost:8123/")
|
p, err := url.Parse("http://localhost:8123/")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
}
|
}
|
||||||
q := p.Query()
|
q := p.Query()
|
||||||
|
|
||||||
q.Set("query", "INSERT INTO graphite FORMAT RowBinary")
|
q.Set("query", "INSERT INTO "+database+".graphite FORMAT RowBinary")
|
||||||
p.RawQuery = q.Encode()
|
p.RawQuery = q.Encode()
|
||||||
queryUrl := p.String()
|
queryUrl := p.String()
|
||||||
|
|
||||||
var req *http.Request
|
var req *http.Request
|
||||||
|
|
||||||
|
|
||||||
req, err = http.NewRequest("POST", queryUrl, compress(os.Stdin))
|
req, err = http.NewRequest("POST", queryUrl, compress(os.Stdin))
|
||||||
req.Header.Add("Content-Encoding", "gzip")
|
req.Header.Add("Content-Encoding", "gzip")
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user