Closed JohnnyBee2 closed 3 years ago
Which ones? I am using a variable replacement function in the frontend
Variables created in dashboard settings ($var...). They don't work for me. Query inspector shows the empty space in the place of the variable.
Could you maybe export your dashboard as JSON and attach it here? For local development, I have a dashboard with a variable and it's working fine. Maybe I just need an exact reproducible case to see the problem. Here is the working dashboard:
Hmmm, I created a new dashboard and did a series of tests. it seems to me that variables (not of type QUERY) are transferred correctly to SQL. My mistake, sorry. Thank you for your help.
But I have one more problem. Generating variables in dashboard settings as a query type does not work for me. Datasource works fine in tables - data is visible. The variables show nothing. Any suggestions?
Ok, query variables are something else here apparently. I haven't actively implemented the, but would have guessed, that they should be supported with the default settings. Seems like not :shrug: I will add this issue as a TODO. And take a stab later.
Thanks. I am waiting for the next version.
Hava a look at this release. Does it work for you? https://github.com/fr-ser/grafana-sqlite-datasource/releases/tag/v0.2.1
Variables in version 0.2.1 ZIP don't work for me. Variables in version 0.2.1 of TAR work fine. Thanks.
Do you have support for Options Multi-value?
is:
{var1, var2, var3, .......}
maybe it should be:
'var1', 'var2', 'var3', .......
in query:
select * from table where field1 in ($VAR)
Thanks again for a great job.
Weird. The zip worked for me :shrug:
And regarding multiple variables, have a look at formatting string here: https://grafana.com/docs/grafana/latest/variables/advanced-variable-format-options/#raw
Your example might need something like: select * from table where field1 in ($(VAR:csv))
Variables work very well.
select * from table where field1 in (${VARs: doublequote})
It solved the problem
Thanks
That is nice to hear. I will close the issue now. If something else regarding query variables comes up you can post here and I can reopen the issue or create a new issue :ok_hand:
Good job. Can you add Grafana variables to SQL?