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:
co-authored by
Jack Baldry
parent
aacc83be5c
commit
85c696c4ad
@@ -5,7 +5,7 @@ import { DB, SQLQuery, SQLSelectableValue, ValidationResults } from '../types';
|
||||
import { DatasetSelectorProps } from './DatasetSelector';
|
||||
import { TableSelectorProps } from './TableSelector';
|
||||
|
||||
const buildMockDB = (): DB => ({
|
||||
export const buildMockDB = (): DB => ({
|
||||
datasets: jest.fn(() => Promise.resolve(['dataset1', 'dataset2'])),
|
||||
tables: jest.fn((_ds: string | undefined) => Promise.resolve(['table1', 'table2'])),
|
||||
fields: jest.fn((_query: SQLQuery, _order?: boolean) => Promise.resolve<SQLSelectableValue[]>([])),
|
||||
@@ -13,6 +13,7 @@ const buildMockDB = (): DB => ({
|
||||
Promise.resolve<ValidationResults>({ query: { refId: '123' }, error: '', isError: false, isValid: true })
|
||||
),
|
||||
dsID: jest.fn(() => 1234),
|
||||
functions: jest.fn(() => []),
|
||||
getEditorLanguageDefinition: jest.fn(() => ({ id: '4567' })),
|
||||
toRawSql: (_query: SQLQuery) => '',
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user