appsmithorg / appsmithorg/appsmith

[Feature] In a Postgres datasource, allow choosing a specific schema, and/or only display accessible tables

Open
#8,101 3 comments 1 reaction 0 assignees View on GitHub
Community Reported Enhancement Integrations Product Low effort Postgres Query & JS Pod Query Widgets & IDE Pod
Dominant language
TypeScript
Stars
40.9k
Forks
4.8k
Avg merge
1d 22h
Merged PRs (30d)
45

Description

## Summary

In a Postgres datasource, Instead of automatically querying pg_catalog for all tables/schemas, allow for a specific "schema" to be chosen, with the default being "public".

## Motivation

Currently, when choosing a Postgres database with many schemas besides "public", *all* the tables from *all* schemas are displayed in left panel, whether the database user has access to them or not. (This is a quirk of Postgres, that querying the pg_catalog table shows all schemas and tables whether privileges have been granted or not.)

## Additional Context

#There are two approaches, I've seen to this problem, ideally both may be implemented.
1. add a Schema field to the form where datasource is setup. Default is "public".
2. Metabase handles this beautifully, when adding a datasource, they query the privileges to only display tables that the database user has access to. It would be great if Appsmith could do this as well.
-------
Attached is a screenshot of the current result of adding a database with many schemas.

![Screenshot from 2021-09-30 21-19-38](https://user-images.githubusercontent.com/15368570/135683311-a44af886-3874-4a96-8d25-d071783860e7.png)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.