postgres/sql: fix imports (#74535)

* postgres/sql: fix imports

* nicer import

Co-authored-by: Adam Yeats <16296989+adamyeats@users.noreply.github.com>

---------

Co-authored-by: Adam Yeats <16296989+adamyeats@users.noreply.github.com>
This commit is contained in:
Gábor Farkas 2023-09-11 09:48:55 +02:00 committed by GitHub
parent 349408d78c
commit 6e75c5d182
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 8 additions and 8 deletions

View File

@ -1,7 +1,8 @@
import { uniqBy } from 'lodash'; import { uniqBy } from 'lodash';
import { DataFrame, MetricFindValue } from '@grafana/data'; import { DataFrame, MetricFindValue } from '@grafana/data';
import { ResponseParser as ResponseParserType } from 'app/features/plugins/sql/types';
import type { ResponseParser as ResponseParserType } from './types';
export class ResponseParser implements ResponseParserType { export class ResponseParser implements ResponseParserType {
transformMetricFindResponse(frame: DataFrame): MetricFindValue[] { transformMetricFindResponse(frame: DataFrame): MetricFindValue[] {

View File

@ -14,6 +14,7 @@ import {
CoreApp, CoreApp,
getSearchFilterScopedVar, getSearchFilterScopedVar,
LegacyMetricFindQueryOptions, LegacyMetricFindQueryOptions,
VariableWithMultiSupport,
} from '@grafana/data'; } from '@grafana/data';
import { EditorMode } from '@grafana/experimental'; import { EditorMode } from '@grafana/experimental';
import { import {
@ -22,13 +23,12 @@ import {
FetchResponse, FetchResponse,
getBackendSrv, getBackendSrv,
getTemplateSrv, getTemplateSrv,
toDataQueryResponse,
TemplateSrv, TemplateSrv,
reportInteraction, reportInteraction,
} from '@grafana/runtime'; } from '@grafana/runtime';
import { toDataQueryResponse } from '@grafana/runtime/src/utils/queryResponse';
import { getTimeSrv } from 'app/features/dashboard/services/TimeSrv'; import { getTimeSrv } from 'app/features/dashboard/services/TimeSrv';
import { VariableWithMultiSupport } from '../../../variables/types';
import { ResponseParser } from '../ResponseParser'; import { ResponseParser } from '../ResponseParser';
import { SqlQueryEditor } from '../components/QueryEditor'; import { SqlQueryEditor } from '../components/QueryEditor';
import { MACRO_NAMES } from '../constants'; import { MACRO_NAMES } from '../constants';

View File

@ -8,6 +8,7 @@ import {
updateDatasourcePluginJsonDataOption, updateDatasourcePluginJsonDataOption,
updateDatasourcePluginResetOption, updateDatasourcePluginResetOption,
} from '@grafana/data'; } from '@grafana/data';
import { config } from '@grafana/runtime';
import { import {
Alert, Alert,
InlineSwitch, InlineSwitch,
@ -19,7 +20,6 @@ import {
SecretInput, SecretInput,
Link, Link,
} from '@grafana/ui'; } from '@grafana/ui';
import { config } from 'app/core/config';
import { ConnectionLimits } from 'app/features/plugins/sql/components/configuration/ConnectionLimits'; import { ConnectionLimits } from 'app/features/plugins/sql/components/configuration/ConnectionLimits';
import { TLSSecretsConfig } from 'app/features/plugins/sql/components/configuration/TLSSecretsConfig'; import { TLSSecretsConfig } from 'app/features/plugins/sql/components/configuration/TLSSecretsConfig';
import { useMigrateDatabaseFields } from 'app/features/plugins/sql/components/configuration/useMigrateDatabaseFields'; import { useMigrateDatabaseFields } from 'app/features/plugins/sql/components/configuration/useMigrateDatabaseFields';

View File

@ -8,8 +8,7 @@ import {
updateDatasourcePluginJsonDataOption, updateDatasourcePluginJsonDataOption,
updateDatasourcePluginOption, updateDatasourcePluginOption,
} from '@grafana/data'; } from '@grafana/data';
import { getBackendSrv } from '@grafana/runtime'; import { getBackendSrv, getDataSourceSrv } from '@grafana/runtime';
import { getDatasourceSrv } from 'app/features/plugins/datasource_srv';
import { PostgresDatasource } from '../datasource'; import { PostgresDatasource } from '../datasource';
import { PostgresOptions, PostgresTLSModes, SecureJsonData } from '../types'; import { PostgresOptions, PostgresTLSModes, SecureJsonData } from '../types';
@ -38,7 +37,7 @@ export function useAutoDetectFeatures({ props, setVersionOptions }: Options) {
// This is needed or else we get an error when we try to save the datasource. // This is needed or else we get an error when we try to save the datasource.
updateDatasourcePluginOption({ options, onOptionsChange }, 'version', result.datasource.version); updateDatasourcePluginOption({ options, onOptionsChange }, 'version', result.datasource.version);
} else { } else {
const datasource = await getDatasourceSrv().loadDatasource(options.name); const datasource = await getDataSourceSrv().get(options.name);
if (datasource instanceof PostgresDatasource) { if (datasource instanceof PostgresDatasource) {
const version = await datasource.getVersion(); const version = await datasource.getVersion();

View File

@ -1,9 +1,9 @@
import { DataSourceInstanceSettings, ScopedVars } from '@grafana/data'; import { DataSourceInstanceSettings, ScopedVars } from '@grafana/data';
import { LanguageDefinition } from '@grafana/experimental'; import { LanguageDefinition } from '@grafana/experimental';
import { TemplateSrv } from '@grafana/runtime';
import { SqlDatasource } from 'app/features/plugins/sql/datasource/SqlDatasource'; import { SqlDatasource } from 'app/features/plugins/sql/datasource/SqlDatasource';
import { DB, SQLQuery, SQLSelectableValue } from 'app/features/plugins/sql/types'; import { DB, SQLQuery, SQLSelectableValue } from 'app/features/plugins/sql/types';
import { formatSQL } from 'app/features/plugins/sql/utils/formatSQL'; import { formatSQL } from 'app/features/plugins/sql/utils/formatSQL';
import { TemplateSrv } from 'app/features/templating/template_srv';
import { PostgresQueryModel } from './PostgresQueryModel'; import { PostgresQueryModel } from './PostgresQueryModel';
import { getSchema, getTimescaleDBVersion, getVersion, showTables } from './postgresMetaQuery'; import { getSchema, getTimescaleDBVersion, getVersion, showTables } from './postgresMetaQuery';