From d103c5853997c85ed4cc1c055d18446dea40dea8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zolt=C3=A1n=20Bedi?= Date: Mon, 6 Feb 2023 15:16:32 +0100 Subject: [PATCH] MSSQL/Postgres: List views in table dropdown as well (#62867) * MSSQL: Query views for table dropdown * Postgres: Query views for table dropdown --- public/app/plugins/datasource/mssql/MSSqlMetaQuery.ts | 3 +-- public/app/plugins/datasource/postgres/postgresMetaQuery.ts | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/public/app/plugins/datasource/mssql/MSSqlMetaQuery.ts b/public/app/plugins/datasource/mssql/MSSqlMetaQuery.ts index 3da2f46a71f..070be7252c8 100644 --- a/public/app/plugins/datasource/mssql/MSSqlMetaQuery.ts +++ b/public/app/plugins/datasource/mssql/MSSqlMetaQuery.ts @@ -5,8 +5,7 @@ export function showDatabases() { export function getSchemaAndName(database?: string) { return `SELECT TABLE_SCHEMA + '.' + TABLE_NAME as schemaAndName - FROM [${database}].INFORMATION_SCHEMA.TABLES - WHERE TABLE_TYPE = 'BASE TABLE'`; + FROM [${database}].INFORMATION_SCHEMA.TABLES`; } export function getSchema(database?: string, table?: string) { diff --git a/public/app/plugins/datasource/postgres/postgresMetaQuery.ts b/public/app/plugins/datasource/postgres/postgresMetaQuery.ts index 7a56a81b441..80b0466f91c 100644 --- a/public/app/plugins/datasource/postgres/postgresMetaQuery.ts +++ b/public/app/plugins/datasource/postgres/postgresMetaQuery.ts @@ -16,7 +16,7 @@ export function showTables() { '_timescaledb_config', 'timescaledb_information', 'timescaledb_experimental') - and table_type = 'BASE TABLE' and ${buildSchemaConstraint()}`; + and ${buildSchemaConstraint()}`; } export function getSchema(table?: string) {