SQL: Add macro support in select case (#88514)

* Feat: timeGroup macro handling in VQB

* Add tests

* Add functions to SQL ds

* Fix lint errors

* Add feature toggle

* Add rendering based on object

* Fix lint

* Fix CI failures

* Fix tests

* Address review comments

* Add docs

* Fix JSX runtime warnings

* Remove docs part that mentions suggest more macros

* Update docs/sources/shared/datasources/sql-query-builder-macros.md

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>

* Add smoke test for this feature

* lint

* Add supported macros to influx

* Add setupTests.ts to include in tsconfig.json

* Import jest-dom instead of setupTests.ts

---------

Co-authored-by: Jack Baldry <jack.baldry@grafana.com>
This commit is contained in:
Zoltán Bedi
2024-11-04 17:13:35 +01:00
committed by GitHub
co-authored by Jack Baldry
parent aacc83be5c
commit 85c696c4ad
39 changed files with 1103 additions and 139 deletions
+1
View File
@@ -28,5 +28,6 @@ const (
enterpriseDatasourcesSquad codeowner = "@grafana/enterprise-datasources"
grafanaSharingSquad codeowner = "@grafana/sharing-squad"
grafanaDatabasesFrontend codeowner = "@grafana/databases-frontend"
grafanaOSSBigTent codeowner = "@grafana/oss-big-tent"
growthAndOnboarding codeowner = "@grafana/growth-and-onboarding"
)
+7
View File
@@ -1305,6 +1305,13 @@ var (
Owner: grafanaPluginsPlatformSquad,
Expression: "false", // disabled by default
},
{
Name: "sqlQuerybuilderFunctionParameters",
Description: "Enables SQL query builder function parameters",
Stage: FeatureStageExperimental,
Owner: grafanaOSSBigTent,
FrontendOnly: true,
},
{
Name: "azureMonitorPrometheusExemplars",
Description: "Allows configuration of Azure Monitor as a data source that can provide Prometheus exemplars",
+1
View File
@@ -171,6 +171,7 @@ alertingDisableSendAlertsExternal,experimental,@grafana/alerting-squad,false,fal
preserveDashboardStateWhenNavigating,experimental,@grafana/dashboards-squad,false,false,false
alertingCentralAlertHistory,experimental,@grafana/alerting-squad,false,false,true
pluginProxyPreserveTrailingSlash,GA,@grafana/plugins-platform-backend,false,false,false
sqlQuerybuilderFunctionParameters,experimental,@grafana/oss-big-tent,false,false,true
azureMonitorPrometheusExemplars,preview,@grafana/partner-datasources,false,false,false
pinNavItems,GA,@grafana/grafana-frontend-platform,false,false,false
authZGRPCServer,experimental,@grafana/identity-access-team,false,false,false
1 Name Stage Owner requiresDevMode RequiresRestart FrontendOnly
171 preserveDashboardStateWhenNavigating experimental @grafana/dashboards-squad false false false
172 alertingCentralAlertHistory experimental @grafana/alerting-squad false false true
173 pluginProxyPreserveTrailingSlash GA @grafana/plugins-platform-backend false false false
174 sqlQuerybuilderFunctionParameters experimental @grafana/oss-big-tent false false true
175 azureMonitorPrometheusExemplars preview @grafana/partner-datasources false false false
176 pinNavItems GA @grafana/grafana-frontend-platform false false false
177 authZGRPCServer experimental @grafana/identity-access-team false false false
+4
View File
@@ -695,6 +695,10 @@ const (
// Preserve plugin proxy trailing slash.
FlagPluginProxyPreserveTrailingSlash = "pluginProxyPreserveTrailingSlash"
// FlagSqlQuerybuilderFunctionParameters
// Enables SQL query builder function parameters
FlagSqlQuerybuilderFunctionParameters = "sqlQuerybuilderFunctionParameters"
// FlagAzureMonitorPrometheusExemplars
// Allows configuration of Azure Monitor as a data source that can provide Prometheus exemplars
FlagAzureMonitorPrometheusExemplars = "azureMonitorPrometheusExemplars"
+13
View File
@@ -2985,6 +2985,19 @@
"codeowner": "@grafana/grafana-app-platform-squad"
}
},
{
"metadata": {
"name": "sqlQuerybuilderFunctionParameters",
"resourceVersion": "1718487716739",
"creationTimestamp": "2024-06-15T21:41:56Z"
},
"spec": {
"description": "Enables SQL query builder function parameters",
"stage": "experimental",
"codeowner": "@grafana/oss-big-tent",
"frontend": true
}
},
{
"metadata": {
"name": "sseGroupByDatasource",