mirror of
https://github.com/grafana/grafana.git
synced 2025-07-28 07:02:22 +08:00

* 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>
23 lines
869 B
Markdown
23 lines
869 B
Markdown
---
|
|
headless: true
|
|
labels:
|
|
products:
|
|
- enterprise
|
|
- oss
|
|
---
|
|
|
|
#### Macros
|
|
|
|
You can enable macros support in the select clause to create time-series queries.
|
|
|
|
{{< docs/experimental product="Macros support in visual query builder" featureFlag="`sqlQuerybuilderFunctionParameters`" >}}
|
|
|
|
Use the **Data operations** drop-down to select a macro like `$__timeGroup` or `$__timeGroupAlias`.
|
|
Select a time column from the **Column** drop-down and a time interval from the **Interval** drop-down to create a time-series query.
|
|
|
|
{{< figure src="/media/docs/grafana/data-sources/screenshot-sql-builder-time-series-query.png" class="docs-image--no-shadow" caption="SQL query builder time-series query" >}}
|
|
|
|
You can also add custom value to the **Data operations**.
|
|
For example, a function that's not in the drop-down list.
|
|
This allows you to add any number of parameters.
|