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

Set table and field doc from postgres COMMENT #270

Open
jooon opened this issue Nov 17, 2020 · 1 comment
Open

Set table and field doc from postgres COMMENT #270

jooon opened this issue Nov 17, 2020 · 1 comment

Comments

@jooon
Copy link

jooon commented Nov 17, 2020

Postgres has a non-standard SQL concept called comment:

https://www.postgresql.org/docs/current/sql-comment.html

It shows up when you type \d+ in psql and a few other places and is a pretty nice way of documenting your database with the database.

It would be nice if these comments could be used to populate the avro doc fields. It will obviously be quite hard to figure out column descriptions if you run dbeam with --sqlFile, but if you run with --table it should be easier. This code could always try to probe the database for comments or only be activated by a flag.

If I have time later, I will try to add a pull-request, just wanted to first post my idea/feature request.

@rulle-io
Copy link
Contributor

Thanks for pointing to this (unknown for me) SQL concept.

dbeam currently gets all metadata information about an SQL table using interface ResultSetMetaData.
Using anything else (e.g. external utility psql) would make code much more complicated and vendor-specific.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants