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

Use custom SQL construct for refreshing materialized views #703

Conversation

jpvanhal
Copy link
Collaborator

Add a custom SQL construct, RefreshMaterializedView, to compile the SQL for REFRESH MATERIALIZED VIEW ... command. Use the SQL construct in refresh_materialized_view function to execute the SQL. This resolves an issue where refresh_materialized_view crashed with AttributeError: 'NoneType' object has no attribute 'engine' when using Flask-SQLAlchemy 3.0 where session.bind is None.

Add a custom SQL construct, `RefreshMaterializedView`, to compile the
SQL for `REFRESH MATERIALIZED VIEW ...` command. Use the SQL construct
in `refresh_materialized_view` function to execute the SQL. This
resolves an issue where `refresh_materialized_view` crashed with
`AttributeError: 'NoneType' object has no attribute 'engine'` when using
Flask-SQLAlchemy 3.0 where `session.bind` is `None`.
@kvesteri kvesteri merged commit f2f7cf1 into kvesteri:master Apr 27, 2023
@jpvanhal jpvanhal deleted the use-custom-sql-construct-for-refresh-materialized-view branch April 27, 2023 11:17
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

Successfully merging this pull request may close these issues.

2 participants