Files
grafana/public/app/plugins/datasource/postgres/module.ts
T

33 lines
760 B
TypeScript
Raw Normal View History

2017-12-20 12:33:33 +01:00
import { PostgresDatasource } from './datasource';
import { PostgresQueryCtrl } from './query_ctrl';
import { PostgresConfigCtrl } from './config_ctrl';
2017-10-10 15:19:14 +02:00
const defaultQuery = `SELECT
extract(epoch from time_column) AS time,
text_column as text,
tags_column as tags
2017-10-10 15:19:14 +02:00
FROM
metric_table
WHERE
$__timeFilter(time_column)
`;
class PostgresAnnotationsQueryCtrl {
2017-12-20 12:33:33 +01:00
static templateUrl = 'partials/annotations.editor.html';
2017-10-10 15:19:14 +02:00
annotation: any;
/** @ngInject */
2017-10-10 15:19:14 +02:00
constructor() {
this.annotation.rawQuery = this.annotation.rawQuery || defaultQuery;
}
}
export {
PostgresDatasource,
PostgresDatasource as Datasource,
PostgresQueryCtrl as QueryCtrl,
PostgresConfigCtrl as ConfigCtrl,
2017-12-20 12:33:33 +01:00
PostgresAnnotationsQueryCtrl as AnnotationsQueryCtrl,
2017-10-10 15:19:14 +02:00
};