We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'd like to use this lib to create a new InfluxDB database like the SQL command create database xxx. Is it possible to do that?
create database xxx
The text was updated successfully, but these errors were encountered:
There is a NewQuery function in the client package: https://github.com/influxdata/influxdb1-client/blob/master/v2/client.go#L471-L473
NewQuery
client
You could probably just change the example in the readme to execute the query that you wish to run:
func ExampleClient_query() { c, err := client.NewHTTPClient(client.HTTPConfig{ Addr: "http://localhost:8086", }) if err != nil { fmt.Println("Error creating InfluxDB Client: ", err.Error()) } defer c.Close() q := client.NewQuery("create database xxx", "", "") if response, err := c.Query(q); err == nil && response.Error() == nil { fmt.Println(response.Results) } }
I've not tested this, but it might work.
Hope this helps!
Sorry, something went wrong.
No branches or pull requests
I'd like to use this lib to create a new InfluxDB database like the SQL command
create database xxx
.Is it possible to do that?
The text was updated successfully, but these errors were encountered: