Skip to content
New issue

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

Better examples showing querying database? #20

Open
DarrienG opened this issue Sep 9, 2019 · 1 comment
Open

Better examples showing querying database? #20

DarrienG opened this issue Sep 9, 2019 · 1 comment

Comments

@DarrienG
Copy link

DarrienG commented Sep 9, 2019

Right now the examples for querying show querying and immediately printing the result. It would be helpful to add an example showing a user querying and getting the structured data.

The struct returned is interesting https://godoc.org/github.com/influxdata/influxdb1-client/models#Row with a map, list, and list of lists of interface{}. A better example would be awesome.

@andig
Copy link

andig commented Mar 21, 2020

Also missing any example how to actually use query params. How is the Parameters map used from the query expression? Any help welcome, I'm stuck...

For example, this needs a proper documentation:

	q := client.NewQuery("SELECT value FROM /[a-zA-Z]+Power/ WHERE time > since", "evcc", "")
	q.Parameters = map[string]interface{}{
		"since": time.Now().String(),
	}

invalid operation: time and *influxql.VarRef are not compatible
[{StatementId:0 Series:[] Messages:[] Err:invalid operation: time and *influxql.VarRef are not compatible}]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants