Postgres: For template queries return [] and not error (#38060)

* Postgres: For template queries return [] and not error

* remove the console error

* update mssql and mysql

Co-authored-by: Ying WANG <ying.wang@grafana.com>
pull/38016/head
Ivana Huckova 4 years ago committed by GitHub
parent ecfa32c8cb
commit 7f8576ee37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      CONTRIBUTING.md
  2. 5
      docs/README.md
  3. 3
      public/app/plugins/datasource/mssql/datasource.ts
  4. 3
      public/app/plugins/datasource/mysql/datasource.ts
  5. 7
      public/app/plugins/datasource/postgres/datasource.ts

@ -26,10 +26,12 @@ Report a bug by submitting a [bug report](https://github.com/grafana/grafana/iss
Follow the issue template and add additional information that will help us replicate the problem.
For data visualization issues:
- Query results from the inspect drawer (data tab & query inspector)
- Panel settings can be extracted in the panel inspect drawer JSON tab
For a dashboard related issues:
- Dashboard JSON can be found in the dashboard settings JSON model view
For authentication and alerting Grafana server logs are useful.

@ -25,6 +25,7 @@ Edit content in the `sources` directory.
Use the Hugo shortcode [relref](https://gohugo.io/content-management/cross-references/#use-ref-and-relref) any time you are linking to other internal docs pages.
Syntax is:
```
{{< relref "example.md" >}}
```
@ -57,7 +58,7 @@ Images are currently hosted in the grafana/website repo.
When a PR is merged with changes in the `docs/sources` directory, those changes are automatically synced by a GitHub action (`.github/workflows/publish.yml`) to the grafana/website repo.
* A PR that targets the `main` branch syncs to the `content/docs/grafana/next` directory in the `website` repository, and publishes to `https://grafana.com/docs/grafana/next/`.
* A PR targeting the `latest/current` release branch syncs to the `content/docs/grafana/latest` directory in the `website` repository, and publishes to `https://grafana.com/docs/grafana/latest/`.
- A PR that targets the `main` branch syncs to the `content/docs/grafana/next` directory in the `website` repository, and publishes to `https://grafana.com/docs/grafana/next/`.
- A PR targeting the `latest/current` release branch syncs to the `content/docs/grafana/latest` directory in the `website` repository, and publishes to `https://grafana.com/docs/grafana/latest/`.
Once the sync is complete, the website will automatically publish to production - no further action is needed.

@ -147,6 +147,9 @@ export class MssqlDatasource extends DataSourceWithBackend<MssqlQuery, MssqlOpti
.pipe(
map((rsp) => {
return this.responseParser.transformMetricFindResponse(rsp);
}),
catchError((err) => {
return of([]);
})
)
);

@ -157,6 +157,9 @@ export class MysqlDatasource extends DataSourceWithBackend<MySQLQuery, MySQLOpti
.pipe(
map((rsp) => {
return this.responseParser.transformMetricFindResponse(rsp);
}),
catchError((err) => {
return of([]);
})
)
);

@ -1,6 +1,6 @@
import { map as _map } from 'lodash';
import { lastValueFrom } from 'rxjs';
import { map } from 'rxjs/operators';
import { lastValueFrom, of } from 'rxjs';
import { map, catchError } from 'rxjs/operators';
import { BackendDataSourceResponse, DataSourceWithBackend, FetchResponse, getBackendSrv } from '@grafana/runtime';
import { AnnotationEvent, DataSourceInstanceSettings, MetricFindValue, ScopedVars } from '@grafana/data';
@ -159,6 +159,9 @@ export class PostgresDatasource extends DataSourceWithBackend<PostgresQuery, Pos
.pipe(
map((rsp) => {
return this.responseParser.transformMetricFindResponse(rsp);
}),
catchError((err) => {
return of([]);
})
)
);

Loading…
Cancel
Save