djrobstep / migra

Like diff but for PostgreSQL schemas
https://databaseci.com/docs/migra
The Unlicense
2.9k stars 124 forks source link

Comments not supported #69

Open bfelbo opened 5 years ago

bfelbo commented 5 years ago

I mentioned this in #62, but I think it deserves its own issue. Comments are important for teams and can be needed for functionality. For instance, postgraphile uses table comments extensively to decide which GraphQL queries/mutations to expose. It seems like others also need comments (#45).

bfelbo commented 5 years ago

@djrobstep What would be needed just for table, function and column comments?

telmotrooper commented 5 years ago

Sorry to bump an old issue, but I'd also like for comments to be supported. In fact, I've been using them together with SchemaSpy (which interprets them as Markdown and generates a HTML documentation for the database) and the result is quite nice.

emmanuel commented 4 years ago

I, too would like support for comments. I am also using Postgraphile. Also SchemaSpy looks very interesting as a form of (potentially publishable) schema documentation.

Thankfully, Postgraphile recently gained support for using an external file to provide smart tags, in lieu of comments in the database (https://www.graphile.org/postgraphile/smart-tags-file/).

tolmacevalexandr commented 4 years ago

I implemented support for comments on functions, columns, and selectable objects (pg_class). Here is the commits: schemainspect: https://github.com/tolmacevalexandr/schemainspect/commit/5d020246ab554a69f30f8e4e14bd29b288c55e73 , and migra: https://github.com/tolmacevalexandr/migra/commit/0343f1eb43daca3991e65745683011c4af8a3034

bfelbo commented 4 years ago

Amazing, @tolmacevalexandr! Thanks a lot for adding that.

How hard would it be to support comments on constraints as well?

AFAIK, your implementation would then cover all comments needed for Postgraphile.

tolmacevalexandr commented 4 years ago

How hard would it be to support comments on constraints as well?

It's not so hard, I think. But now I'm faced to conceptual problem: how to run upgraded migra and test new features: https://github.com/djrobstep/migra/issues/119 Sorry, I'm new to python... Need help!

tolmacevalexandr commented 4 years ago

How hard would it be to support comments on constraints as well?

Added comments on triggers & constraints. See commits.

eleasarchriso commented 4 years ago

Amazing, @tolmacevalexandr! Thanks a lot for adding that.

How hard would it be to support comments on constraints as well?

AFAIK, your implementation would then cover all comments needed for Postgraphile.

Exactly my use case. This tool looks really great but the comment support would really be needed to use it together with PostGraphile.

tolmacevalexandr commented 4 years ago

@djrobstep Hi! You wrote a comment to my commit more than month ago: https://github.com/tolmacevalexandr/schemainspect/commit/5d020246ab554a69f30f8e4e14bd29b288c55e73#comments

Hey, thanks so much for this PR! A sorely needed feature. It looks pretty good, but is there any chance you could add some basic tests? I can't really risk merging code that isn't tested.

Unfortunately, apparently the commits page doesn't send notifications to my email. If this task is still relevant, I am ready to write tests for 'comments' PR.

But I'm new to writing tests, though. Can you briefly explain to me how to run tests? Where do I add my new tests? To file tests/test_all.py, or create a new one tests/test_comments.py ? How do I enable new tests for running?

meglio commented 4 years ago

Hello everyone, any progress on supporting comments?