From 0fe1f41086ac780f7fca962d5480301a58cc2c64 Mon Sep 17 00:00:00 2001 From: tianzhou Date: Fri, 17 May 2024 12:26:10 +0800 Subject: [PATCH] chore: include view in PG --- src/lib/connectors/postgres/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/connectors/postgres/index.ts b/src/lib/connectors/postgres/index.ts index db99c76..6be83bf 100644 --- a/src/lib/connectors/postgres/index.ts +++ b/src/lib/connectors/postgres/index.ts @@ -96,7 +96,7 @@ const getTableSchema = async (connection: Connection, databaseName: string): Pro connection.database = databaseName; const client = await newPostgresClient(connection); const { rows } = await client.query( - `SELECT table_schema, table_name FROM information_schema.tables WHERE table_schema NOT IN (${systemSchemas}) AND table_name NOT IN (${systemTables}) AND table_type='BASE TABLE' AND table_catalog=$1;`, + `SELECT table_schema, table_name FROM information_schema.tables WHERE table_schema NOT IN (${systemSchemas}) AND table_name NOT IN (${systemTables}) AND (table_type='BASE TABLE' or table_type='VIEW') AND table_catalog=$1;`, [databaseName] );