chore: include view in PG

This commit is contained in:
tianzhou
2024-05-17 12:26:10 +08:00
parent 2293727e31
commit 0fe1f41086

View File

@@ -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]
);