Migrate backendSrv to getBackendSrv, fix direct DB connection
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import _ from 'lodash';
|
||||
import { getBackendSrv } from '@grafana/runtime';
|
||||
import { compactQuery } from '../../../utils';
|
||||
import mysql from './mysql';
|
||||
import postgres from './postgres';
|
||||
@@ -17,8 +18,7 @@ export class SQLConnector extends DBConnector {
|
||||
this.sqlDialect = null;
|
||||
|
||||
super.loadDBDataSource()
|
||||
.then(ds => {
|
||||
this.backendSrv = ds.backendSrv;
|
||||
.then(() => {
|
||||
this.loadSQLDialect();
|
||||
});
|
||||
}
|
||||
@@ -96,7 +96,7 @@ export class SQLConnector extends DBConnector {
|
||||
maxDataPoints: this.limit
|
||||
};
|
||||
|
||||
return this.backendSrv.datasourceRequest({
|
||||
return getBackendSrv().datasourceRequest({
|
||||
url: '/api/tsdb/query',
|
||||
method: 'POST',
|
||||
data: {
|
||||
|
||||
Reference in New Issue
Block a user