Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG: Postgres column comments appear as (NULL) #2183

Open
maemigh opened this issue May 7, 2024 · 2 comments
Open

BUG: Postgres column comments appear as (NULL) #2183

maemigh opened this issue May 7, 2024 · 2 comments
Labels
accepted 👍 bug Something isn't working

Comments

@maemigh
Copy link

maemigh commented May 7, 2024

Describe the bug
When choosing "View Structure" on a postgres table, none of the column comments appear, simply showing (NULL) instead.

To Reproduce
Steps to reproduce the behavior:

  1. Right click on table and click View Structure

Expected behavior
Comments should appear

Screenshots / Gifs
If applicable, add screenshots or GIFS to help explain your problem.

Version Information (please complete the following information):

  • OS: Mac
  • App Version 4.3.1
  • Database type and version Postgres 16.2

Additional context
Pretty sure this was working in a previous version

@rathboma
Copy link
Collaborator

@ellipsis-dev fix this?

Copy link
Contributor

ellipsis-dev bot commented May 10, 2024

I was in the process of creating an implementation plan to fix the bug where column comments in the Postgres table structure view are showing as (NULL) instead of the actual comments. I have identified that the issue might be in the 'listTableColumns' function in the '/apps/studio/src/lib/db/clients/postgresql.ts' file, which fetches the table structure from the database but doesn't fetch the column comments. I have created a step to modify this function to fetch the column comments. However, I didn't have enough time to create a step to modify the 'tableData' computed property in the 'TableSchema.vue' file to include the column comments in the data passed to the Tabulator component. I would appreciate if someone could help with this. Thank you.

Implementation proposal (work in progress)

Step 1: Modify the 'listTableColumns' function to fetch column comments

In the '/apps/studio/src/lib/db/clients/postgresql.ts' file, modify the 'listTableColumns' function to fetch the column comments from the Postgres database. Add 'column_comment' to the SELECT clause of the SQL query. Map the 'column_comment' field to the 'comment' property of the returned objects. Make sure to handle any errors and edge cases, and to adhere to the existing code style and conventions.


For more information about Ellipsis, check the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted 👍 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants