Skip to content

Commit

Permalink
Merge pull request #1771 from grafana/gabor/postgres-id-fix
Browse files Browse the repository at this point in the history
handle changed postgres-plugin-id
  • Loading branch information
gabor authored Jan 9, 2024
2 parents dfe360b + 541ba8c commit 566985c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/datasource/components/ConfigEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ import {
import { Divider } from './Divider';
import { css } from '@emotion/css';

const SUPPORTED_SQL_DS = ['mysql', 'postgres', 'influxdb'];
// the postgres-plugin changed it's id, so we list both the old name and the new name
const SUPPORTED_SQL_DS = ['mysql', 'grafana-postgresql-datasource', 'postgres', 'influxdb'];

const authOptions: Array<SelectableValue<ZabbixAuthType>> = [
{ label: 'User and password', value: ZabbixAuthType.UserLogin },
Expand Down
8 changes: 6 additions & 2 deletions src/datasource/zabbix/connectors/sql/sqlConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ import dbConnector, {

const supportedDatabases = {
mysql: 'mysql',
postgres: 'postgres',
postgresOld: 'postgres',
postgresNew: 'grafana-postgresql-datasource',
};

export class SQLConnector extends DBConnector {
Expand All @@ -31,7 +32,10 @@ export class SQLConnector extends DBConnector {
}

loadSQLDialect() {
if (this.datasourceTypeId === supportedDatabases.postgres) {
if (
this.datasourceTypeId === supportedDatabases.postgresOld ||
this.datasourceTypeId === supportedDatabases.postgresNew
) {
this.sqlDialect = postgres;
} else {
this.sqlDialect = mysql;
Expand Down

0 comments on commit 566985c

Please sign in to comment.