SQL data sources: Convert to return data frames (#32257)

Convert SQL data sources to return data frames.

Co-authored-by: Marcus Efraimsson <marcus.efraimsson@gmail.com>
Co-authored-by: Arve Knudsen <arve.knudsen@gmail.com>
Co-authored-by: Will Browne <will.browne@grafana.com>
Co-authored-by: Hugo Häggmark <hugo.haggmark@gmail.com>
This commit is contained in:
ying-jeanne
2021-05-05 22:46:07 +08:00
committed by GitHub
parent 06c24476dc
commit bd66c8dde3
36 changed files with 4947 additions and 3711 deletions

View File

@ -1,6 +1,8 @@
import { PostgresDatasource } from './datasource';
import { PostgresQueryCtrl } from './query_ctrl';
import { PostgresConfigCtrl } from './config_ctrl';
import { PostgresQuery } from './types';
import { DataSourcePlugin } from '@grafana/data';
const defaultQuery = `SELECT
extract(epoch from time_column) AS time,
@ -24,10 +26,7 @@ class PostgresAnnotationsQueryCtrl {
}
}
export {
PostgresDatasource,
PostgresDatasource as Datasource,
PostgresQueryCtrl as QueryCtrl,
PostgresConfigCtrl as ConfigCtrl,
PostgresAnnotationsQueryCtrl as AnnotationsQueryCtrl,
};
export const plugin = new DataSourcePlugin<PostgresDatasource, PostgresQuery>(PostgresDatasource)
.setQueryCtrl(PostgresQueryCtrl)
.setConfigCtrl(PostgresConfigCtrl)
.setAnnotationQueryCtrl(PostgresAnnotationsQueryCtrl);