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 Views and Materialized Views #719

Open
stevennic opened this issue Jul 6, 2024 · 0 comments
Open

Support Views and Materialized Views #719

stevennic opened this issue Jul 6, 2024 · 0 comments

Comments

@stevennic
Copy link

I find it convenient to declare my Views and Mat Views as Entities too. This allows ORM-based lookups and logical foreign keys against views to work seamlessly. However, if I set create_tables=True in generate_mapping, it attempts to create the Views as tables, and to create things like FK constraints against them, which leads to a DB error. It would be nice if we could flag an entity as a "non table" so it is exempt from some DDL, while still allowing it to behave as an entity. It would even be ok if we didn't try to stop the user from attempting to insert or update an entry as that would be a reasonable caveat, but at least it shouldn't prevent other entities from being created due to a DB exception on the views.

SqlAlchemy uses the __abstract__ directive for this purpose.

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

1 participant