Im developing a datasource backend plugin for calling some data from a postgresql database. Im able to connect to the database and make queries when pressing on a button in my query editor by using this.props.onRunQuery();
However, Im not able to make queries when pressing on the “Refresh dashboard” button (top right). So the data I get when creating the panel is static.
How can I make a query when pressing that button? Any help? Why the refresh dashboard button dosen’t make any more queries?
The query method on your DataSourceApi class is executed every time the user requests new data (by for example clicking the Refresh button). Try adding a log statement at the start of your query method. It should log every time you press refresh.
I found the problem:
I construct the SQL query when pushing a button in the QueryEditor so the query doesn’t change when pressing the “Refresh dashboard” button.
I think what I should do is create the SQL query in the function query inside datasource.ts file.