sqlalchemy / sqlalchemy/alembic
models that refer to a view with Table, the Table comes up in autogenerate. how to make this easier?
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 4.4k
- Forks
- 375
- PR merge metrics
- No merged PRs in 30d
Description
Migrated issue, originally created by Michael Bayer (@zzzeek)
this is probably what was seen in #273 but wasn't well-described. if an application uses Table on the model side to refer to a view in the database, we don't consult inspector.get_view_names() in order to exclude these. An include_object rule can of course fix this, however we at least should document this workaround, and perhaps add a configure flag "exclude_views=True" that does this automatically.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review Alembic autogeneration's handling of model-side Table objects, especially inspector.get_view_names() and the include_object workaround described here. First determine whether the contribution should document the workaround or introduce an exclude_views configuration option; done means the chosen behavior is documented or consistently excludes database views, with coverage for the affected autogenerate case.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, sqlalchemy
- Domain
- databases, documentation
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100