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

Support for column descriptions/comments #3069

Closed
Tracked by #3151 ...
domdomegg opened this issue Jul 19, 2023 · 8 comments
Closed
Tracked by #3151 ...

Support for column descriptions/comments #3069

domdomegg opened this issue Jul 19, 2023 · 8 comments
Assignees
Labels
ready Ready for implementation user reported Reported by a Mathesar user work: backend Related to Python, Django, and simple SQL work: frontend Related to frontend code in the mathesar_ui directory
Milestone

Comments

@domdomegg
Copy link

Problem

Managing large Postgres instances can become difficult if they're not well documented. As such, it's often desirable to have a way to add explanatory comments on tables or columns. This can be helpful for keeping things organised and understandable.

This also would align with features from other accessible data management platforms, like Airtable: https://support.airtable.com/docs/adding-descriptions-in-airtable

Proposed solution

Postgres allows storing comments alongside tables and columns. They can be read back with the comment retrieval functions: https://www.postgresql.org/docs/current/functions-info.html#FUNCTIONS-INFO-COMMENT-TABLE

It would be neat if Mathesar could store and retrieve database comments using these functions.

Additional context

I think we could do comment retrieval without being able to write them, at least as an initial version.

@kgodey
Copy link
Contributor

kgodey commented Jul 19, 2023

We already support reading and writing schema and table comments (they're surfaced as "description" in the UI to make it more user-friendly for non-technical users). We don't support column comments yet, but it should be quick to add.

We may also want to consider some sort of popover or help text that explains that descriptions are actual database comments. cc @ghislaineguerin

@kgodey kgodey added this to the Next release milestone Jul 19, 2023
@kgodey kgodey added work: design work: backend Related to Python, Django, and simple SQL work: frontend Related to frontend code in the mathesar_ui directory labels Jul 19, 2023
@kgodey kgodey added the user reported Reported by a Mathesar user label Jul 19, 2023
@seancolsen seancolsen changed the title Support for table and column comments Support for column descriptions/comments Jul 19, 2023
@seancolsen
Copy link
Contributor

seancolsen commented Jul 19, 2023

I updated the title to reflect that the remaining work relates only to columns.

@domdomegg if you're experiencing any difficulty using comments on tables or schemas, please let us know. Comments should already be syncing bidirectionally. That said, if you update a table or schema comment outside Mathesar, you'll need to manually sync those changes into Mathesar before you can see the comments in Mathesar.

@kgodey
Copy link
Contributor

kgodey commented Jul 19, 2023

@seancolsen Since this issue has been de-scoped to columns, I'd consider also making a separate issue for this potential action item:

We may also want to consider some sort of popover or help text that explains that descriptions are actual database comments.

@seancolsen
Copy link
Contributor

Good idea, @kgodey. I've splintered the design work off into #3071. As such, I've un-tagged this issue as "design" so that we can keep it focused on implementing comments for columns (which I think is rather straightforward and should not require any design work). I've also un-tagged this as draft because I think we have enough info to get started on this.

@domdomegg
Copy link
Author

Thanks both! I think the main thing I guess I wanted to raise was the column descriptions, which I think this issue tracks accurately (I didn't see the table descriptions, and while I care about it being stored in the Postgres database for interoperability with other tools, I don't think it's critical that this is made clear).

@kgodey
Copy link
Contributor

kgodey commented Jul 20, 2023

Thanks for clarifying @domdomegg!

@seancolsen
Copy link
Contributor

@domdomegg We've added support for column descriptions now. This feature will be in Mathesar 0.1.4 which should be released in the next few weeks. Descriptions are synchronized with the Postgres COMMENT value within Postgres, just like you wanted.

Here is where it shows up in the UI:

image

As such, I'm closing this issue.

If you have any further ideas or feedback about this new feature, we'd love to hear it! Feel free to comment here or open a new ticket. Thanks again for suggesting this feature!

@domdomegg
Copy link
Author

Looks awesome, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready Ready for implementation user reported Reported by a Mathesar user work: backend Related to Python, Django, and simple SQL work: frontend Related to frontend code in the mathesar_ui directory
Projects
No open projects
Development

No branches or pull requests

5 participants