opencdms-dev / pyopencdms-old

⭐🐍 pyopencdms aims to build a common Python API on top of multiple Climate Data Management Systems (CDMS) that use different underlying database engines
MIT License
4 stars 6 forks source link

Table comments missing from SQLAlchemy models #61

Open isedwards opened 1 year ago

isedwards commented 1 year ago

Some database schemas contain table and column comments (e.g. CliDE).

When we used sqlacodegen to create our SQLAlchemy models - any comments in the original SQL DDL were lost.

Should we add comments back in using the table comment parameter? We could also add new comments where they did not exist in the original schema definitions (e.g. Climsoft and MCH)?

A better approach would be to read the comments from the original schema and automate the process of adding these to our models. Where comments don't exist in the original schema we could maintain a dictionary to provide the missing information.

See comments for some Climsoft core tables here