InfluxDB: SQL Query Editor (#72168)

* Add influxdbSqlSupport feature toggle

* Add SQL option to the config page

* Add SQL backend

* Add metadata support in config page

* Implement unified querying

* Fix healthcheck query

* fsql tests

* secure grpc by default

* code cleanup

* Query handing for sql mode

* Implement a placeholder sql editor

* Fix query language dropdown

* drop in SQL editor

* switch to use rawSql, get sql editor working

* fix healthcheck

* WIP

* memoize component to stop unwanted rerender onQuery

* dont reinit datasource on each render of the editor

* remove useless memo

* clean up

* Fix the link

* Alpha state warning

* Remove console.logs

* update model for fsql

* remove unused

---------

Co-authored-by: Galen <galen.kistler@grafana.com>
This commit is contained in:
ismail simsek
2023-08-02 19:04:16 +02:00
committed by GitHub
co-authored by Galen
parent 9c6a9a3977
commit d333c09418
7 changed files with 265 additions and 55 deletions
+2 -2
View File
@@ -17,10 +17,10 @@ type queryModel struct {
// to [(*FlightSQLDatasource).QueryData].
type queryRequest struct {
RefID string `json:"refId"`
RawQuery string `json:"query"`
RawQuery string `json:"rawSql"`
IntervalMilliseconds int `json:"intervalMs"`
MaxDataPoints int64 `json:"maxDataPoints"`
Format string `json:"resultFormat"`
Format string `json:"format"`
}
func getQueryModel(dataQuery backend.DataQuery) (*queryModel, error) {
+1 -1
View File
@@ -124,7 +124,7 @@ func CheckSQLHealth(ctx context.Context, dsInfo *models.DatasourceInfo, req *bac
Queries: []backend.DataQuery{
{
RefID: refID,
JSON: []byte(`{ "query": "select 1", "resultFormat": "table" }`),
JSON: []byte(`{ "rawSql": "select 1", "format": "table" }`),
Interval: 1 * time.Minute,
MaxDataPoints: 423,
TimeRange: backend.TimeRange{